Skip to content
This repository was archived by the owner on Oct 24, 2023. It is now read-only.

Commit 72dba67

Browse files
author
Jens Schulze
authored
Merge pull request #298 from commercetools/version2
Version 2
2 parents f39b680 + 8adf64a commit 72dba67

File tree

759 files changed

+3775
-4005
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

759 files changed

+3775
-4005
lines changed

.travis.yml

Lines changed: 17 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,43 @@
1+
dist: trusty
2+
sudo: false
13
language: php
24
php:
35
- 7.0
46
- 5.6
5-
- 5.5
6-
- 5.4
77
- 7.1
88
- hhvm
99
- nightly
10+
env:
11+
- GUZZLE=5
12+
- GUZZLE=6
1013
matrix:
1114
allow_failures:
12-
- php: 7.1
1315
- php: hhvm
1416
- php: nightly
1517
services:
1618
- redis-server
1719
cache:
1820
directories:
1921
- vendor
20-
before_script:
22+
before_install:
2123
- PHP=$TRAVIS_PHP_VERSION
24+
- if [ $PHP != 'hhvm' ] ; then echo "extension = redis.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini ; fi
25+
- if [ $PHP != 'hhvm' ] && [ `php-config --vernum` -lt 70000 ]; then printf "yes\n" | pecl install -f apcu-4.0.10 ; fi
26+
- if [ $PHP != 'hhvm' ] && [ `php-config --vernum` -ge 70000 ] ; then printf "yes\n" | pecl install -f apcu ; fi
27+
- if [ $PHP != 'hhvm' ] ; then phpenv config-add ./tests/apc.ini; fi
28+
before_script:
2229
- composer config -g github-oauth.github.com $GITHUB_OAUTH_TOKEN
23-
- sh -c "if [ $PHP != 'hhvm' ] && [ `php-config --vernum` -lt 70000 ] ; then echo
24-
'extension = redis.so' >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
25-
; fi"
26-
- sh -c "if [ $PHP != 'hhvm' ] && [ `php-config --vernum` -ge 50400 ] && [ `php-config
27-
--vernum` -lt 70000 ]; then printf "yes\n" | pecl install -f apcu-4.0.10 ; fi"
28-
- sh -c "if [ $PHP != 'hhvm' ] && [ `php-config --vernum` -ge 70000 ] ; then printf
29-
"yes\n" | pecl install -f apcu-5.1.7 ; fi"
30-
- sh -c "if [ $PHP != 'hhvm' ] ; then phpenv config-add ./tests/apc.ini; fi"
31-
- if [ $PHP == '5.4' ] ; then ./set_guzzle5.sh; fi
32-
- if [ $PHP != 'nightly' ] && [ $PHP != '7.1' ]; then composer global require hirak/prestissimo;
33-
fi
34-
- if [ $PHP == '5.4' ] ; then composer update -o --prefer-dist --prefer-lowest; fi
35-
- if [ $PHP != '5.4' ] ; then composer install -o --prefer-dist; fi
30+
- if [ $GUZZLE == '5' ] ; then ./set_guzzle5.sh; fi
31+
- if [ $PHP != 'nightly' ] && [ $PHP != '7.1' ]; then composer global require hirak/prestissimo; fi
32+
- if [ $GUZZLE == '5' ] ; then composer update -o --prefer-dist --prefer-lowest; fi
33+
- if [ $GUZZLE != '5' ] ; then composer install -o --prefer-dist; fi
3634
script:
3735
- ant phpcs-ci
3836
- vendor/bin/phpunit --testsuite=unit
39-
- if [ $PHP == '7.0' ] ; then vendor/bin/phpunit --testsuite=integration; fi
37+
- if [ $PHP == '7.0' ] && [ $GUZZLE == '6' ] ; then vendor/bin/phpunit --testsuite=integration; fi
4038
- ant behat
4139
after_success:
42-
- ./push-docs-to-gh-pages.sh
40+
- if [ $PHP == '5.6' ] && [ $GUZZLE == '6' ] ; then ./push-docs-to-gh-pages.sh; fi
4341
notifications:
4442
hipchat:
4543
rooms:

composer.json

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,41 +21,52 @@
2121
"Commercetools\\Core\\": [
2222
"tests/unit/",
2323
"tests/integration/"
24+
],
25+
"Commercetools\\Core\\Fixtures\\": [
26+
"tests/fixtures/"
2427
]
2528
}
2629
},
2730
"require": {
28-
"php": ">=5.4",
31+
"php": ">=5.6",
2932
"psr/log": "^1.0",
30-
"guzzlehttp/guzzle": "^5.0 || ^6.0",
33+
"guzzlehttp/guzzle": "^6.0 || ^5.0",
3134
"guzzlehttp/psr7": "^1.1",
32-
"pimple/pimple": "^3.0",
3335
"psr/cache": "^1.0",
36+
"psr/simple-cache": "^1.0",
37+
"cache/apcu-adapter": "^0.2",
3438
"ext-intl": "*",
3539
"ext-mbstring": "*"
3640
},
3741
"require-dev": {
3842
"guzzlehttp/guzzle": "^6.0",
39-
"phpunit/phpunit": "^5.0 || ^4.8",
43+
"phpunit/phpunit": "^6.0 || ^5.7.14",
4044
"phpmd/phpmd": "@stable",
4145
"squizlabs/php_codesniffer": "^2.6",
4246
"sebastian/phpcpd": "@stable",
4347
"pdepend/pdepend": "@stable",
4448
"phploc/phploc": "^2.0",
4549
"mayflower/php-codebrowser": "^1.0",
46-
"doctrine/cache": "^1.5",
50+
"doctrine/cache": "^1.6",
4751
"monolog/monolog": "^1.12",
4852
"behat/behat": "^3.0",
4953
"phpunit/phpcov": "*",
5054
"friendsofphp/php-cs-fixer": "@stable",
51-
"symfony/yaml": "*",
55+
"symfony/yaml": "^3.0",
5256
"cache/array-adapter": "^0.4.0",
57+
"cache/doctrine-adapter": "^0.5.0",
58+
"cache/redis-adapter": "^0.4.0",
5359
"cache/filesystem-adapter": "^0.3.0",
60+
"cache/void-adapter": "^0.3",
5461
"incenteev/composer-parameter-handler": "^2.1"
5562
},
5663
"replaces": {
5764
"commercetools/commons": "*"
5865
},
66+
"suggest": {
67+
"cache/redis-adapter": "For usage of a redis server to store the client access token",
68+
"cache/doctrine-adapter": "For usage of a doctrine cache instance to store the client access token"
69+
},
5970
"scripts": {
6071
"updateConfig": [
6172
"Incenteev\\ParameterHandler\\ScriptHandler::buildParameters"
@@ -65,7 +76,8 @@
6576
},
6677
"extra": {
6778
"branch-alias": {
68-
"dev-develop": "1.7-dev"
79+
"dev-develop": "1.7-dev",
80+
"dev-version2": "2.0-dev"
6981
},
7082
"incenteev-parameters": [
7183
{

features/bootstrap/ApiContext.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
use Commercetools\Core\Model\Common\Collection;
1212
use Commercetools\Core\Model\Common\JsonObject;
1313
use Commercetools\Core\Model\Product\Search\Filter;
14+
use Commercetools\Core\Request\Products\ProductProjectionSearchRequest;
1415

1516
trait ApiContext
1617
{
@@ -278,7 +279,7 @@ public function iWantToQuery($context)
278279
*/
279280
public function iWantToSearchProducts()
280281
{
281-
$request = '\Commercetools\Core\Request\\Products\\ProductProjectionSearchRequest';
282+
$request = ProductProjectionSearchRequest::class;
282283
$this->request = call_user_func($request. '::of');
283284
}
284285

features/request/Customer/CustomerUpdate.feature

Lines changed: 5 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,11 @@ Feature: I want to send a Customer Update Request
33
Scenario: Change user name and email
44
Given a "customer" is identified by "id" and version "1"
55
And i want to update a "customer"
6-
And add the "changeName" action to "customer" with values
6+
And add the "setFirstName" action to "customer" with values
77
"""
88
{
9-
"action": "changeName",
10-
"firstName": "John",
11-
"lastName": "Doe"
9+
"action": "setFirstName",
10+
"firstName": "John"
1211
}
1312
"""
1413
And add the "changeEmail" action to "customer" with values
@@ -26,9 +25,8 @@ Feature: I want to send a Customer Update Request
2625
"version": 1,
2726
"actions": [
2827
{
29-
"action": "changeName",
30-
"firstName": "John",
31-
"lastName": "Doe"
28+
"action": "setFirstName",
29+
"firstName": "John"
3230
},
3331
{
3432
"action": "changeEmail",
@@ -38,33 +36,6 @@ Feature: I want to send a Customer Update Request
3836
}
3937
"""
4038

41-
Scenario: Change user name
42-
Given a "customer" is identified by "id" and version "1"
43-
And i want to update a "customer"
44-
And add the "changeName" action to "customer" with values
45-
"""
46-
{
47-
"action": "changeName",
48-
"firstName": "John",
49-
"lastName": "Doe"
50-
}
51-
"""
52-
Then the path should be "customers/id"
53-
And the method should be "POST"
54-
And the request should be
55-
"""
56-
{
57-
"version": 1,
58-
"actions": [
59-
{
60-
"action": "changeName",
61-
"firstName": "John",
62-
"lastName": "Doe"
63-
}
64-
]
65-
}
66-
"""
67-
6839
Scenario: Change email address
6940
Given a "customer" is identified by "id" and version "1"
7041
And i want to update a "customer"

features/request/Product/ProductSearch.feature

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Feature: I want to search products
88
And the method should be "POST"
99
And the body should be
1010
"""
11-
filter=name%3A%22Peter%22&limit=1
11+
filter=name%3A%22Peter%22&limit=1&markMatchingVariants=false
1212
"""
1313

1414
Scenario: Search products with limit
@@ -18,7 +18,7 @@ Feature: I want to search products
1818
And the method should be "POST"
1919
And the body should be
2020
"""
21-
limit=10
21+
limit=10&markMatchingVariants=false
2222
"""
2323

2424
Scenario: Search products with offset
@@ -28,7 +28,7 @@ Feature: I want to search products
2828
And the method should be "POST"
2929
And the body should be
3030
"""
31-
offset=10
31+
markMatchingVariants=false&offset=10
3232
"""
3333

3434
Scenario: Search products sorted
@@ -38,7 +38,7 @@ Feature: I want to search products
3838
And the method should be "POST"
3939
And the body should be
4040
"""
41-
sort=name
41+
markMatchingVariants=false&sort=name
4242
"""
4343

4444
Scenario: Search parameters should be sorted
@@ -49,5 +49,5 @@ Feature: I want to search products
4949
And the method should be "POST"
5050
And the body should be
5151
"""
52-
offset=10&sort=name
52+
markMatchingVariants=false&offset=10&sort=name
5353
"""

features/request/Product/ProductUpdate.feature

Lines changed: 0 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -179,47 +179,6 @@ Feature: I want to send a Product Update Request
179179
}
180180
"""
181181

182-
Scenario:
183-
Given a "product" is identified by "id" and version 1
184-
And i want to update a "product"
185-
And add the "setMetaAttributes" action to "product" with values
186-
"""
187-
{
188-
"action": "setMetaAttributes",
189-
"metaTitle": {
190-
"en": "metaTitle"
191-
},
192-
"metaDescription": {
193-
"en": "metaDescription"
194-
},
195-
"metaKeywords": {
196-
"en": "metaKeywords"
197-
}
198-
}
199-
"""
200-
Then the path should be "products/id"
201-
And the method should be "POST"
202-
And the request should be
203-
"""
204-
{
205-
"version": 1,
206-
"actions": [
207-
{
208-
"action": "setMetaAttributes",
209-
"metaTitle": {
210-
"en": "metaTitle"
211-
},
212-
"metaDescription": {
213-
"en": "metaDescription"
214-
},
215-
"metaKeywords": {
216-
"en": "metaKeywords"
217-
}
218-
}
219-
]
220-
}
221-
"""
222-
223182
Scenario:
224183
Given a "product" is identified by "id" and version 1
225184
And i want to update a "product"
@@ -711,34 +670,6 @@ Feature: I want to send a Product Update Request
711670
}
712671
"""
713672

714-
715-
Scenario:
716-
Given a "product" is identified by "id" and version 1
717-
And i want to update a "product"
718-
And add the "setSkuNotStageable" action to "product" with values
719-
"""
720-
{
721-
"action": "setSKU",
722-
"variantId": 1,
723-
"sku": "mySKU"
724-
}
725-
"""
726-
Then the path should be "products/id"
727-
And the method should be "POST"
728-
And the request should be
729-
"""
730-
{
731-
"version": 1,
732-
"actions": [
733-
{
734-
"action": "setSKU",
735-
"variantId": 1,
736-
"sku": "mySKU"
737-
}
738-
]
739-
}
740-
"""
741-
742673
Scenario:
743674
Given a "product" is identified by "id" and version 1
744675
And i want to update a "product"

set_guzzle5.sh

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,4 @@
11
#!/bin/bash
22
SRC='"guzzlehttp/guzzle": "^6.0"'
3-
DST='"guzzlehttp/guzzle": "^5.0", "guzzlehttp/log-subscriber": "^1.0"'
4-
sed -ibak -e "s|$SRC|$DST|g" composer.json
5-
6-
SRC='"cache/array-adapter": "^0.4.0",'
7-
DST=''
8-
sed -ibak -e "s|$SRC|$DST|g" composer.json
9-
10-
SRC='"cache/filesystem-adapter": "^0.3.0",'
11-
DST=''
3+
DST='"guzzlehttp/guzzle": "^5.3.1", "guzzlehttp/log-subscriber": "^1.0", "guzzlehttp/ringphp": "^1.0.7", "react/promise": "^2.2.0"'
124
sed -ibak -e "s|$SRC|$DST|g" composer.json

src/AbstractHttpClient.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
*/
1515
abstract class AbstractHttpClient
1616
{
17-
const VERSION = '1.7.0-dev';
17+
const VERSION = '2.0.0-dev';
1818

1919
/**
2020
* @var AdapterInterface

src/Cache/AbstractCacheAdapter.php

Lines changed: 0 additions & 38 deletions
This file was deleted.

0 commit comments

Comments
 (0)