Fix getMock Migration

This commit is contained in:
Roeland Jago Douma 2016-09-07 20:18:04 +02:00
parent b8b9fc2b1c
commit 1b5ed67857
No known key found for this signature in database
GPG Key ID: 1E152838F164D13B
1 changed files with 4 additions and 2 deletions

View File

@ -75,7 +75,9 @@ class BackgroundRepairTest extends TestCase {
$this->logger = $this->getMockBuilder('OCP\ILogger')
->disableOriginalConstructor()
->getMock();
$this->job = $this->getMock('OC\Migration\BackgroundRepair', ['loadApp']);
$this->job = $this->getMockBuilder(BackgroundRepair::class)
->setMethods(['loadApp'])
->getMock();
}
public function testNoArguments() {
@ -105,7 +107,7 @@ class BackgroundRepairTest extends TestCase {
public function testWorkingStep() {
/** @var EventDispatcher | \PHPUnit_Framework_MockObject_MockObject $dispatcher */
$dispatcher = $this->getMock('Symfony\Component\EventDispatcher\EventDispatcher', []);
$dispatcher = $this->createMock(EventDispatcher::class);
$dispatcher->expects($this->once())->method('dispatch')
->with('\OC\Repair::step', new GenericEvent('\OC\Repair::step', ['A test repair step']));