Пример #1
0
 /**
  * @group Slow
  * @slowExecutionTime 0.08024 ms
  * @covers Wikia\Search\Hooks::onWikiFactoryPublicStatusChange
  */
 public function testOnWikiFactoryPublicStatusChange()
 {
     $mockIndexer = $this->getMock('Wikia\\Search\\Indexer', array('reindexWiki', 'deleteWikiDocs'));
     $hooks = new \Wikia\Search\Hooks();
     $mockIndexer->expects($this->at(0))->method('deleteWikiDocs')->will($this->returnValue(true));
     $status = 0;
     $wid = 123;
     $this->mockClass('Wikia\\Search\\Indexer', $mockIndexer);
     $this->assertTrue($hooks->onWikiFactoryPublicStatusChange($status, $wid, 'why not'));
     $mockIndexer->expects($this->at(0))->method('reindexWiki')->will($this->returnValue(true));
     $status = 1;
     $this->mockClass('Wikia\\Search\\Indexer', $mockIndexer);
     $this->assertTrue($hooks->onWikiFactoryPublicStatusChange($status, $wid, 'why not'));
 }