1
0
mirror of synced 2024-11-21 21:06:07 +03:00

update tests

This commit is contained in:
gwinn 2016-07-21 16:37:41 +03:00
parent ffaa661384
commit ddf46fd73d
3 changed files with 21 additions and 14 deletions

View File

@ -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'],

View File

@ -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
*/

View File

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