Index: trunk/phase3/tests/phpunit/includes/specials/SpecialRecentchanges.php |
— | — | @@ -18,13 +18,12 @@ |
19 | 19 | |
20 | 20 | /** helper to test SpecialRecentchanges::buildMainQueryConds() */ |
21 | 21 | private function assertConditions( $expected, $requestOptions = null, $message = '' ) { |
22 | | - global $wgRequest; |
23 | | - $savedGlobal = $wgRequest; |
| 22 | + $context = new RequestContext; |
| 23 | + $context->setRequest( new FauxRequest( $requestOptions ) ); |
24 | 24 | |
25 | | - # Initialize a WebRequest object ... |
26 | | - $wgRequest = new FauxRequest( $requestOptions ); |
27 | | - # ... then setup the rc object (which use wgRequest internally) |
| 25 | + # setup the rc object |
28 | 26 | $this->rc = new SpecialRecentChanges(); |
| 27 | + $this->rc->setContext( $context ); |
29 | 28 | $formOptions = $this->rc->setup( null ); |
30 | 29 | |
31 | 30 | # Filter out rc_timestamp conditions which depends on the test runtime |
— | — | @@ -40,8 +39,6 @@ |
41 | 40 | $queryConditions, |
42 | 41 | $message |
43 | 42 | ); |
44 | | - |
45 | | - $wgRequest = $savedGlobal; |
46 | 43 | } |
47 | 44 | |
48 | 45 | /** return false if condition begin with 'rc_timestamp ' */ |
— | — | @@ -88,7 +85,7 @@ |
89 | 86 | array( # expected |
90 | 87 | #0 => "rc_timestamp >= '20110223000000'", |
91 | 88 | 'rc_bot' => 0, |
92 | | - 1 => sprintf( "(rc_namespace = '%s' OR rc_namespace = '%s')", $ns1, $ns2 ), |
| 89 | + 1 => sprintf( "rc_namespace IN ('%s','%s')", $ns1, $ns2 ), |
93 | 90 | ), |
94 | 91 | array( |
95 | 92 | 'namespace' => $ns1, |
— | — | @@ -107,7 +104,7 @@ |
108 | 105 | array( # expected |
109 | 106 | #0 => "rc_timestamp >= '20110223000000'", |
110 | 107 | 'rc_bot' => 0, |
111 | | - 1 => sprintf( "(rc_namespace != '%s' AND rc_namespace != '%s')", $ns1, $ns2 ), |
| 108 | + 1 => sprintf( "rc_namespace NOT IN ('%s','%s')", $ns1, $ns2 ), |
112 | 109 | ), |
113 | 110 | array( |
114 | 111 | 'namespace' => $ns1, |