Skip to content

Commit

Permalink
Fix PHPUnit deprecations in RefundTransactionActionTest
Browse files Browse the repository at this point in the history
  • Loading branch information
pierredup committed May 17, 2021
1 parent 50a1c88 commit 79d2c35
Showing 1 changed file with 8 additions and 14 deletions.
22 changes: 8 additions & 14 deletions Tests/Action/Api/RefundTransactionActionTest.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
<?php
namespace Payum\Paypal\ExpressCheckout\Nvp\Tests\Action\Api;

use Payum\Core\Exception\LogicException;
use Payum\Core\Exception\RequestNotSupportedException;
use Payum\Paypal\ExpressCheckout\Nvp\Action\Api\RefundTransactionAction;
use Payum\Paypal\ExpressCheckout\Nvp\Request\Api\RefundTransaction;
use PHPUnit\Framework\MockObject\MockObject;

class RefundTransactionActionTest extends \PHPUnit\Framework\TestCase
{
Expand Down Expand Up @@ -36,14 +39,6 @@ public function shouldUseApiAwareTrait()
$this->assertContains('Payum\Core\ApiAwareTrait', $rc->getTraitNames());
}

/**
* @test
*/
public function couldBeConstructedWithoutAnyArguments()
{
new RefundTransactionAction();
}

/**
* @test
*/
Expand All @@ -68,24 +63,23 @@ public function shouldNotSupportAnythingNotRefundTransactionRequest()

/**
* @test
*
* @expectedException \Payum\Core\Exception\RequestNotSupportedException
*/
public function throwIfNotSupportedRequestGivenAsArgumentForExecute()
{
$this->expectException(RequestNotSupportedException::class);
$action = new RefundTransactionAction();

$action->execute(new \stdClass());
}

/**
* @test
*
* @expectedException \Payum\Core\Exception\LogicException
* @expectedExceptionMessage The TRANSACTIONID fields are required.
*/
public function throwIfAuthorizationIdNotSetInModel()
{
$this->expectException(LogicException::class);
$this->expectExceptionMessage('The TRANSACTIONID fields are required.');

$action = new RefundTransactionAction();

$request = new RefundTransaction(array());
Expand Down Expand Up @@ -158,7 +152,7 @@ public function shouldCallApiRefundTransactionMethodAndUpdateModelFromResponseOn
}

/**
* @return \PHPUnit_Framework_MockObject_MockObject|\Payum\Paypal\ExpressCheckout\Nvp\Api
* @return MockObject|\Payum\Paypal\ExpressCheckout\Nvp\Api
*/
protected function createApiMock()
{
Expand Down

0 comments on commit 79d2c35

Please sign in to comment.