Skip to content
This repository has been archived by the owner on Feb 4, 2019. It is now read-only.

Commit

Permalink
Merge pull request #161 from spryker/feature/update-php-unit
Browse files Browse the repository at this point in the history
replaced getMock with getMockBuilder
  • Loading branch information
stereomon authored Nov 9, 2016
2 parents 6eb553e + 16868f2 commit ee5a4ed
Show file tree
Hide file tree
Showing 9 changed files with 21 additions and 17 deletions.
4 changes: 2 additions & 2 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public function testMediaUrlWithTrailingSlashes()
*/
private function getCacheBusterMock()
{
$mock = $this->getMock(CacheBusterInterface::class);
$mock = $this->getMockBuilder(CacheBusterInterface::class)->getMock();
$mock->expects($this->any())
->method('addCacheBust')
->will($this->returnArgument(0));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,11 @@ protected function createAddressStep($customerClientMock = null)
$customerClientMock = $this->createCustomerClientMock();
}

$addressStepMock = $this->getMock(AddressStep::class, ['getDataClass'], [$customerClientMock, 'address_step', 'escape_route']);
$addressStepMock = $this->getMockBuilder(AddressStep::class)
->setMethods(['getDataClass'])
->setConstructorArgs([$customerClientMock, 'address_step', 'escape_route'])
->getMock();

$addressStepMock->method('getDataClass')->willReturn(new QuoteTransfer());

return $addressStepMock;
Expand All @@ -203,7 +207,7 @@ protected function createRequest()
*/
protected function createCustomerClientMock()
{
return $this->getMock(CustomerClientInterface::class);
return $this->getMockBuilder(CustomerClientInterface::class)->getMock();
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ protected function createCustomerStep($customerClientMock = null, $authHandlerMo
*/
protected function createAuthHandlerMock()
{
return $this->getMock(StepHandlerPluginInterface::class);
return $this->getMockBuilder(StepHandlerPluginInterface::class)->getMock();
}

/**
Expand All @@ -155,7 +155,7 @@ protected function createRequest()
*/
protected function createCustomerClientMock()
{
return $this->getMock(CustomerClientInterface::class);
return $this->getMockBuilder(CustomerClientInterface::class)->getMock();
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -99,15 +99,15 @@ protected function createRequest()
*/
protected function createPaymentPluginMock()
{
return $this->getMock(StepHandlerPluginInterface::class);
return $this->getMockBuilder(StepHandlerPluginInterface::class)->getMock();
}

/**
* @return \PHPUnit_Framework_MockObject_MockObject|\Spryker\Yves\Messenger\FlashMessenger\FlashMessengerInterface
*/
protected function getFlashMessengerMock()
{
return $this->getMock(FlashMessengerInterface::class);
return $this->getMockBuilder(FlashMessengerInterface::class)->getMock();
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -152,23 +152,23 @@ protected function createRequest()
*/
protected function createFlashMessengerMock()
{
return $this->getMock(FlashMessengerInterface::class);
return $this->getMockBuilder(FlashMessengerInterface::class)->getMock();
}

/**
* @return \PHPUnit_Framework_MockObject_MockObject|\Spryker\Client\Checkout\CheckoutClientInterface
*/
protected function createCheckoutClientMock()
{
return $this->getMock(CheckoutClientInterface::class);
return $this->getMockBuilder(CheckoutClientInterface::class)->getMock();
}

/**
* @return \PHPUnit_Framework_MockObject_MockObject|\Spryker\Yves\StepEngine\Dependency\Plugin\Handler\StepHandlerPluginInterface
*/
protected function createShipmentMock()
{
return $this->getMock(StepHandlerPluginInterface::class);
return $this->getMockBuilder(StepHandlerPluginInterface::class)->getMock();
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ protected function createRequest()
*/
protected function createCalculationClientMock()
{
$calculationMock = $this->getMock(CalculationClientInterface::class);
$calculationMock = $this->getMockBuilder(CalculationClientInterface::class)->getMock();
$calculationMock->method('recalculate')->willReturnArgument(0);

return $calculationMock;
Expand All @@ -113,7 +113,7 @@ protected function createCalculationClientMock()
*/
protected function createShipmentMock()
{
return $this->getMock(StepHandlerPluginInterface::class);
return $this->getMockBuilder(StepHandlerPluginInterface::class)->getMock();
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ protected function createRequest()
*/
protected function createCustomerClientMock()
{
return $this->getMock(CustomerClientInterface::class);
return $this->getMockBuilder(CustomerClientInterface::class)->getMock();
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -97,15 +97,15 @@ protected function createRequest()
*/
protected function createCalculationClientMock()
{
return $this->getMock(CalculationClientInterface::class);
return $this->getMockBuilder(CalculationClientInterface::class)->getMock();
}

/**
* @return \PHPUnit_Framework_MockObject_MockObject|\Spryker\Yves\StepEngine\Dependency\Plugin\Handler\StepHandlerPluginInterface
*/
protected function createShipmentMock()
{
return $this->getMock(StepHandlerPluginInterface::class);
return $this->getMockBuilder(StepHandlerPluginInterface::class)->getMock();
}

}

0 comments on commit ee5a4ed

Please sign in to comment.