Adding resetRequestId in ApiContext to enable multiple create calls in succession

This commit is contained in:
japatel
2014-11-12 09:26:16 -06:00
parent 3c564dee77
commit bbef3664c5
2 changed files with 57 additions and 6 deletions

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