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