/** helper to test SpecialRecentchanges::buildMainQueryConds() */ private function assertConditions($expected, $requestOptions = null, $message = '') { $context = new RequestContext(); $context->setRequest(new FauxRequest($requestOptions)); # setup the rc object $this->rc = new SpecialRecentChanges(); $this->rc->setContext($context); $formOptions = $this->rc->setup(null); # Filter out rc_timestamp conditions which depends on the test runtime # This condition is not needed as of march 2, 2011 -- hashar # @todo FIXME: Find a way to generate the correct rc_timestamp $queryConditions = array_filter($this->rc->buildMainQueryConds($formOptions), 'SpecialRecentchangesTest::filterOutRcTimestampCondition'); $this->assertEquals($expected, $queryConditions, $message); }
/** helper to test SpecialRecentchanges::buildMainQueryConds() */ private function assertConditions($expected, $requestOptions = null, $message = '') { global $wgRequest; $savedGlobal = $wgRequest; # Initialize a WebRequest object ... $wgRequest = new FauxRequest($requestOptions); # ... then setup the rc object (which use wgRequest internally) $this->rc = new SpecialRecentChanges(); $formOptions = $this->rc->setup(null); # Filter out rc_timestamp conditions which depends on the test runtime # This condition is not needed as of march 2, 2011 -- hashar # @todo FIXME: Find a way to generate the correct rc_timestamp $queryConditions = array_filter($this->rc->buildMainQueryConds($formOptions), 'SpecialRecentchangesTest::filterOutRcTimestampCondition'); $this->assertEquals($expected, $queryConditions, $message); $wgRequest = $savedGlobal; }