Merge remote-tracking branch 'upstream/master'
This commit is contained in:
commit
2ff427a949
6 changed files with 36 additions and 3 deletions
|
@ -15,7 +15,7 @@ Use [API documentation](http://retailcrm.github.io/api-client-php)
|
|||
|
||||
2) Run into your project directory:
|
||||
```bash
|
||||
composer require retailcrm/api-client-php ~4.0.0 --no-dev
|
||||
composer require retailcrm/api-client-php 4.* --no-dev
|
||||
```
|
||||
|
||||
If you have not used `composer` before, include autoloader into your project.
|
||||
|
|
|
@ -15,7 +15,7 @@ PHP-клиент для работы с [retailCRM API](http://www.retailcrm.ru/
|
|||
|
||||
2) Выполните в папке проекта:
|
||||
```bash
|
||||
composer require retailcrm/api-client-php ~4.0.0 --no-dev
|
||||
composer require retailcrm/api-client-php 4.* --no-dev
|
||||
```
|
||||
|
||||
В конфиг `composer.json` вашего проекта будет добавлена библиотека `retailcrm/api-client-php`, которая установится в папку `vendor/`. При отсутствии файла конфига или папки с вендорами они будут созданы.
|
||||
|
|
|
@ -16,6 +16,9 @@
|
|||
"ext-curl": "*",
|
||||
"phpunit/phpunit": "4.8.29"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit/phpunit": "4.8.29"
|
||||
},
|
||||
"support": {
|
||||
"email": "support@retailcrm.pro"
|
||||
},
|
||||
|
|
|
@ -121,6 +121,18 @@ class ApiResponse implements \ArrayAccess
|
|||
return $this->response[$name];
|
||||
}
|
||||
|
||||
/**
|
||||
* Allow to check if the property exists through object property
|
||||
*
|
||||
* @param string $name property name
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function __isset($name)
|
||||
{
|
||||
return isset($this->response[$name]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Offset set
|
||||
*
|
||||
|
|
|
@ -241,7 +241,7 @@ class ApiClientOrdersTest extends TestCase
|
|||
|
||||
/**
|
||||
* @group orders
|
||||
] */
|
||||
*/
|
||||
public function testOrdersFixExternalIds()
|
||||
{
|
||||
$client = static::getApiClient();
|
||||
|
|
|
@ -251,4 +251,22 @@ class ApiResponseTest extends TestCase
|
|||
$response = new ApiResponse(201, '{ "success": true }');
|
||||
unset($response['sssssssuccess']);
|
||||
}
|
||||
|
||||
/**
|
||||
* @group unit
|
||||
*/
|
||||
public function testMagicIsset()
|
||||
{
|
||||
$response = new ApiResponse(201, '{ "success": true }');
|
||||
|
||||
$this->assertTrue(
|
||||
isset($response->success),
|
||||
'Response object returns property existing'
|
||||
);
|
||||
|
||||
$this->assertFalse(
|
||||
isset($response->suess),
|
||||
'Response object returns property existing'
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue