Skip to content

Commit

Permalink
Replace string class names with class constant
Browse files Browse the repository at this point in the history
  • Loading branch information
pierredup committed Nov 6, 2023
1 parent 0b75cd6 commit cfb28d5
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
8 changes: 4 additions & 4 deletions Tests/Action/CaptureActionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public function testThrowIfCreditCardNotSetExplicitlyAndObtainRequestNotSupporte
$gatewayMock
->expects($this->once())
->method('execute')
->with($this->isInstanceOf('Payum\Core\Request\ObtainCreditCard'))
->with($this->isInstanceOf(\Payum\Core\Request\ObtainCreditCard::class))
->willThrowException(new RequestNotSupportedException())
;

Expand Down Expand Up @@ -155,7 +155,7 @@ public function testShouldCaptureWithObtainedCreditCard()
$gatewayMock
->expects($this->once())
->method('execute')
->with($this->isInstanceOf('Payum\Core\Request\ObtainCreditCard'))
->with($this->isInstanceOf(\Payum\Core\Request\ObtainCreditCard::class))
->willReturnCallback(function (ObtainCreditCard $request) {
$card = new CreditCard();
$card->setNumber('1234567812345678');
Expand Down Expand Up @@ -211,7 +211,7 @@ public function testShouldCaptureWithObtainedCreditCardWhenTokenReturned()
$gatewayMock
->expects($this->once())
->method('execute')
->with($this->isInstanceOf('Payum\Core\Request\ObtainCreditCard'))
->with($this->isInstanceOf(\Payum\Core\Request\ObtainCreditCard::class))
->willReturnCallback(function (ObtainCreditCard $request) {
$card = new CreditCard();
$card->setToken('theCreditCardToken');
Expand Down Expand Up @@ -280,7 +280,7 @@ public function testShouldPassFirstAndCurrentModelsWithObtainCreditCardSubReques
$gatewayMock
->expects($this->once())
->method('execute')
->with($this->isInstanceOf('Payum\Core\Request\ObtainCreditCard'))
->with($this->isInstanceOf(\Payum\Core\Request\ObtainCreditCard::class))
->willReturnCallback(function (ObtainCreditCard $request) use ($firstModel, $currentModel) {
$this->assertSame($firstModel, $request->getFirstModel());
$this->assertSame($currentModel, $request->getModel());
Expand Down
4 changes: 2 additions & 2 deletions Tests/Action/CaptureOffsiteActionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public function testShouldRedirectToBe2billSiteIfExecCodeNotPresentInQuery()
$gatewayMock
->expects($this->once())
->method('execute')
->with($this->isInstanceOf('Payum\Core\Request\GetHttpRequest'))
->with($this->isInstanceOf(\Payum\Core\Request\GetHttpRequest::class))
;

$action = new CaptureOffsiteAction();
Expand Down Expand Up @@ -105,7 +105,7 @@ public function testShouldUpdateModelWhenComeBackFromBe2billSite()
$gatewayMock
->expects($this->once())
->method('execute')
->with($this->isInstanceOf('Payum\Core\Request\GetHttpRequest'))
->with($this->isInstanceOf(\Payum\Core\Request\GetHttpRequest::class))
->willReturnCallback(function (GetHttpRequest $request) {
$request->query['EXECCODE'] = 1;
$request->query['FOO'] = 'fooVal';
Expand Down
4 changes: 2 additions & 2 deletions Tests/Action/ConvertPaymentActionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@ public function provideSupportedRequests(): \Iterator
{
yield [new $this->requestClass(new Payment(), 'array')];
yield [new $this->requestClass($this->createMock(PaymentInterface::class), 'array')];
yield [new $this->requestClass(new Payment(), 'array', $this->createMock('Payum\Core\Security\TokenInterface'))];
yield [new $this->requestClass(new Payment(), 'array', $this->createMock(\Payum\Core\Security\TokenInterface::class))];
}

public function provideNotSupportedRequests(): \Iterator
{
yield ['foo'];
yield [['foo']];
yield [new \stdClass()];
yield [$this->getMockForAbstractClass('Payum\Core\Request\Generic', [[]])];
yield [$this->getMockForAbstractClass(\Payum\Core\Request\Generic::class, [[]])];
yield [new $this->requestClass(new \stdClass(), 'array')];
yield [new $this->requestClass(new Payment(), 'foobar')];
yield [new $this->requestClass($this->createMock(PaymentInterface::class), 'foobar')];
Expand Down
2 changes: 1 addition & 1 deletion Tests/ApiTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ public function testShouldReturnTrueIfHashesMatched()
*/
protected function createHttpClientMock()
{
return $this->createMock('Payum\Core\HttpClientInterface');
return $this->createMock(\Payum\Core\HttpClientInterface::class);
}

/**
Expand Down

0 comments on commit cfb28d5

Please sign in to comment.