update tests
This commit is contained in:
parent
ffaa661384
commit
ddf46fd73d
@ -75,6 +75,7 @@ class ApiClientPacksTest extends TestCase
|
||||
public function testOrdersPacksCreate()
|
||||
{
|
||||
$client = static::getApiClient();
|
||||
|
||||
$pack = array(
|
||||
'itemId' => $_SERVER['CRM_PACK_ITEM'],
|
||||
'quantity' => $_SERVER['CRM_PACK_QUANTITY'],
|
||||
|
@ -10,6 +10,22 @@ use RetailCrm\Test\TestCase;
|
||||
*/
|
||||
class ApiClientStoreTest extends TestCase
|
||||
{
|
||||
const SNAME = 'Test Store';
|
||||
const SCODE = 'test-store';
|
||||
|
||||
/**
|
||||
* @group integration
|
||||
*/
|
||||
public function testStoreCreate()
|
||||
{
|
||||
$client = static::getApiClient();
|
||||
|
||||
$response = $client->storesEdit(array('name' => self::SNAME, 'code' => self::SCODE));
|
||||
$this->assertInstanceOf('RetailCrm\Response\ApiResponse', $response);
|
||||
$this->assertTrue(in_array($response->getStatusCode(), array(200, 201)));
|
||||
$this->assertTrue($response->success);
|
||||
}
|
||||
|
||||
/**
|
||||
* @group integration
|
||||
*/
|
||||
@ -52,7 +68,7 @@ class ApiClientStoreTest extends TestCase
|
||||
'externalId' => $externalIdA,
|
||||
'stores' => array(
|
||||
array(
|
||||
'code' => $_SERVER['CRM_STORE'],
|
||||
'code' => self::SCODE,
|
||||
'available' => 10,
|
||||
'purchasePrice' => 1700
|
||||
)
|
||||
@ -62,17 +78,18 @@ class ApiClientStoreTest extends TestCase
|
||||
'externalId' => $externalIdB,
|
||||
'stores' => array(
|
||||
array(
|
||||
'code' => $_SERVER['CRM_STORE'],
|
||||
'code' => self::SCODE,
|
||||
'available' => 20,
|
||||
'purchasePrice' => 1500
|
||||
)
|
||||
)
|
||||
),
|
||||
));
|
||||
|
||||
$this->assertInstanceOf('RetailCrm\Response\ApiResponse', $response);
|
||||
$this->assertTrue($response->isSuccessful());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @group integration
|
||||
*/
|
||||
|
@ -15,15 +15,4 @@ class ApiClientTest extends TestCase
|
||||
|
||||
$this->assertInstanceOf('RetailCrm\ApiClient', $client);
|
||||
}
|
||||
|
||||
/**
|
||||
* @group integration
|
||||
*/
|
||||
public function testStatisticUpdate()
|
||||
{
|
||||
$client = static::getApiClient();
|
||||
|
||||
$response = $client->statisticUpdate();
|
||||
$this->assertTrue($response->isSuccessful());
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user