74 lines
1.4 KiB
PHP
74 lines
1.4 KiB
PHP
<?php
|
|
|
|
namespace SMW\Tests\MediaWiki\Jobs;
|
|
|
|
use SMW\DIWikiPage;
|
|
use SMW\MediaWiki\Jobs\ChangePropagationUpdateJob;
|
|
use SMW\Tests\TestEnvironment;
|
|
|
|
/**
|
|
* @covers \SMW\MediaWiki\Jobs\ChangePropagationUpdateJob
|
|
* @group semantic-mediawiki
|
|
*
|
|
* @license GPL-2.0-or-later
|
|
* @since 3.0
|
|
*
|
|
* @author mwjames
|
|
*/
|
|
class ChangePropagationUpdateJobTest extends \PHPUnit\Framework\TestCase {
|
|
|
|
private $testEnvironment;
|
|
|
|
protected function setUp(): void {
|
|
parent::setUp();
|
|
|
|
$this->testEnvironment = new TestEnvironment();
|
|
|
|
$store = $this->getMockBuilder( '\SMW\SQLStore\SQLStore' )
|
|
->disableOriginalConstructor()
|
|
->getMock();
|
|
|
|
$this->testEnvironment->registerObject( 'Store', $store );
|
|
}
|
|
|
|
protected function tearDown(): void {
|
|
$this->testEnvironment->tearDown();
|
|
parent::tearDown();
|
|
}
|
|
|
|
public function testCanConstruct() {
|
|
$title = $this->getMockBuilder( '\MediaWiki\Title\Title' )
|
|
->disableOriginalConstructor()
|
|
->getMock();
|
|
|
|
$this->assertInstanceOf(
|
|
ChangePropagationUpdateJob::class,
|
|
new ChangePropagationUpdateJob( $title )
|
|
);
|
|
}
|
|
|
|
/**
|
|
* @dataProvider jobProvider
|
|
*/
|
|
public function testRun( $subject, $parameters ) {
|
|
$instance = new ChangePropagationUpdateJob(
|
|
$subject->getTitle(),
|
|
$parameters
|
|
);
|
|
|
|
$this->assertTrue(
|
|
$instance->run()
|
|
);
|
|
}
|
|
|
|
public function jobProvider() {
|
|
$provider[] = [
|
|
DIWikiPage::newFromText( __METHOD__ ),
|
|
[]
|
|
];
|
|
|
|
return $provider;
|
|
}
|
|
|
|
}
|