testEnvironment = new TestEnvironment(); $this->jobFactory = $this->getMockBuilder( '\SMW\MediaWiki\JobFactory' ) ->disableOriginalConstructor() ->getMock(); } protected function tearDown(): void { $this->testEnvironment->tearDown(); parent::tearDown(); } public function testCanConstruct() { $instance = new UpdateTask( $this->jobFactory ); $this->assertInstanceOf( UpdateTask::class, $instance ); } public function testProcess() { $updateJob = $this->getMockBuilder( '\SMW\MediaWiki\Jobs\UpdateJob' ) ->disableOriginalConstructor() ->getMock(); $updateJob->expects( $this->atLeastOnce() ) ->method( 'run' ); $this->jobFactory->expects( $this->atLeastOnce() ) ->method( 'newUpdateJob' ) ->willReturn( $updateJob ); $instance = new UpdateTask( $this->jobFactory ); $instance->process( [ 'subject' => 'Foo#0##', 'ref' => [ 'Bar' ] ] ); } }