forked from LiveCarta/PayPal-PHP-SDK
Adding resetRequestId in ApiContext to enable multiple create calls in succession
This commit is contained in:
37
tests/PayPal/Test/Rest/ApiContextTest.php
Normal file
37
tests/PayPal/Test/Rest/ApiContextTest.php
Normal file
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
use PayPal\Rest\ApiContext;
|
||||
|
||||
/**
|
||||
* Test class for PPAPIService.
|
||||
*
|
||||
*/
|
||||
class ApiContextTest extends PHPUnit_Framework_TestCase
|
||||
{
|
||||
|
||||
/**
|
||||
* @var ApiContext
|
||||
*/
|
||||
public $apiContext;
|
||||
|
||||
public function setUp()
|
||||
{
|
||||
$this->apiContext = new ApiContext();
|
||||
}
|
||||
|
||||
public function testGetRequestId()
|
||||
{
|
||||
$requestId = $this->apiContext->getrequestId();
|
||||
$this->assertNotNull($requestId);
|
||||
$this->assertEquals($requestId, $this->apiContext->getrequestId());
|
||||
}
|
||||
|
||||
public function testResetRequestId()
|
||||
{
|
||||
$requestId = $this->apiContext->getrequestId();
|
||||
$newRequestId = $this->apiContext->resetRequestId();
|
||||
$this->assertNotNull($newRequestId);
|
||||
$this->assertNotEquals($newRequestId, $requestId);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user