From dd1eb869b11c98b7ec549edfd314e998f0291a8e Mon Sep 17 00:00:00 2001 From: Andrew Longosz Date: Tue, 7 Nov 2017 20:00:40 +0100 Subject: [PATCH 1/7] EZP-28161: [CS] Updated php-cs-fixer config to v2.7.1 --- .php_cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.php_cs b/.php_cs index e0f95af..2d9d28b 100644 --- a/.php_cs +++ b/.php_cs @@ -16,6 +16,8 @@ return PhpCsFixer\Config::create() 'phpdoc_annotation_without_dot' => false, 'phpdoc_no_alias_tag' => false, 'space_after_semicolon' => false, + 'yoda_style' => false, + 'no_break_comment' => false, ]) ->setRiskyAllowed(true) ->setFinder( From 28a5cfaa54149b185d2a9c3ebcc8e88cbf8026eb Mon Sep 17 00:00:00 2001 From: Andrew Longosz Date: Tue, 7 Nov 2017 20:10:09 +0100 Subject: [PATCH 2/7] [Composer] Fixed ezpublish-kernel dependency --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index bdece24..1c5436d 100644 --- a/composer.json +++ b/composer.json @@ -10,12 +10,12 @@ } ], "require": { + "ezsystems/ezpublish-kernel": "~5.1 || ^6.7", "guzzlehttp/guzzle": "~5.0|~6.0", "components/handlebars.js": "~3.0.0", "symfony/symfony": "^2.7.7" }, "require-dev": { - "ezsystems/ezpublish-kernel": "~6.0.0 | ~5.1", "phpunit/phpunit": "~4.7", "friendsofphp/php-cs-fixer": "^2.1" }, From 5940181a9142dd824be337ec65c5d23a6024235c Mon Sep 17 00:00:00 2001 From: Andrew Longosz Date: Tue, 7 Nov 2017 20:11:42 +0100 Subject: [PATCH 3/7] [Composer] Allowed Symfony 3.3 --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 1c5436d..37c83ef 100644 --- a/composer.json +++ b/composer.json @@ -13,7 +13,7 @@ "ezsystems/ezpublish-kernel": "~5.1 || ^6.7", "guzzlehttp/guzzle": "~5.0|~6.0", "components/handlebars.js": "~3.0.0", - "symfony/symfony": "^2.7.7" + "symfony/symfony": "^2.7.7 || ^3.3" }, "require-dev": { "phpunit/phpunit": "~4.7", From c7b26076a2847b77d6f7994c0025d70d8a815922 Mon Sep 17 00:00:00 2001 From: Andrew Longosz Date: Tue, 7 Nov 2017 20:12:44 +0100 Subject: [PATCH 4/7] EZP-28161: [Composer] Added dev dependency for php-cs-fixer:~2.7.1 --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 37c83ef..4446f6e 100644 --- a/composer.json +++ b/composer.json @@ -17,7 +17,7 @@ }, "require-dev": { "phpunit/phpunit": "~4.7", - "friendsofphp/php-cs-fixer": "^2.1" + "friendsofphp/php-cs-fixer": "~2.7.1" }, "autoload": { "psr-4": { From 410095a9f89ec5865b53b992cb60113fa31f7618 Mon Sep 17 00:00:00 2001 From: Andrew Longosz Date: Tue, 7 Nov 2017 20:13:28 +0100 Subject: [PATCH 5/7] EZP-28161: [Composer] Added composer command fix-cs Usage: composer fix-cs --- composer.json | 3 +++ 1 file changed, 3 insertions(+) diff --git a/composer.json b/composer.json index 4446f6e..07afdfc 100644 --- a/composer.json +++ b/composer.json @@ -24,6 +24,9 @@ "EzSystems\\RecommendationBundle\\": "" } }, + "scripts": { + "fix-cs": "@php ./vendor/bin/php-cs-fixer fix -v --show-progress=estimating" + }, "extra": { "branch-alias": { "dev-master": "1.2.x-dev" From 39288d8bbce2f0ce0c4ee3c8d728954f6197f714 Mon Sep 17 00:00:00 2001 From: Andrew Longosz Date: Tue, 7 Nov 2017 20:17:37 +0100 Subject: [PATCH 6/7] EZP-28161: [Travis] Removed php-cs-fixer to avoid conflicts php-cs-fixer is currently not needed for Travis tests to run --- .travis.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.travis.yml b/.travis.yml index cbd0da9..2de3760 100644 --- a/.travis.yml +++ b/.travis.yml @@ -27,6 +27,8 @@ before_script: - echo 'memory_limit = -1' >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini # If set update symfony version - if [ "$SYMFONY_VERSION" != "" ]; then composer require --no-update symfony/symfony=$SYMFONY_VERSION; fi; + # Remove php-cs-fixer as it is currently not needed on Travis + - composer remove --dev --no-update friendsofphp/php-cs-fixer # Install packages using composer - composer install --prefer-dist # Detecting timezone issues by testing on random timezone From 8b3e72edd939e7c9609df77390e7b638f9d38b96 Mon Sep 17 00:00:00 2001 From: Andrew Longosz Date: Tue, 7 Nov 2017 20:46:54 +0100 Subject: [PATCH 7/7] [Tests] Aligned tests with ezpublish-kernel LTS --- Tests/Client/YooChooseNotifierTest.php | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/Tests/Client/YooChooseNotifierTest.php b/Tests/Client/YooChooseNotifierTest.php index ee1a5a7..d9ba422 100644 --- a/Tests/Client/YooChooseNotifierTest.php +++ b/Tests/Client/YooChooseNotifierTest.php @@ -8,7 +8,6 @@ use PHPUnit_Framework_TestCase; use GuzzleHttp\Promise\Promise; use GuzzleHttp\Psr7\Response; -use eZ\Publish\Core\Repository\Values\Content\Content; use eZ\Publish\Core\Repository\Values\ContentType\ContentType; use eZ\Publish\API\Repository\Values\Content\ContentInfo; use EzSystems\RecommendationBundle\Client\YooChooseNotifier; @@ -250,14 +249,10 @@ protected function getContentTypeServiceMock($contentTypeId) */ protected function getRepositoryServiceMock($identifier) { - $repositoryInterfaceServiceMock = $this->getMock('eZ\Publish\API\Repository\Repository'); - $signalDispatcherServiceMock = $this->getMock('eZ\Publish\Core\SignalSlot\SignalDispatcher'); - - $repositoryServiceMock = $this->getMock( - 'eZ\Publish\Core\SignalSlot\Repository', - array('sudo', 'getContentService', 'getContentTypeService'), - array($repositoryInterfaceServiceMock, $signalDispatcherServiceMock) - ); + $repositoryServiceMock = $this + ->getMockBuilder('\eZ\Publish\Core\SignalSlot\Repository') + ->disableOriginalConstructor() + ->getMock(); $repositoryServiceMock ->expects($this->any())