forked from LiveCarta/PayPal-PHP-SDK
Functional Tests Improvements and Refactoring
- Updated Functional Tests to refactor common code in one file - Re-sets the credentials to make sure previous tests doesnt change it for testing
This commit is contained in:
@@ -7,6 +7,7 @@ use PayPal\Api\Notification;
|
||||
use PayPal\Api\PaymentDetail;
|
||||
use PayPal\Api\RefundDetail;
|
||||
use PayPal\Api\Search;
|
||||
use PayPal\Test\Functional\Setup;
|
||||
|
||||
/**
|
||||
* Class Invoice
|
||||
@@ -22,8 +23,6 @@ class InvoiceFunctionalTest extends \PHPUnit_Framework_TestCase
|
||||
|
||||
public $response;
|
||||
|
||||
public $mode = 'mock';
|
||||
|
||||
public $mockPPRestCall;
|
||||
|
||||
public function setUp()
|
||||
@@ -42,20 +41,7 @@ class InvoiceFunctionalTest extends \PHPUnit_Framework_TestCase
|
||||
$this->response = json_encode($this->operation['response']['body']);
|
||||
}
|
||||
|
||||
$this->mode = getenv('REST_MODE') ? getenv('REST_MODE') : 'mock';
|
||||
if ($this->mode != 'sandbox') {
|
||||
|
||||
// Mock PPRest Caller if mode set to mock
|
||||
$this->mockPPRestCall = $this->getMockBuilder('\PayPal\Transport\PPRestCall')
|
||||
->disableOriginalConstructor()
|
||||
->getMock();
|
||||
|
||||
$this->mockPPRestCall->expects($this->any())
|
||||
->method('execute')
|
||||
->will($this->returnValue(
|
||||
$this->response
|
||||
));
|
||||
}
|
||||
Setup::SetUpForFunctionalTests($this);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user