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:
japatel
2014-12-12 16:32:16 -06:00
parent 4c52592709
commit d6575b49ae
18 changed files with 757 additions and 84 deletions

View File

@@ -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);
}