From 0c213eac0e25fff312bd886b11e2acfbd41e5d77 Mon Sep 17 00:00:00 2001 From: Alex Lushpai Date: Thu, 14 Apr 2016 22:22:18 +0300 Subject: [PATCH 1/7] travis --- .travis.yml | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..a4dbf87 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,6 @@ +language: php +php: + - '5.4' + - '5.5' + - '5.6' +script: phpunit From 338452a16991df787773359d38fe25078383fd8c Mon Sep 17 00:00:00 2001 From: Alex Lushpai Date: Thu, 14 Apr 2016 22:28:55 +0300 Subject: [PATCH 2/7] travis update --- .travis.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.travis.yml b/.travis.yml index a4dbf87..a03cbba 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,16 @@ language: php + +cache: + directories: + - $HOME/.composer/cache + php: - '5.4' - '5.5' - '5.6' + +before_script: + - flags="--prefer-dist" + - composer install $flags + script: phpunit From 494a4d34329eb452b0954e9de85f1cdeb800bed1 Mon Sep 17 00:00:00 2001 From: Alex Lushpai Date: Thu, 14 Apr 2016 22:40:33 +0300 Subject: [PATCH 3/7] travis update --- .travis.yml | 1 + composer.json | 6 +++--- phpunit.xml.dist | 12 ++++++------ 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/.travis.yml b/.travis.yml index a03cbba..84d01ac 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,6 +5,7 @@ cache: - $HOME/.composer/cache php: + - '5.3' - '5.4' - '5.5' - '5.6' diff --git a/composer.json b/composer.json index 9bf2ea4..21506ea 100644 --- a/composer.json +++ b/composer.json @@ -16,10 +16,10 @@ "ext-curl": "*" }, "require-dev": { - "phpunit/phpunit": "5.2.*", - "phpunit/php-code-coverage": "3.3.0", + "phpunit/phpunit": "4.8.0", + "phpunit/php-code-coverage": "3.0.0", "phpunit/php-invoker": "1.1.4", - "phpmd/phpmd": "2.4.*", + "phpmd/phpmd": "2.3.0", "sebastian/phpcpd": "2.0.*", "sebastian/phpdcd": "1.0.*", "squizlabs/php_codesniffer": "2.5.*", diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 6097b7b..d203a3b 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -10,12 +10,12 @@ - - - - - - + + + + + + From 4ccf30d58823e45e3bcc857e5b6ce4b0fa30da58 Mon Sep 17 00:00:00 2001 From: Alex Lushpai Date: Thu, 14 Apr 2016 22:44:50 +0300 Subject: [PATCH 4/7] travis update --- composer.json | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/composer.json b/composer.json index 21506ea..6eeeffa 100644 --- a/composer.json +++ b/composer.json @@ -17,13 +17,11 @@ }, "require-dev": { "phpunit/phpunit": "4.8.0", - "phpunit/php-code-coverage": "3.0.0", - "phpunit/php-invoker": "1.1.4", "phpmd/phpmd": "2.3.0", "sebastian/phpcpd": "2.0.*", "sebastian/phpdcd": "1.0.*", "squizlabs/php_codesniffer": "2.5.*", - "apigen/apigen": "4.1.*" + "apigen/apigen": "2.8.1" }, "support": { "email": "support@retailcrm.pro" From 546010b337489042348d2b705d6a373a2d7b09b9 Mon Sep 17 00:00:00 2001 From: Alex Lushpai Date: Thu, 14 Apr 2016 22:53:59 +0300 Subject: [PATCH 5/7] travis update --- .travis.yml | 2 +- composer.json | 8 +++++--- phpunit.xml.dist | 2 +- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index 84d01ac..4d6ff60 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,7 +11,7 @@ php: - '5.6' before_script: - - flags="--prefer-dist" + - flags="--prefer-dist --no-dev" - composer install $flags script: phpunit diff --git a/composer.json b/composer.json index 6eeeffa..9bf2ea4 100644 --- a/composer.json +++ b/composer.json @@ -16,12 +16,14 @@ "ext-curl": "*" }, "require-dev": { - "phpunit/phpunit": "4.8.0", - "phpmd/phpmd": "2.3.0", + "phpunit/phpunit": "5.2.*", + "phpunit/php-code-coverage": "3.3.0", + "phpunit/php-invoker": "1.1.4", + "phpmd/phpmd": "2.4.*", "sebastian/phpcpd": "2.0.*", "sebastian/phpdcd": "1.0.*", "squizlabs/php_codesniffer": "2.5.*", - "apigen/apigen": "2.8.1" + "apigen/apigen": "4.1.*" }, "support": { "email": "support@retailcrm.pro" diff --git a/phpunit.xml.dist b/phpunit.xml.dist index d203a3b..a8b949e 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -14,7 +14,7 @@ - + From d26f609e9fac29d3d639d70e5a7b025f7e2e37c2 Mon Sep 17 00:00:00 2001 From: Alex Lushpai Date: Thu, 14 Apr 2016 23:11:51 +0300 Subject: [PATCH 6/7] travis update, packs test update --- phpunit.xml.dist | 2 +- tests/RetailCrm/Tests/ApiClientPacksTest.php | 69 ++++++++++++++++++-- 2 files changed, 63 insertions(+), 8 deletions(-) diff --git a/phpunit.xml.dist b/phpunit.xml.dist index a8b949e..e4bb52c 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -6,7 +6,7 @@ colors="true" verbose="true" processIsolation="false" - stopOnFailure="true"> + stopOnFailure="false"> diff --git a/tests/RetailCrm/Tests/ApiClientPacksTest.php b/tests/RetailCrm/Tests/ApiClientPacksTest.php index cc51764..ac13585 100644 --- a/tests/RetailCrm/Tests/ApiClientPacksTest.php +++ b/tests/RetailCrm/Tests/ApiClientPacksTest.php @@ -1,13 +1,52 @@ + * @license https://opensource.org/licenses/MIT MIT License + * @link http://www.retailcrm.ru/docs/Developers/ApiVersion3 + */ + namespace RetailCrm\Tests; use RetailCrm\Test\TestCase; +/** + * Class ApiClientPacksTest + * + * @category RetailCrm + * @package RetailCrm + * @author RetailCrm + * @license https://opensource.org/licenses/MIT MIT License + * @link http://www.retailcrm.ru/docs/Developers/ApiVersion3 + */ class ApiClientPacksTest extends TestCase { + private $_packId; + /** - * @group integration + * ApiClientPacksTest constructor. + * + * @param null|string $name name + * @param array $data data + * @param string $dataName dataName + */ + public function __construct($name = null, array $data = array(), $dataName = '') + { + parent::__construct($name, $data, $dataName); + $this->_packId = __DIR__ . '/../../../pack.tmp'; + } + + /** + * Test packs history + * + * @group integration + * @return void */ public function testOrdersPacksHistory() { @@ -28,7 +67,10 @@ class ApiClientPacksTest extends TestCase } /** - * @group integration + * Test packs create + * + * @group integration + * @return void */ public function testOrdersPacksCreate() { @@ -40,13 +82,17 @@ class ApiClientPacksTest extends TestCase ); $response = $client->ordersPacksCreate($pack); + file_put_contents($this->_packId, $response["id"]); $this->assertInstanceOf('RetailCrm\Response\ApiResponse', $response); $this->assertEquals(201, $response->getStatusCode()); $this->assertTrue($response->success); } /** - * @group integration + * Test packs failed create + * + * @group integration + * @return void */ public function testOrdersPacksCreateFailed() { @@ -64,28 +110,37 @@ class ApiClientPacksTest extends TestCase } /** - * @group integration + * Test packs get + * + * @group integration + * @return void */ public function testOrdersPacksGet() { $client = static::getApiClient(); - $response = $client->ordersPacksGet(1); + $packId = file_get_contents($this->_packId); + $response = $client->ordersPacksGet($packId); $this->assertInstanceOf('RetailCrm\Response\ApiResponse', $response); $this->assertEquals(200, $response->getStatusCode()); $this->assertTrue($response->success); } /** - * @group integration + * Test packs delete + * + * @group integration + * @return void */ public function testOrdersPacksDelete() { $client = static::getApiClient(); - $response = $client->ordersPacksDelete(1); + $packId = file_get_contents($this->_packId); + $response = $client->ordersPacksDelete($packId); $this->assertInstanceOf('RetailCrm\Response\ApiResponse', $response); $this->assertEquals(200, $response->getStatusCode()); $this->assertTrue($response->success); + unlink($this->_packId); } } From 5cd752796d32fc3f06022af213600a8c3d978cf3 Mon Sep 17 00:00:00 2001 From: Alex Lushpai Date: Fri, 22 Jul 2016 01:32:00 +0300 Subject: [PATCH 7/7] remove dev packages from vendor --- composer.json | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/composer.json b/composer.json index 9bf2ea4..f7ef549 100644 --- a/composer.json +++ b/composer.json @@ -15,16 +15,6 @@ "php": ">=5.3.0", "ext-curl": "*" }, - "require-dev": { - "phpunit/phpunit": "5.2.*", - "phpunit/php-code-coverage": "3.3.0", - "phpunit/php-invoker": "1.1.4", - "phpmd/phpmd": "2.4.*", - "sebastian/phpcpd": "2.0.*", - "sebastian/phpdcd": "1.0.*", - "squizlabs/php_codesniffer": "2.5.*", - "apigen/apigen": "4.1.*" - }, "support": { "email": "support@retailcrm.pro" },