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

Commit 257e1fc

Browse files
author
Jens Schulze
committed
Merge branch 'release/v2.0-RC1'
2 parents 6209527 + 92f3977 commit 257e1fc

File tree

761 files changed

+3847
-4006
lines changed

Some content is hidden

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

761 files changed

+3847
-4006
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:

CHANGELOG.md

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,75 @@
1+
<a name="2.0.0-RC1"></a>
2+
# [2.0.0-RC1](https://github.com/commercetools/commercetools-php-sdk/compare/v1.7.0...v2.0.0-RC1) (2017-03-13)
3+
4+
5+
### Bug Fixes
6+
7+
* **AssetDraft:** correct type for custom field object ([abc0afd](https://github.com/commercetools/commercetools-php-sdk/commit/abc0afd))
8+
* **Customer:** fix create email token request with TTL ([8367ef6](https://github.com/commercetools/commercetools-php-sdk/commit/8367ef6))
9+
10+
### Code Refactoring
11+
12+
* **OAuth:** change access scope of getCacheAdapter method ([c6b27ec](https://github.com/commercetools/commercetools-php-sdk/commit/c6b27ec))
13+
* **ProductSearch:** disable markMatchingVariants by default ([41711a8](https://github.com/commercetools/commercetools-php-sdk/commit/41711a8))
14+
15+
### Features
16+
17+
* **Cache:** support PSR-16 cache implementations ([c3ceac7](https://github.com/commercetools/commercetools-php-sdk/commit/c3ceac7)), closes [#297](https://github.com/commercetools/commercetools-php-sdk/issues/297)
18+
19+
20+
### BREAKING CHANGES
21+
22+
* AssetDraft: AssetDraft requires CustomFieldObjectDraft instead of CustomFieldObject
23+
24+
Before:
25+
26+
```
27+
$assetDraft = AssetDraft::of()->setCustom(CustomFieldObject::of());
28+
```
29+
30+
After:
31+
32+
```
33+
$assetDraft = AssetDraft::of()->setCustom(CustomFieldObjectDraft::of());
34+
```
35+
* OAuth: Manager::getCacheAdapter() method scope has been changed from public to protected
36+
* ProductSearch: markMatchingVariants has been disabled by default
37+
38+
For performance reasons the markMatchingVariants flag has been disabled by default. In order to use markMatchingVariants feature please enable it explicit.
39+
40+
Before:
41+
```
42+
$request = ProductProjectionSearchRequest::of();
43+
```
44+
45+
After:
46+
```
47+
$request = ProductProjectionSearchRequest::of()->markMatchingVariants(true);
48+
```
49+
50+
* PHP minimum version is now 5.6
51+
* Token caching is now using [PSR-6](https://packagist.org/providers/psr/cache-implementation) or [PSR-16](https://packagist.org/providers/psr/simple-cache-implementation) cache adapters only.
52+
Removed classes:
53+
- AbstractCacheAdapter
54+
- ApcCacheAdapter
55+
- ApcuCacheAdapter
56+
- CacheAdapterInterface
57+
- DoctrineCacheAdapter
58+
- NullCacheAdapter
59+
- PhpRedisCacheAdapter
60+
61+
Use an appropiate PSR-6 or PRS-16 cache adapter as a replacement. The SDK uses the [cache\apcu-adapter](https://packagist.org/packages/cache/apcu-adapter) as default or if available the [cache\filesystem-adapter](https://packagist.org/packages/cache/filesystem-adapter)
62+
* Deprecations have been removed
63+
- FileRequest
64+
- use FileUploadRequest
65+
- CustomerChangeNameAction
66+
- use CustomerSetFirstNameAction, CustomerSetLastNameAction, CustomerSetMiddleNameAction or CustomerSetTitleAction
67+
- ProductSetSkuNotStageableAction
68+
- use ProductSetSkuAction
69+
* Context doesn't extend Pimple\Container anymore
70+
* Pimple has been removed as a dependency
71+
72+
173
<a name="1.7.0"></a>
274
# [1.7.0](https://github.com/commercetools/commercetools-php-sdk/compare/v1.6.1...v1.7.0) (2017-03-02)
375

composer.json

Lines changed: 18 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,7 @@
6576
},
6677
"extra": {
6778
"branch-alias": {
68-
"dev-develop": "1.7-dev"
79+
"dev-develop": "2.0-dev"
6980
},
7081
"incenteev-parameters": [
7182
{

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
"""

0 commit comments

Comments
 (0)