Index: trunk/phase3/tests/qunit/suites/resources/mediawiki.util/mediawiki.util.js |
— | — | @@ -72,79 +72,6 @@ |
73 | 73 | |
74 | 74 | }); |
75 | 75 | |
76 | | -test( 'getActionFrom', function(){ |
77 | | - |
78 | | - // Example urls |
79 | | - var urlA = 'http://mediawiki.org/wiki/Article', |
80 | | - urlB = 'http://mediawiki.org/w/index.php?title=Article&action=edit', |
81 | | - urlC = 'http://mediawiki.org/edit/Article', |
82 | | - urlD = 'http://mediawiki.org/w/index.php/Article'; |
83 | | - |
84 | | - // Common settings |
85 | | - mw.config.set( { |
86 | | - 'wgActionPaths': [], |
87 | | - 'wgArticlePath': '/wiki/$1' |
88 | | - }); |
89 | | - |
90 | | - equal( mw.util.getActionFrom( urlA ), 'view', 'wgArticlePath (/wiki/$1) support' ); |
91 | | - equal( mw.util.getActionFrom( urlB ), 'edit', 'action-parameter support' ); |
92 | | - |
93 | | - // Custom settings |
94 | | - mw.config.set( 'wgActionPaths', { |
95 | | - 'view': '/view/$1', |
96 | | - 'edit': '/edit/$1' |
97 | | - }); |
98 | | - |
99 | | - equal( mw.util.getActionFrom( urlB ), 'edit', 'action-parameter support with action path' ); |
100 | | - equal( mw.util.getActionFrom( urlC ), 'edit', 'wgActionPaths support' ); |
101 | | - |
102 | | - // Default settings |
103 | | - mw.config.set( { |
104 | | - 'wgActionPaths': [], |
105 | | - 'wgArticlePath': '/w/index.php/$1' |
106 | | - }); |
107 | | - equal( mw.util.getActionFrom( urlB ), 'edit', 'action-parameter support with default settings' ); |
108 | | - equal( mw.util.getActionFrom( urlD ), 'view', 'wgArticlePath (/index.php/$1) support' ); |
109 | | - |
110 | | -}); |
111 | | - |
112 | | -test( 'getTitleFrom', function(){ |
113 | | - |
114 | | - // Example urls |
115 | | - var urlA = 'http://mediawiki.org/wiki/Article', |
116 | | - urlB = 'http://mediawiki.org/w/index.php?title=Article&action=edit', |
117 | | - urlC = 'http://mediawiki.org/edit/Article', |
118 | | - urlD = 'http://mediawiki.org/w/index.php/Article'; |
119 | | - |
120 | | - // Common settings |
121 | | - mw.config.set( { |
122 | | - 'wgActionPaths': [], |
123 | | - 'wgArticlePath': '/wiki/$1' |
124 | | - }); |
125 | | - |
126 | | - equal( mw.util.getTitleFrom( urlA ), 'Article', 'wgArticlePath (/wiki/$1) support' ); |
127 | | - equal( mw.util.getTitleFrom( urlB ), 'Article', 'title-parameter support' ); |
128 | | - |
129 | | - // Custom settings |
130 | | - mw.config.set( 'wgActionPaths', { |
131 | | - 'view': '/view/$1', |
132 | | - 'edit': '/edit/$1' |
133 | | - }); |
134 | | - |
135 | | - equal( mw.util.getTitleFrom( urlB ), 'Article', 'title-parameter support with action path' ); |
136 | | - equal( mw.util.getTitleFrom( urlC ), 'Article', 'wgActionPaths support' ); |
137 | | - |
138 | | - // Default settings |
139 | | - mw.config.set( { |
140 | | - 'wgActionPaths': [], |
141 | | - 'wgArticlePath': '/w/index.php/$1' |
142 | | - }); |
143 | | - |
144 | | - equal( mw.util.getTitleFrom( urlB ), 'Article', 'title-parameter support with default settings' ); |
145 | | - equal( mw.util.getTitleFrom( urlD ), 'Article', 'wgArticlePath (/index.php/$1) support' ); |
146 | | - |
147 | | -}); |
148 | | - |
149 | 76 | test( 'tooltipAccessKey', function(){ |
150 | 77 | |
151 | 78 | equal( typeof mw.util.tooltipAccessKeyPrefix, 'string', 'mw.util.tooltipAccessKeyPrefix must be a string' ); |