testEnvironment = new TestEnvironment(); $this->testDatabaseTableBuilder = TestDatabaseTableBuilder::getInstance( $this->getStore() ); try { $this->testDatabaseTableBuilder->doBuild(); } catch ( RuntimeException $e ) { $this->isUsableUnitTestDatabase = false; } $this->testEnvironment->registerObject( 'Store', $this->getStore() ); } protected function tearDown(): void { $this->testEnvironment->tearDown(); parent::tearDown(); } public function testCanConstruct() { $title = $this->getMockBuilder( '\MediaWiki\Title\Title' ) ->disableOriginalConstructor() ->getMock(); $this->assertInstanceOf( 'SMW\MediaWiki\Jobs\FulltextSearchTableRebuildJob', new FulltextSearchTableRebuildJob( $title ) ); } /** * @dataProvider parametersProvider */ public function testRunJob( $parameters ) { $subject = DIWikiPage::newFromText( __METHOD__ ); $instance = new FulltextSearchTableRebuildJob( $subject->getTitle(), $parameters ); $this->assertTrue( $instance->run() ); } public function parametersProvider() { $provider[] = [ [] ]; $provider[] = [ [ 'table' => 'Foo' ] ]; $provider[] = [ [ 'mode' => 'full' ] ]; return $provider; } protected function getStore() { return StoreFactory::getStore(); } }