From 56972b9ba028f3cf42d5311bfa9c9a4ecccc890e Mon Sep 17 00:00:00 2001 From: Daniel Leech Date: Wed, 8 Jan 2020 19:38:29 +0000 Subject: [PATCH 01/17] Revert "Revert "Add support for symfony 5"" This reverts commit 960d15d8ad44fe19d3fa29af5ec8434b4cae1905. --- .travis.yml | 22 ++++++++++++++++++++++ composer.json | 14 +++++++------- 2 files changed, 29 insertions(+), 7 deletions(-) diff --git a/.travis.yml b/.travis.yml index 8ee9b8a1..c303aa4c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -62,9 +62,31 @@ matrix: - PREFER="" - BEHAT_SUITE=cli - SYMFONY_VERSION=^4.0 + - php: 7.3 + env: + - PREFER="" + - BEHAT_SUITE=standalone + - SYMFONY_VERSION=^2.8 + - php: 7.3 + env: + - PREFER="" + - BEHAT_SUITE=embedded + - SYMFONY_VERSION=^3.0 + - php: 7.3 + env: + - PREFER="" + - BEHAT_SUITE=embedded + - SYMFONY_VERSION=^4.0 + - php: 7.3 + env: + - PREFER="" + - BEHAT_SUITE=cli + - SYMFONY_VERSION=^5.0 + - MINIMUM_STABILITY=dev before_script: - composer self-update + - if [[ "$MINIMUM_STABILITY" ]]; then composer config minimum-stability $MINIMUM_STABILITY ; fi - composer require "symfony/symfony" "$SYMFONY_VERSION" --no-update - composer update $PREFER - bash tests/bin/travis_jackrabbit.sh diff --git a/composer.json b/composer.json index b9050f74..b656e6ab 100644 --- a/composer.json +++ b/composer.json @@ -3,19 +3,19 @@ "description": "Shell for PHPCR", "require": { "php": "^5.6|^7.0", - "symfony/console": "~2.8|~3.0|~4.0", + "symfony/console": "~2.8|~3.0|~4.0|~5.0", "jackalope/jackalope": "~1.1", "phpcr/phpcr": "~2.1", "phpcr/phpcr-utils": "~1.2", - "symfony/finder": "~2.8|~3.0|~4.0", - "symfony/serializer": "~2.8|~3.0|~4.0", - "symfony/yaml": "~2.8|~3.0|~4.0", - "symfony/dependency-injection": "~2.8|~3.0|~4.0", - "symfony/expression-language": "~2.8|~3.0|~4.0", + "symfony/finder": "~2.8|~3.0|~4.0|~5.0", + "symfony/serializer": "~2.8|~3.0|~4.0|~5.0", + "symfony/yaml": "~2.8|~3.0|~4.0|~5.0", + "symfony/dependency-injection": "~2.8|~3.0|~4.0|~5.0", + "symfony/expression-language": "~2.8|~3.0|~4.0|~5.0", "dantleech/glob-finder": "~1.0" }, "require-dev": { - "symfony/symfony": "~2.8|~3.0|~4.0", + "symfony/symfony": "~2.8|~3.0|~4.0|~5.0", "phpunit/phpunit": "~5.7", "behat/behat": "~3.1", "phpspec/phpspec": "~3.2|~4.0", From a8dbc407b3c892c331f189909703126936534ab6 Mon Sep 17 00:00:00 2001 From: Daniel Leech Date: Wed, 8 Jan 2020 19:39:20 +0000 Subject: [PATCH 02/17] Removed minimum stability --- .travis.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index c303aa4c..083eac1a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -82,11 +82,9 @@ matrix: - PREFER="" - BEHAT_SUITE=cli - SYMFONY_VERSION=^5.0 - - MINIMUM_STABILITY=dev before_script: - composer self-update - - if [[ "$MINIMUM_STABILITY" ]]; then composer config minimum-stability $MINIMUM_STABILITY ; fi - composer require "symfony/symfony" "$SYMFONY_VERSION" --no-update - composer update $PREFER - bash tests/bin/travis_jackrabbit.sh From 53cd528bf93868f0ce06fed4adca704919e417a5 Mon Sep 17 00:00:00 2001 From: Daniel Leech Date: Wed, 8 Jan 2020 19:41:25 +0000 Subject: [PATCH 03/17] Applies CS fixes --- src/PHPCR/Shell/Console/Application/ShellApplication.php | 1 - src/PHPCR/Shell/Console/Command/Phpcr/LockRefreshCommand.php | 1 - .../Shell/Console/Command/Phpcr/NodeLifecycleFollowCommand.php | 1 - src/PHPCR/Shell/Console/Command/Phpcr/NodeListCommand.php | 1 - src/PHPCR/Shell/Console/Command/Phpcr/NodeMoveCommand.php | 1 - src/PHPCR/Shell/Console/Command/Phpcr/NodeReferencesCommand.php | 1 - src/PHPCR/Shell/Console/Command/Phpcr/NodeTypeEditCommand.php | 1 - src/PHPCR/Shell/Console/Command/Phpcr/NodeTypeLoadCommand.php | 1 - src/PHPCR/Shell/Console/Command/Phpcr/QueryCommand.php | 1 - src/PHPCR/Shell/Console/Command/Phpcr/QueryDeleteCommand.php | 1 - src/PHPCR/Shell/Console/Command/Phpcr/QuerySelectCommand.php | 1 - src/PHPCR/Shell/Console/Command/Phpcr/QueryUpdateCommand.php | 1 - .../Console/Command/Phpcr/RepositoryDescriptorListCommand.php | 1 - .../Shell/Console/Command/Phpcr/SessionImpersonateCommand.php | 1 - src/PHPCR/Shell/Console/Command/Phpcr/SessionInfoCommand.php | 1 - src/PHPCR/Shell/Console/Command/Phpcr/SessionLogoutCommand.php | 1 - .../Shell/Console/Command/Phpcr/WorkspaceCreateCommand.php | 1 - src/PHPCR/Shell/Console/Command/ShellCommand.php | 2 +- tests/PHPCR/Shell/Helper/EditorHelperTest.php | 2 +- 19 files changed, 2 insertions(+), 19 deletions(-) diff --git a/src/PHPCR/Shell/Console/Application/ShellApplication.php b/src/PHPCR/Shell/Console/Application/ShellApplication.php index ae7d94cc..4a440b78 100644 --- a/src/PHPCR/Shell/Console/Application/ShellApplication.php +++ b/src/PHPCR/Shell/Console/Application/ShellApplication.php @@ -12,7 +12,6 @@ namespace PHPCR\Shell\Console\Application; -use PHPCR\Shell\Config\Profile; use PHPCR\Shell\Console\Command\Phpcr as CommandPhpcr; use PHPCR\Shell\Console\Command\Phpcr\BasePhpcrCommand; use PHPCR\Shell\Console\Command\Shell as CommandShell; diff --git a/src/PHPCR/Shell/Console/Command/Phpcr/LockRefreshCommand.php b/src/PHPCR/Shell/Console/Command/Phpcr/LockRefreshCommand.php index 2298276f..a4889c94 100644 --- a/src/PHPCR/Shell/Console/Command/Phpcr/LockRefreshCommand.php +++ b/src/PHPCR/Shell/Console/Command/Phpcr/LockRefreshCommand.php @@ -13,7 +13,6 @@ namespace PHPCR\Shell\Console\Command\Phpcr; use PHPCR\RepositoryInterface; -use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; diff --git a/src/PHPCR/Shell/Console/Command/Phpcr/NodeLifecycleFollowCommand.php b/src/PHPCR/Shell/Console/Command/Phpcr/NodeLifecycleFollowCommand.php index 2322e916..cf07c7df 100644 --- a/src/PHPCR/Shell/Console/Command/Phpcr/NodeLifecycleFollowCommand.php +++ b/src/PHPCR/Shell/Console/Command/Phpcr/NodeLifecycleFollowCommand.php @@ -13,7 +13,6 @@ namespace PHPCR\Shell\Console\Command\Phpcr; use PHPCR\RepositoryInterface; -use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; diff --git a/src/PHPCR/Shell/Console/Command/Phpcr/NodeListCommand.php b/src/PHPCR/Shell/Console/Command/Phpcr/NodeListCommand.php index 1467ae21..f73222d0 100644 --- a/src/PHPCR/Shell/Console/Command/Phpcr/NodeListCommand.php +++ b/src/PHPCR/Shell/Console/Command/Phpcr/NodeListCommand.php @@ -17,7 +17,6 @@ use PHPCR\PropertyInterface; use PHPCR\PropertyType; use PHPCR\Shell\Console\Helper\Table; -use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Input\InputOption; diff --git a/src/PHPCR/Shell/Console/Command/Phpcr/NodeMoveCommand.php b/src/PHPCR/Shell/Console/Command/Phpcr/NodeMoveCommand.php index 82bcbeb7..31d21530 100644 --- a/src/PHPCR/Shell/Console/Command/Phpcr/NodeMoveCommand.php +++ b/src/PHPCR/Shell/Console/Command/Phpcr/NodeMoveCommand.php @@ -12,7 +12,6 @@ namespace PHPCR\Shell\Console\Command\Phpcr; -use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; diff --git a/src/PHPCR/Shell/Console/Command/Phpcr/NodeReferencesCommand.php b/src/PHPCR/Shell/Console/Command/Phpcr/NodeReferencesCommand.php index c7fc66fd..40e5c037 100644 --- a/src/PHPCR/Shell/Console/Command/Phpcr/NodeReferencesCommand.php +++ b/src/PHPCR/Shell/Console/Command/Phpcr/NodeReferencesCommand.php @@ -13,7 +13,6 @@ namespace PHPCR\Shell\Console\Command\Phpcr; use PHPCR\Shell\Console\Helper\Table; -use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; diff --git a/src/PHPCR/Shell/Console/Command/Phpcr/NodeTypeEditCommand.php b/src/PHPCR/Shell/Console/Command/Phpcr/NodeTypeEditCommand.php index 099c28ec..c94002a8 100644 --- a/src/PHPCR/Shell/Console/Command/Phpcr/NodeTypeEditCommand.php +++ b/src/PHPCR/Shell/Console/Command/Phpcr/NodeTypeEditCommand.php @@ -15,7 +15,6 @@ use PHPCR\NodeType\NoSuchNodeTypeException; use PHPCR\Util\CND\Parser\CndParser; use PHPCR\Util\CND\Writer\CndWriter; -use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; diff --git a/src/PHPCR/Shell/Console/Command/Phpcr/NodeTypeLoadCommand.php b/src/PHPCR/Shell/Console/Command/Phpcr/NodeTypeLoadCommand.php index 89bd886c..e708f9e1 100644 --- a/src/PHPCR/Shell/Console/Command/Phpcr/NodeTypeLoadCommand.php +++ b/src/PHPCR/Shell/Console/Command/Phpcr/NodeTypeLoadCommand.php @@ -12,7 +12,6 @@ namespace PHPCR\Shell\Console\Command\Phpcr; -use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Input\InputOption; diff --git a/src/PHPCR/Shell/Console/Command/Phpcr/QueryCommand.php b/src/PHPCR/Shell/Console/Command/Phpcr/QueryCommand.php index 82d116e2..5bf410f8 100644 --- a/src/PHPCR/Shell/Console/Command/Phpcr/QueryCommand.php +++ b/src/PHPCR/Shell/Console/Command/Phpcr/QueryCommand.php @@ -12,7 +12,6 @@ namespace PHPCR\Shell\Console\Command\Phpcr; -use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Input\InputOption; diff --git a/src/PHPCR/Shell/Console/Command/Phpcr/QueryDeleteCommand.php b/src/PHPCR/Shell/Console/Command/Phpcr/QueryDeleteCommand.php index ae820c5d..e9aaedc0 100644 --- a/src/PHPCR/Shell/Console/Command/Phpcr/QueryDeleteCommand.php +++ b/src/PHPCR/Shell/Console/Command/Phpcr/QueryDeleteCommand.php @@ -13,7 +13,6 @@ namespace PHPCR\Shell\Console\Command\Phpcr; use PHPCR\Util\QOM\Sql2ToQomQueryConverter; -use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; diff --git a/src/PHPCR/Shell/Console/Command/Phpcr/QuerySelectCommand.php b/src/PHPCR/Shell/Console/Command/Phpcr/QuerySelectCommand.php index 1b50bf5e..47e10e39 100644 --- a/src/PHPCR/Shell/Console/Command/Phpcr/QuerySelectCommand.php +++ b/src/PHPCR/Shell/Console/Command/Phpcr/QuerySelectCommand.php @@ -12,7 +12,6 @@ namespace PHPCR\Shell\Console\Command\Phpcr; -use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; diff --git a/src/PHPCR/Shell/Console/Command/Phpcr/QueryUpdateCommand.php b/src/PHPCR/Shell/Console/Command/Phpcr/QueryUpdateCommand.php index 8a12b088..d926e7cb 100644 --- a/src/PHPCR/Shell/Console/Command/Phpcr/QueryUpdateCommand.php +++ b/src/PHPCR/Shell/Console/Command/Phpcr/QueryUpdateCommand.php @@ -13,7 +13,6 @@ namespace PHPCR\Shell\Console\Command\Phpcr; use PHPCR\Shell\Query\UpdateParser; -use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; diff --git a/src/PHPCR/Shell/Console/Command/Phpcr/RepositoryDescriptorListCommand.php b/src/PHPCR/Shell/Console/Command/Phpcr/RepositoryDescriptorListCommand.php index 12a9fe5d..609e842d 100644 --- a/src/PHPCR/Shell/Console/Command/Phpcr/RepositoryDescriptorListCommand.php +++ b/src/PHPCR/Shell/Console/Command/Phpcr/RepositoryDescriptorListCommand.php @@ -13,7 +13,6 @@ namespace PHPCR\Shell\Console\Command\Phpcr; use PHPCR\Shell\Console\Helper\Table; -use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; diff --git a/src/PHPCR/Shell/Console/Command/Phpcr/SessionImpersonateCommand.php b/src/PHPCR/Shell/Console/Command/Phpcr/SessionImpersonateCommand.php index c3f663fb..0dc80871 100644 --- a/src/PHPCR/Shell/Console/Command/Phpcr/SessionImpersonateCommand.php +++ b/src/PHPCR/Shell/Console/Command/Phpcr/SessionImpersonateCommand.php @@ -13,7 +13,6 @@ namespace PHPCR\Shell\Console\Command\Phpcr; use PHPCR\SimpleCredentials; -use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; diff --git a/src/PHPCR/Shell/Console/Command/Phpcr/SessionInfoCommand.php b/src/PHPCR/Shell/Console/Command/Phpcr/SessionInfoCommand.php index 21137f46..dc784760 100644 --- a/src/PHPCR/Shell/Console/Command/Phpcr/SessionInfoCommand.php +++ b/src/PHPCR/Shell/Console/Command/Phpcr/SessionInfoCommand.php @@ -13,7 +13,6 @@ namespace PHPCR\Shell\Console\Command\Phpcr; use PHPCR\Shell\Console\Helper\Table; -use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; diff --git a/src/PHPCR/Shell/Console/Command/Phpcr/SessionLogoutCommand.php b/src/PHPCR/Shell/Console/Command/Phpcr/SessionLogoutCommand.php index d6efc76e..2c7e2f2c 100644 --- a/src/PHPCR/Shell/Console/Command/Phpcr/SessionLogoutCommand.php +++ b/src/PHPCR/Shell/Console/Command/Phpcr/SessionLogoutCommand.php @@ -12,7 +12,6 @@ namespace PHPCR\Shell\Console\Command\Phpcr; -use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; diff --git a/src/PHPCR/Shell/Console/Command/Phpcr/WorkspaceCreateCommand.php b/src/PHPCR/Shell/Console/Command/Phpcr/WorkspaceCreateCommand.php index 93e868ae..aca0ae70 100644 --- a/src/PHPCR/Shell/Console/Command/Phpcr/WorkspaceCreateCommand.php +++ b/src/PHPCR/Shell/Console/Command/Phpcr/WorkspaceCreateCommand.php @@ -12,7 +12,6 @@ namespace PHPCR\Shell\Console\Command\Phpcr; -use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; diff --git a/src/PHPCR/Shell/Console/Command/ShellCommand.php b/src/PHPCR/Shell/Console/Command/ShellCommand.php index b9b0cdef..32b94a15 100644 --- a/src/PHPCR/Shell/Console/Command/ShellCommand.php +++ b/src/PHPCR/Shell/Console/Command/ShellCommand.php @@ -77,7 +77,7 @@ public function configure() new InputOption('--command', null, InputOption::VALUE_REQUIRED | InputOption::VALUE_IS_ARRAY, 'Run the given command'), new InputArgument('workspace', InputArgument::OPTIONAL, 'Workspace to start with', 'default'), - ]); + ]); } /** diff --git a/tests/PHPCR/Shell/Helper/EditorHelperTest.php b/tests/PHPCR/Shell/Helper/EditorHelperTest.php index 777cd65d..c5b26ef8 100644 --- a/tests/PHPCR/Shell/Helper/EditorHelperTest.php +++ b/tests/PHPCR/Shell/Helper/EditorHelperTest.php @@ -56,7 +56,7 @@ public function provideFromStringWithMessage() <<<'EOT' This is some text that I want to edit EOT - , + , <<<'EOT' This is some text that I want the user to see in a commend From 1453f11811c00edba8e7966b48a009520f65f535 Mon Sep 17 00:00:00 2001 From: Alexander Schranz Date: Wed, 5 Feb 2020 09:58:51 +0100 Subject: [PATCH 04/17] Add support for symfony 5 --- .travis.yml | 2 +- composer.json | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 083eac1a..690dfcab 100644 --- a/.travis.yml +++ b/.travis.yml @@ -90,6 +90,6 @@ before_script: - bash tests/bin/travis_jackrabbit.sh script: - - phpunit + - vendor/bin/simple-phpunit - php vendor/bin/phpspec run - php vendor/behat/behat/bin/behat --suite=$BEHAT_SUITE diff --git a/composer.json b/composer.json index b656e6ab..bfedda71 100644 --- a/composer.json +++ b/composer.json @@ -15,10 +15,10 @@ "dantleech/glob-finder": "~1.0" }, "require-dev": { + "symfony/phpunit-bridge": "~5.0", "symfony/symfony": "~2.8|~3.0|~4.0|~5.0", - "phpunit/phpunit": "~5.7", "behat/behat": "~3.1", - "phpspec/phpspec": "~3.2|~4.0", + "phpspec/phpspec": "~3.2|~4.0|~5.0|~6.0", "jackalope/jackalope-doctrine-dbal": "~1.2", "jackalope/jackalope-jackrabbit": "~1.2" }, From a16f41901d3fffd4659f7897bcb0a8143be869ce Mon Sep 17 00:00:00 2001 From: Alexander Schranz Date: Wed, 5 Feb 2020 10:19:54 +0100 Subject: [PATCH 05/17] Fix phpunit compatibility --- .gitignore | 1 + phpunit.xml.dist | 4 ++++ tests/PHPCR/Shell/Helper/EditorHelperTest.php | 9 +++++---- tests/PHPCR/Shell/Helper/NodeHelperTest.php | 7 ++++--- tests/PHPCR/Shell/Helper/TextHelperTest.php | 6 ++++-- tests/PHPCR/Shell/Phpcr/PhpcrSessionTest.php | 3 ++- 6 files changed, 20 insertions(+), 10 deletions(-) diff --git a/.gitignore b/.gitignore index ebd6c0ba..0da651e2 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ vendor composer.lock phpcr.phar +.phpunit.result.cache diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 478f79be..cc7aac5c 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -6,6 +6,10 @@ bootstrap="vendor/autoload.php" > + + + + ./tests diff --git a/tests/PHPCR/Shell/Helper/EditorHelperTest.php b/tests/PHPCR/Shell/Helper/EditorHelperTest.php index c5b26ef8..afa2a071 100644 --- a/tests/PHPCR/Shell/Helper/EditorHelperTest.php +++ b/tests/PHPCR/Shell/Helper/EditorHelperTest.php @@ -12,7 +12,9 @@ namespace PHPCR\Shell\Console\Helper; -class EditorHelperTest extends \PHPUnit_Framework_TestCase +use PHPUnit\Framework\TestCase; + +class EditorHelperTest extends TestCase { protected $helper; @@ -40,11 +42,10 @@ public function testFromValue() ); } - /** - * @expectedException \RuntimeException - */ public function testFromValueNoEditor() { + $this->expectException(\RuntimeException::class); + putenv('EDITOR='); $res = $this->helper->fromString('asd'); } diff --git a/tests/PHPCR/Shell/Helper/NodeHelperTest.php b/tests/PHPCR/Shell/Helper/NodeHelperTest.php index 8fded511..dadf3487 100644 --- a/tests/PHPCR/Shell/Helper/NodeHelperTest.php +++ b/tests/PHPCR/Shell/Helper/NodeHelperTest.php @@ -13,8 +13,9 @@ namespace PHPCR\Shell\Console\Helper; use PHPCR\NodeInterface; +use PHPUnit\Framework\TestCase; -class NodeHelperTest extends \PHPUnit_Framework_TestCase +class NodeHelperTest extends TestCase { protected $nodeHelper; @@ -41,10 +42,10 @@ public function provideAssertNodeIsVersionable() public function testAssertNodeIsVersionable($isVersionable) { $this->node->getPath()->willReturn('/'); - $this->node->isNodeType('mix:versionable')->willReturn($isVersionable); + $this->node->isNodeType('mix:versionable')->willReturn($isVersionable)->shouldBeCalled(); if (false == $isVersionable) { - $this->setExpectedException('\OutOfBoundsException', 'is not versionable'); + $this->expectException('\OutOfBoundsException', 'is not versionable'); } $this->helper->assertNodeIsVersionable($this->node->reveal()); } diff --git a/tests/PHPCR/Shell/Helper/TextHelperTest.php b/tests/PHPCR/Shell/Helper/TextHelperTest.php index 7998d47a..f632392c 100644 --- a/tests/PHPCR/Shell/Helper/TextHelperTest.php +++ b/tests/PHPCR/Shell/Helper/TextHelperTest.php @@ -12,7 +12,9 @@ namespace PHPCR\Shell\Console\Helper; -class TextHelperTest extends \PHPUnit_Framework_TestCase +use PHPUnit\Framework\TestCase; + +class TextHelperTest extends TestCase { protected $textHelper; @@ -76,7 +78,7 @@ public function provideTruncate() public function testTruncate($text, $length, $alignment, $truncateString, $expected, $expectedException = null) { if ($expectedException) { - $this->setExpectedException('InvalidArgumentException', $expectedException); + $this->expectException('InvalidArgumentException', $expectedException); } $res = $this->textHelper->truncate($text, $length, $alignment, $truncateString); $this->assertEquals($expected, $res); diff --git a/tests/PHPCR/Shell/Phpcr/PhpcrSessionTest.php b/tests/PHPCR/Shell/Phpcr/PhpcrSessionTest.php index 7b6327a2..c3d49fc1 100644 --- a/tests/PHPCR/Shell/Phpcr/PhpcrSessionTest.php +++ b/tests/PHPCR/Shell/Phpcr/PhpcrSessionTest.php @@ -13,8 +13,9 @@ namespace PHPCR\Shell\Phpcr; use PHPCR\PathNotFoundException; +use PHPUnit\Framework\TestCase; -class PhpcrSessionTest extends \Phpunit_Framework_TestCase +class PhpcrSessionTest extends TestCase { public function setUp() { From 54cc4d508046faf67da11cbd74ac5dd7340019e2 Mon Sep 17 00:00:00 2001 From: Alexander Schranz Date: Wed, 5 Feb 2020 10:33:11 +0100 Subject: [PATCH 06/17] Use webmozart assert in behat tests --- composer.json | 3 +- src/PHPCR/Shell/Test/CliContext.php | 3 +- src/PHPCR/Shell/Test/ContextBase.php | 45 ++++++++++++++-------------- 3 files changed, 27 insertions(+), 24 deletions(-) diff --git a/composer.json b/composer.json index bfedda71..3854e909 100644 --- a/composer.json +++ b/composer.json @@ -20,7 +20,8 @@ "behat/behat": "~3.1", "phpspec/phpspec": "~3.2|~4.0|~5.0|~6.0", "jackalope/jackalope-doctrine-dbal": "~1.2", - "jackalope/jackalope-jackrabbit": "~1.2" + "jackalope/jackalope-jackrabbit": "~1.2", + "webmozart/assert": "^1.6" }, "suggest": { "jackalope/jackalope-doctrine-dbal": "To connect to jackalope doctrine-dbal", diff --git a/src/PHPCR/Shell/Test/CliContext.php b/src/PHPCR/Shell/Test/CliContext.php index 5c0b1923..95748a26 100644 --- a/src/PHPCR/Shell/Test/CliContext.php +++ b/src/PHPCR/Shell/Test/CliContext.php @@ -16,6 +16,7 @@ use Behat\Behat\Context\SnippetAcceptingContext; use Behat\Gherkin\Node\PyStringNode; use Symfony\Component\Filesystem\Filesystem; +use Webmozart\Assert\Assert; /** * Features context. @@ -112,6 +113,6 @@ public function initializeDoctrineDbal() */ public function theCommandShouldNotFail() { - \PHPUnit_Framework_Assert::assertEquals(0, $this->lastExitCode); + Assert::eq(0, $this->lastExitCode); } } diff --git a/src/PHPCR/Shell/Test/ContextBase.php b/src/PHPCR/Shell/Test/ContextBase.php index 8385fe86..e27f058b 100644 --- a/src/PHPCR/Shell/Test/ContextBase.php +++ b/src/PHPCR/Shell/Test/ContextBase.php @@ -25,6 +25,7 @@ use PHPCR\Util\NodeHelper; use PHPCR\Util\PathHelper; use Symfony\Component\Filesystem\Filesystem; +use Webmozart\Assert\Assert; /** * Features context. @@ -199,7 +200,7 @@ public function iShouldSeeATableContainingTheFollowingRows(TableNode $table) } } - \PHPUnit_Framework_Assert::assertGreaterThanOrEqual(count($expectedRows), $foundRows, $this->getOutput()); + Assert::greaterThanEq(count($expectedRows), $foundRows, $this->getOutput()); } /** @@ -208,7 +209,7 @@ public function iShouldSeeATableContainingTheFollowingRows(TableNode $table) public function iShouldSeeTheFollowing(PyStringNode $string) { $output = $this->getOutput(); - \PHPUnit_Framework_Assert::assertContains($string->getRaw(), $output); + Assert::contains($string->getRaw(), $output); } /** @@ -217,7 +218,7 @@ public function iShouldSeeTheFollowing(PyStringNode $string) public function iShouldNotSeeTheFollowing(PyStringNode $string) { $output = $this->getOutput(); - \PHPUnit_Framework_Assert::assertNotContains($string->getRaw(), $output); + Assert::notContains($string->getRaw(), $output); } /** @@ -248,7 +249,7 @@ public function theCommandShouldNotFail() throw new \Exception('Command failed: ('.$exitCode.') '.$this->getOutput()); } - \PHPUnit_Framework_Assert::assertEquals(0, $exitCode, 'Command exited with code: '.$exitCode); + Assert::eq(0, $exitCode, 'Command exited with code: '.$exitCode); } /** @@ -258,7 +259,7 @@ public function theCommandShouldFail() { $exitCode = $this->applicationTester->getLastExitCode(); - \PHPUnit_Framework_Assert::assertNotEquals(0, $exitCode, 'Command exited with code '.$exitCode); + Assert::notEq(0, $exitCode, 'Command exited with code '.$exitCode); } /** @@ -269,7 +270,7 @@ public function theCommandShouldFailWithMessage($arg1) $exitCode = $this->applicationTester->getLastExitCode(); $output = $this->getOutput(); - \PHPUnit_Framework_Assert::assertEquals($arg1, $output); + Assert::eq($arg1, $output); } /** @@ -277,7 +278,7 @@ public function theCommandShouldFailWithMessage($arg1) */ public function theFileShouldExist($arg1) { - \PHPUnit_Framework_Assert::assertTrue(file_exists($this->getWorkingFilePath($arg1))); + Assert::true(file_exists($this->getWorkingFilePath($arg1))); } /** @@ -304,7 +305,7 @@ public function theFileExists($arg1) public function theOutputShouldContain(PyStringNode $string) { foreach ($string->getStrings() as $line) { - \PHPUnit_Framework_Assert::assertContains($line, $this->getOutput()); + Assert::contains($line, $this->getOutput()); } } @@ -315,7 +316,7 @@ public function theNodeShouldNotExist($arg1) { $session = $this->getSession(); $node = $session->getNode($arg1); - \PHPUnit_Framework_Assert::assertNull($node); + Assert::null($node); } /** @@ -326,7 +327,7 @@ public function theXpathCountIsInFile($arg1, $arg2, $arg3) $xpath = $this->getXPathForFile($arg3); $res = $xpath->query($arg1); - \PHPUnit_Framework_Assert::assertEquals($arg2, $res->length); + Assert::eq($arg2, $res->length); } /** @@ -363,7 +364,7 @@ public function iShouldNotBeLoggedIntoTheSession() { $this->executeCommand('session:info'); $output = $this->getOutput(); - \PHPUnit_Framework_Assert::assertRegExp('/live .*no/', $output); + Assert::regex('/live .*no/', $output); } /** @@ -427,7 +428,7 @@ public function thereShouldExistANodeAtBefore($arg1, $arg2) throw new \Exception('Could not find child node '.$arg1); } - \PHPUnit_Framework_Assert::assertEquals($arg2, $afterNode->getPath()); + Assert::eq($arg2, $afterNode->getPath()); } /** @@ -530,7 +531,7 @@ public function thenIShouldBeLoggedInAs($arg1) $session = $this->getSession(); $userId = $session->getUserID(); - \PHPUnit_Framework_Assert::assertEquals($userId, $arg1); + Assert::eq($userId, $arg1); } /** @@ -690,7 +691,7 @@ public function theCurrentNodeShouldBe($arg1) { $this->executeCommand('shell:path:show'); $cnp = $this->applicationTester->getLastLine(); - \PHPUnit_Framework_Assert::assertEquals($arg1, $cnp, 'Current path is '.$arg1); + Assert::eq($arg1, $cnp, 'Current path is '.$arg1); } /** @@ -728,7 +729,7 @@ public function thePrimaryTypeOfShouldBe($arg1, $arg2) $session = $this->getSession(); $node = $session->getNode($arg1); $primaryTypeName = $node->getPrimaryNodeType()->getName(); - \PHPUnit_Framework_Assert::assertEquals($arg2, $primaryTypeName, 'Node type of '.$arg1.' is '.$arg2); + Assert::eq($arg2, $primaryTypeName, 'Node type of '.$arg1.' is '.$arg2); } /** @@ -745,7 +746,7 @@ public function theNodeAtShouldHaveThePropertyWithValue($arg1, $arg2, $arg3) $propertyValue = $propertyValue->getIdentifier(); } - \PHPUnit_Framework_Assert::assertEquals($arg3, $propertyValue); + Assert::eq($arg3, $propertyValue); } /** @@ -761,7 +762,7 @@ public function theNodeAtShouldHaveThePropertyWithValueAtIndex($arg1, $arg2, $ar } $propertyType = $property->getValue(); - \PHPUnit_Framework_Assert::assertEquals($arg3, $propertyType[$index]); + Assert::eq($arg3, $propertyType[$index]); } /** @@ -777,7 +778,7 @@ public function thePropertyShouldHaveType($arg1, $arg2) )); } - \PHPUnit_Framework_Assert::assertEquals($arg2, PropertyType::nameFromValue($property->getType())); + Assert::eq($arg2, PropertyType::nameFromValue($property->getType())); } /** @@ -793,8 +794,8 @@ public function thePropertyShouldHaveTypeAndValue($arg1, $arg2, $arg3) )); } - \PHPUnit_Framework_Assert::assertEquals($arg2, PropertyType::nameFromValue($property->getType())); - \PHPUnit_Framework_Assert::assertEquals($arg3, $property->getValue()); + Assert::eq($arg2, PropertyType::nameFromValue($property->getType())); + Assert::eq($arg3, $property->getValue()); } /** @@ -864,7 +865,7 @@ public function theNodeShouldBeLocked($arg1) $lockManager = $workspace->getLockManager(); $isLocked = $lockManager->isLocked($arg1); - \PHPUnit_Framework_Assert::assertTrue($isLocked); + Assert::true($isLocked); } /** @@ -877,7 +878,7 @@ public function theNodeShouldNotBeLocked($arg1) $lockManager = $workspace->getLockManager(); $isLocked = $lockManager->isLocked($arg1); - \PHPUnit_Framework_Assert::assertFalse($isLocked); + Assert::false($isLocked); } /** From 7d05c618ad654434e89f58868113a994102df43d Mon Sep 17 00:00:00 2001 From: Alexander Schranz Date: Wed, 5 Feb 2020 13:06:34 +0100 Subject: [PATCH 07/17] Upgrade for symfony/event-dispatcher 5.0 --- .../Console/Application/ShellApplication.php | 24 +++++++++++++++---- .../Shell/Event/ApplicationInitEvent.php | 1 - .../Shell/Event/CommandExceptionEvent.php | 1 - src/PHPCR/Shell/Event/CommandPreRunEvent.php | 1 - src/PHPCR/Shell/Event/Event.php | 16 +++++++++++++ src/PHPCR/Shell/Event/ProfileInitEvent.php | 1 - 6 files changed, 36 insertions(+), 8 deletions(-) create mode 100644 src/PHPCR/Shell/Event/Event.php diff --git a/src/PHPCR/Shell/Console/Application/ShellApplication.php b/src/PHPCR/Shell/Console/Application/ShellApplication.php index 4a440b78..cce85ddf 100644 --- a/src/PHPCR/Shell/Console/Application/ShellApplication.php +++ b/src/PHPCR/Shell/Console/Application/ShellApplication.php @@ -28,6 +28,7 @@ use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\DependencyInjection\ContainerAwareInterface; use Symfony\Component\EventDispatcher\EventDispatcher; +use Symfony\Component\EventDispatcher\LegacyEventDispatcherProxy; /** * Main application for PHPCRSH. @@ -56,6 +57,11 @@ class ShellApplication extends Application */ protected $initialized = false; + /** + * @var EventDispatcher + */ + private $dispatcher; + /** * Constructor - name and version inherited from SessionApplication. * @@ -94,7 +100,7 @@ public function init() $this->registerShellCommands(); $event = new ApplicationInitEvent($this); - $this->dispatcher->dispatch(PhpcrShellEvents::APPLICATION_INIT, $event); + $this->dispatch(PhpcrShellEvents::APPLICATION_INIT, $event); $this->initialized = true; } @@ -241,7 +247,7 @@ public function doRun(InputInterface $input, OutputInterface $output) $name = $this->getCommandName($input); $event = new Event\CommandPreRunEvent($name, $input); - $this->dispatcher->dispatch(PhpcrShellEvents::COMMAND_PRE_RUN, $event); + $this->dispatch(PhpcrShellEvents::COMMAND_PRE_RUN, $event); $input = $event->getInput(); if (!$name) { @@ -251,7 +257,7 @@ public function doRun(InputInterface $input, OutputInterface $output) try { $exitCode = parent::doRun($input, $output); } catch (\Exception $e) { - $this->dispatcher->dispatch(PhpcrShellEvents::COMMAND_EXCEPTION, new Event\CommandExceptionEvent($e, $this, $output)); + $this->dispatch(PhpcrShellEvents::COMMAND_EXCEPTION, new Event\CommandExceptionEvent($e, $this, $output)); return 1; } @@ -291,7 +297,7 @@ public function add(Command $command) public function dispatchProfileInitEvent(InputInterface $sessionInput, OutputInterface $output) { $event = new Event\ProfileInitEvent($this->container->get('config.profile'), $sessionInput, $output); - $this->dispatcher->dispatch(PhpcrShellEvents::PROFILE_INIT, $event); + $this->dispatch(PhpcrShellEvents::PROFILE_INIT, $event); } /** @@ -328,4 +334,14 @@ public function setDebug($debug) { $this->debug = $debug; } + + private function dispatch(string $eventName, $event) + { + // LegacyEventDispatcherProxy exists in Symfony >= 4.3 + if (class_exists(LegacyEventDispatcherProxy::class)) { + return $this->dispatcher->dispatch($event, $eventName); + } + + return $this->dispatcher->dispatch($eventName, $event); + } } diff --git a/src/PHPCR/Shell/Event/ApplicationInitEvent.php b/src/PHPCR/Shell/Event/ApplicationInitEvent.php index dff48dbc..4eb0c2ba 100644 --- a/src/PHPCR/Shell/Event/ApplicationInitEvent.php +++ b/src/PHPCR/Shell/Event/ApplicationInitEvent.php @@ -13,7 +13,6 @@ namespace PHPCR\Shell\Event; use Symfony\Component\Console\Application; -use Symfony\Component\EventDispatcher\Event; /** * This event is fired when the main shell application diff --git a/src/PHPCR/Shell/Event/CommandExceptionEvent.php b/src/PHPCR/Shell/Event/CommandExceptionEvent.php index 4ed77dd1..761f09c3 100644 --- a/src/PHPCR/Shell/Event/CommandExceptionEvent.php +++ b/src/PHPCR/Shell/Event/CommandExceptionEvent.php @@ -14,7 +14,6 @@ use PHPCR\Shell\Console\Application\ShellApplication; use Symfony\Component\Console\Output\OutputInterface; -use Symfony\Component\EventDispatcher\Event; class CommandExceptionEvent extends Event { diff --git a/src/PHPCR/Shell/Event/CommandPreRunEvent.php b/src/PHPCR/Shell/Event/CommandPreRunEvent.php index e642a037..95d45e59 100644 --- a/src/PHPCR/Shell/Event/CommandPreRunEvent.php +++ b/src/PHPCR/Shell/Event/CommandPreRunEvent.php @@ -13,7 +13,6 @@ namespace PHPCR\Shell\Event; use Symfony\Component\Console\Input\InputInterface; -use Symfony\Component\EventDispatcher\Event; class CommandPreRunEvent extends Event { diff --git a/src/PHPCR/Shell/Event/Event.php b/src/PHPCR/Shell/Event/Event.php new file mode 100644 index 00000000..3e9b7ddc --- /dev/null +++ b/src/PHPCR/Shell/Event/Event.php @@ -0,0 +1,16 @@ + Date: Wed, 5 Feb 2020 13:53:38 +0100 Subject: [PATCH 08/17] Update for symfony/console 5.0 --- .../Command/Phpcr/AccessControlPrivilegeListCommand.php | 2 ++ src/PHPCR/Shell/Console/Command/Phpcr/LockInfoCommand.php | 2 ++ src/PHPCR/Shell/Console/Command/Phpcr/LockLockCommand.php | 2 ++ src/PHPCR/Shell/Console/Command/Phpcr/LockRefreshCommand.php | 2 ++ src/PHPCR/Shell/Console/Command/Phpcr/LockTokenAddCommand.php | 2 ++ .../Shell/Console/Command/Phpcr/LockTokenListCommand.php | 2 ++ .../Shell/Console/Command/Phpcr/LockTokenRemoveCommand.php | 2 ++ src/PHPCR/Shell/Console/Command/Phpcr/LockUnlockCommand.php | 2 ++ src/PHPCR/Shell/Console/Command/Phpcr/NodeCloneCommand.php | 2 ++ src/PHPCR/Shell/Console/Command/Phpcr/NodeCopyCommand.php | 2 ++ .../Shell/Console/Command/Phpcr/NodeCorrespondingCommand.php | 2 ++ src/PHPCR/Shell/Console/Command/Phpcr/NodeCreateCommand.php | 2 ++ .../Shell/Console/Command/Phpcr/NodeFileImportCommand.php | 2 ++ src/PHPCR/Shell/Console/Command/Phpcr/NodeInfoCommand.php | 2 ++ .../Console/Command/Phpcr/NodeLifecycleFollowCommand.php | 2 ++ .../Shell/Console/Command/Phpcr/NodeLifecycleListCommand.php | 2 ++ src/PHPCR/Shell/Console/Command/Phpcr/NodeListCommand.php | 2 ++ src/PHPCR/Shell/Console/Command/Phpcr/NodeMixinAddCommand.php | 2 ++ .../Shell/Console/Command/Phpcr/NodeMixinRemoveCommand.php | 2 ++ src/PHPCR/Shell/Console/Command/Phpcr/NodeMoveCommand.php | 2 ++ .../Shell/Console/Command/Phpcr/NodeOrderBeforeCommand.php | 2 ++ .../Shell/Console/Command/Phpcr/NodePropertyRemoveCommand.php | 2 ++ .../Shell/Console/Command/Phpcr/NodePropertySetCommand.php | 2 ++ .../Shell/Console/Command/Phpcr/NodePropertyShowCommand.php | 2 ++ .../Shell/Console/Command/Phpcr/NodeReferencesCommand.php | 2 ++ src/PHPCR/Shell/Console/Command/Phpcr/NodeRemoveCommand.php | 2 ++ src/PHPCR/Shell/Console/Command/Phpcr/NodeRenameCommand.php | 2 ++ .../Shell/Console/Command/Phpcr/NodeSetPrimaryTypeCommand.php | 2 ++ .../Shell/Console/Command/Phpcr/NodeSharedShowCommand.php | 2 ++ src/PHPCR/Shell/Console/Command/Phpcr/NodeTypeEditCommand.php | 2 ++ src/PHPCR/Shell/Console/Command/Phpcr/NodeTypeListCommand.php | 2 ++ src/PHPCR/Shell/Console/Command/Phpcr/NodeTypeLoadCommand.php | 2 ++ src/PHPCR/Shell/Console/Command/Phpcr/NodeTypeShowCommand.php | 2 ++ .../Shell/Console/Command/Phpcr/NodeTypeUnregisterCommand.php | 2 ++ src/PHPCR/Shell/Console/Command/Phpcr/NodeUpdateCommand.php | 2 ++ src/PHPCR/Shell/Console/Command/Phpcr/QueryCommand.php | 2 ++ src/PHPCR/Shell/Console/Command/Phpcr/QueryDeleteCommand.php | 2 ++ src/PHPCR/Shell/Console/Command/Phpcr/QuerySelectCommand.php | 2 ++ src/PHPCR/Shell/Console/Command/Phpcr/QueryUpdateCommand.php | 2 ++ .../Console/Command/Phpcr/RepositoryDescriptorListCommand.php | 2 ++ .../Shell/Console/Command/Phpcr/RetentionHoldAddCommand.php | 2 ++ .../Shell/Console/Command/Phpcr/RetentionHoldListCommand.php | 2 ++ .../Console/Command/Phpcr/RetentionHoldRemoveCommand.php | 2 ++ .../Shell/Console/Command/Phpcr/RetentionPolicyGetCommand.php | 2 ++ .../Console/Command/Phpcr/RetentionPolicyRemoveCommand.php | 2 ++ .../Shell/Console/Command/Phpcr/SessionExportCommand.php | 4 +++- .../Shell/Console/Command/Phpcr/SessionImpersonateCommand.php | 2 ++ .../Shell/Console/Command/Phpcr/SessionImportCommand.php | 2 ++ src/PHPCR/Shell/Console/Command/Phpcr/SessionInfoCommand.php | 2 ++ src/PHPCR/Shell/Console/Command/Phpcr/SessionLoginCommand.php | 2 ++ .../Shell/Console/Command/Phpcr/SessionLogoutCommand.php | 2 ++ .../Console/Command/Phpcr/SessionNamespaceListCommand.php | 2 ++ .../Console/Command/Phpcr/SessionNamespaceSetCommand.php | 2 ++ .../Shell/Console/Command/Phpcr/SessionRefreshCommand.php | 2 ++ src/PHPCR/Shell/Console/Command/Phpcr/SessionSaveCommand.php | 2 ++ .../Shell/Console/Command/Phpcr/VersionCheckinCommand.php | 2 ++ .../Shell/Console/Command/Phpcr/VersionCheckoutCommand.php | 2 ++ .../Shell/Console/Command/Phpcr/VersionCheckpointCommand.php | 2 ++ .../Shell/Console/Command/Phpcr/VersionHistoryCommand.php | 2 ++ .../Shell/Console/Command/Phpcr/VersionRemoveCommand.php | 2 ++ .../Shell/Console/Command/Phpcr/VersionRestoreCommand.php | 2 ++ .../Shell/Console/Command/Phpcr/WorkspaceCreateCommand.php | 2 ++ .../Shell/Console/Command/Phpcr/WorkspaceDeleteCommand.php | 2 ++ .../Shell/Console/Command/Phpcr/WorkspaceListCommand.php | 2 ++ .../Console/Command/Phpcr/WorkspaceNamespaceListCommand.php | 2 ++ .../Command/Phpcr/WorkspaceNamespaceRegisterCommand.php | 2 ++ .../Command/Phpcr/WorkspaceNamespaceUnregisterCommand.php | 2 ++ src/PHPCR/Shell/Console/Command/Phpcr/WorkspaceUseCommand.php | 2 ++ src/PHPCR/Shell/Console/Command/Shell/AliasListCommand.php | 2 ++ src/PHPCR/Shell/Console/Command/Shell/ClearCommand.php | 2 ++ src/PHPCR/Shell/Console/Command/Shell/ConfigInitCommand.php | 2 ++ src/PHPCR/Shell/Console/Command/Shell/ConfigReloadCommand.php | 2 ++ src/PHPCR/Shell/Console/Command/Shell/ExitCommand.php | 2 +- src/PHPCR/Shell/Console/Command/Shell/PathChangeCommand.php | 2 ++ src/PHPCR/Shell/Console/Command/Shell/PathShowCommand.php | 2 ++ src/PHPCR/Shell/Console/Command/Shell/ProfileShowCommand.php | 2 ++ src/PHPCR/Shell/Console/Command/ShellCommand.php | 4 +++- 77 files changed, 155 insertions(+), 3 deletions(-) diff --git a/src/PHPCR/Shell/Console/Command/Phpcr/AccessControlPrivilegeListCommand.php b/src/PHPCR/Shell/Console/Command/Phpcr/AccessControlPrivilegeListCommand.php index f265f347..8c0189ab 100644 --- a/src/PHPCR/Shell/Console/Command/Phpcr/AccessControlPrivilegeListCommand.php +++ b/src/PHPCR/Shell/Console/Command/Phpcr/AccessControlPrivilegeListCommand.php @@ -73,5 +73,7 @@ public function execute(InputInterface $input, OutputInterface $output) foreach ($privileges as $privilege) { $table->addRow([$privilege->getName()]); } + + return 0; } } diff --git a/src/PHPCR/Shell/Console/Command/Phpcr/LockInfoCommand.php b/src/PHPCR/Shell/Console/Command/Phpcr/LockInfoCommand.php index 8aba5d59..d702686a 100644 --- a/src/PHPCR/Shell/Console/Command/Phpcr/LockInfoCommand.php +++ b/src/PHPCR/Shell/Console/Command/Phpcr/LockInfoCommand.php @@ -64,5 +64,7 @@ public function execute(InputInterface $input, OutputInterface $output) } $table->render($output); + + return 0; } } diff --git a/src/PHPCR/Shell/Console/Command/Phpcr/LockLockCommand.php b/src/PHPCR/Shell/Console/Command/Phpcr/LockLockCommand.php index 6ea1e201..30c17a01 100644 --- a/src/PHPCR/Shell/Console/Command/Phpcr/LockLockCommand.php +++ b/src/PHPCR/Shell/Console/Command/Phpcr/LockLockCommand.php @@ -79,5 +79,7 @@ public function execute(InputInterface $input, OutputInterface $output) $ownerInfo = $input->getOption('owner-info'); $lockManager->lock($path, $isDeep, $isSessionScoped, $timeout, $ownerInfo); + + return 0; } } diff --git a/src/PHPCR/Shell/Console/Command/Phpcr/LockRefreshCommand.php b/src/PHPCR/Shell/Console/Command/Phpcr/LockRefreshCommand.php index a4889c94..b3591714 100644 --- a/src/PHPCR/Shell/Console/Command/Phpcr/LockRefreshCommand.php +++ b/src/PHPCR/Shell/Console/Command/Phpcr/LockRefreshCommand.php @@ -49,5 +49,7 @@ public function execute(InputInterface $input, OutputInterface $output) $lock = $lockManager->getLock($node->getPath()); $lock->refresh(); } + + return 0; } } diff --git a/src/PHPCR/Shell/Console/Command/Phpcr/LockTokenAddCommand.php b/src/PHPCR/Shell/Console/Command/Phpcr/LockTokenAddCommand.php index 296466d9..60087e35 100644 --- a/src/PHPCR/Shell/Console/Command/Phpcr/LockTokenAddCommand.php +++ b/src/PHPCR/Shell/Console/Command/Phpcr/LockTokenAddCommand.php @@ -43,5 +43,7 @@ public function execute(InputInterface $input, OutputInterface $output) $lockToken = $input->getArgument('lockToken'); $lockManager->addLockToken($lockToken); + + return 0; } } diff --git a/src/PHPCR/Shell/Console/Command/Phpcr/LockTokenListCommand.php b/src/PHPCR/Shell/Console/Command/Phpcr/LockTokenListCommand.php index 988924c4..4546b559 100644 --- a/src/PHPCR/Shell/Console/Command/Phpcr/LockTokenListCommand.php +++ b/src/PHPCR/Shell/Console/Command/Phpcr/LockTokenListCommand.php @@ -51,5 +51,7 @@ public function execute(InputInterface $input, OutputInterface $output) } $table->render($output); + + return 0; } } diff --git a/src/PHPCR/Shell/Console/Command/Phpcr/LockTokenRemoveCommand.php b/src/PHPCR/Shell/Console/Command/Phpcr/LockTokenRemoveCommand.php index 66c6cda9..fcb45a33 100644 --- a/src/PHPCR/Shell/Console/Command/Phpcr/LockTokenRemoveCommand.php +++ b/src/PHPCR/Shell/Console/Command/Phpcr/LockTokenRemoveCommand.php @@ -40,5 +40,7 @@ public function execute(InputInterface $input, OutputInterface $output) $lockToken = $input->getArgument('lockToken'); $lockManager->removeLockToken($lockToken); + + return 0; } } diff --git a/src/PHPCR/Shell/Console/Command/Phpcr/LockUnlockCommand.php b/src/PHPCR/Shell/Console/Command/Phpcr/LockUnlockCommand.php index d094c655..c4031cc0 100644 --- a/src/PHPCR/Shell/Console/Command/Phpcr/LockUnlockCommand.php +++ b/src/PHPCR/Shell/Console/Command/Phpcr/LockUnlockCommand.php @@ -48,5 +48,7 @@ public function execute(InputInterface $input, OutputInterface $output) $path = $session->getAbsPath($input->getArgument('path')); $lockManager->unlock($path); + + return 0; } } diff --git a/src/PHPCR/Shell/Console/Command/Phpcr/NodeCloneCommand.php b/src/PHPCR/Shell/Console/Command/Phpcr/NodeCloneCommand.php index 0403251b..1baf9ee3 100644 --- a/src/PHPCR/Shell/Console/Command/Phpcr/NodeCloneCommand.php +++ b/src/PHPCR/Shell/Console/Command/Phpcr/NodeCloneCommand.php @@ -73,5 +73,7 @@ public function execute(InputInterface $input, OutputInterface $output) $workspace = $session->getWorkspace(); $workspace->cloneFrom($srcWorkspace, $srcAbsPath, $destAbsPath, $removeExisting); + + return 0; } } diff --git a/src/PHPCR/Shell/Console/Command/Phpcr/NodeCopyCommand.php b/src/PHPCR/Shell/Console/Command/Phpcr/NodeCopyCommand.php index 9b1b2979..d597197c 100644 --- a/src/PHPCR/Shell/Console/Command/Phpcr/NodeCopyCommand.php +++ b/src/PHPCR/Shell/Console/Command/Phpcr/NodeCopyCommand.php @@ -47,5 +47,7 @@ public function execute(InputInterface $input, OutputInterface $output) $workspace = $session->getWorkspace(); $workspace->copy($srcAbsPath, $destAbsPath, $srcWorkspace); + + return 0; } } diff --git a/src/PHPCR/Shell/Console/Command/Phpcr/NodeCorrespondingCommand.php b/src/PHPCR/Shell/Console/Command/Phpcr/NodeCorrespondingCommand.php index 1204d366..116c08f0 100644 --- a/src/PHPCR/Shell/Console/Command/Phpcr/NodeCorrespondingCommand.php +++ b/src/PHPCR/Shell/Console/Command/Phpcr/NodeCorrespondingCommand.php @@ -39,5 +39,7 @@ public function execute(InputInterface $input, OutputInterface $output) $currentNode = $session->getNodeByPathOrIdentifier($path); $correspondingPath = $currentNode->getCorrespondingNodePath($workspaceName); $output->writeln($correspondingPath); + + return 0; } } diff --git a/src/PHPCR/Shell/Console/Command/Phpcr/NodeCreateCommand.php b/src/PHPCR/Shell/Console/Command/Phpcr/NodeCreateCommand.php index 1151cd82..87665ec5 100644 --- a/src/PHPCR/Shell/Console/Command/Phpcr/NodeCreateCommand.php +++ b/src/PHPCR/Shell/Console/Command/Phpcr/NodeCreateCommand.php @@ -56,5 +56,7 @@ public function execute(InputInterface $input, OutputInterface $output) $nodeName = $pathHelper->getNodeName($path); $parentNode = $session->getNode($parentPath); $parentNode->addNode($nodeName, $primaryNodeTypeName); + + return 0; } } diff --git a/src/PHPCR/Shell/Console/Command/Phpcr/NodeFileImportCommand.php b/src/PHPCR/Shell/Console/Command/Phpcr/NodeFileImportCommand.php index 8d6b028c..f81f903f 100644 --- a/src/PHPCR/Shell/Console/Command/Phpcr/NodeFileImportCommand.php +++ b/src/PHPCR/Shell/Console/Command/Phpcr/NodeFileImportCommand.php @@ -105,6 +105,8 @@ public function execute(InputInterface $input, OutputInterface $output) } else { $this->importToContainer($fhandle, $mimeType, $filePath, $filename, $parentNode, $force); } + + return 0; } private function importToProperty($fhandle, $filePath, $filename, $parentNode, $force) diff --git a/src/PHPCR/Shell/Console/Command/Phpcr/NodeInfoCommand.php b/src/PHPCR/Shell/Console/Command/Phpcr/NodeInfoCommand.php index c891141e..04732afe 100644 --- a/src/PHPCR/Shell/Console/Command/Phpcr/NodeInfoCommand.php +++ b/src/PHPCR/Shell/Console/Command/Phpcr/NodeInfoCommand.php @@ -85,5 +85,7 @@ public function execute(InputInterface $input, OutputInterface $output) $table->render($output); } + + return 0; } } diff --git a/src/PHPCR/Shell/Console/Command/Phpcr/NodeLifecycleFollowCommand.php b/src/PHPCR/Shell/Console/Command/Phpcr/NodeLifecycleFollowCommand.php index cf07c7df..829b8600 100644 --- a/src/PHPCR/Shell/Console/Command/Phpcr/NodeLifecycleFollowCommand.php +++ b/src/PHPCR/Shell/Console/Command/Phpcr/NodeLifecycleFollowCommand.php @@ -48,5 +48,7 @@ public function execute(InputInterface $input, OutputInterface $output) $currentNode = $session->getNodeByPathOrIdentifier($path); $transition = $input->getArgument('transition'); $currentNode->followLifecycleTransition($transition); + + return 0; } } diff --git a/src/PHPCR/Shell/Console/Command/Phpcr/NodeLifecycleListCommand.php b/src/PHPCR/Shell/Console/Command/Phpcr/NodeLifecycleListCommand.php index 395a2af6..70d93e4c 100644 --- a/src/PHPCR/Shell/Console/Command/Phpcr/NodeLifecycleListCommand.php +++ b/src/PHPCR/Shell/Console/Command/Phpcr/NodeLifecycleListCommand.php @@ -42,5 +42,7 @@ public function execute(InputInterface $input, OutputInterface $output) foreach ($transitions as $transition) { $output->writeln(''.$transition.''); } + + return 0; } } diff --git a/src/PHPCR/Shell/Console/Command/Phpcr/NodeListCommand.php b/src/PHPCR/Shell/Console/Command/Phpcr/NodeListCommand.php index f73222d0..e3ff7425 100644 --- a/src/PHPCR/Shell/Console/Command/Phpcr/NodeListCommand.php +++ b/src/PHPCR/Shell/Console/Command/Phpcr/NodeListCommand.php @@ -140,6 +140,8 @@ public function execute(InputInterface $input, OutputInterface $output) number_format($this->time, $config['execution_time_expansion'])) ); } + + return 0; } private function renderNode($currentNode, $table, $spacers = [], $filter = null) diff --git a/src/PHPCR/Shell/Console/Command/Phpcr/NodeMixinAddCommand.php b/src/PHPCR/Shell/Console/Command/Phpcr/NodeMixinAddCommand.php index 0fd3a79e..efcb958a 100644 --- a/src/PHPCR/Shell/Console/Command/Phpcr/NodeMixinAddCommand.php +++ b/src/PHPCR/Shell/Console/Command/Phpcr/NodeMixinAddCommand.php @@ -46,5 +46,7 @@ public function execute(InputInterface $input, OutputInterface $output) foreach ($nodes as $node) { $node->addMixin($mixinName); } + + return 0; } } diff --git a/src/PHPCR/Shell/Console/Command/Phpcr/NodeMixinRemoveCommand.php b/src/PHPCR/Shell/Console/Command/Phpcr/NodeMixinRemoveCommand.php index 9122deef..c6ece3ea 100644 --- a/src/PHPCR/Shell/Console/Command/Phpcr/NodeMixinRemoveCommand.php +++ b/src/PHPCR/Shell/Console/Command/Phpcr/NodeMixinRemoveCommand.php @@ -45,5 +45,7 @@ public function execute(InputInterface $input, OutputInterface $output) foreach ($nodes as $node) { $node->removeMixin($mixinName); } + + return 0; } } diff --git a/src/PHPCR/Shell/Console/Command/Phpcr/NodeMoveCommand.php b/src/PHPCR/Shell/Console/Command/Phpcr/NodeMoveCommand.php index 31d21530..73cf3b75 100644 --- a/src/PHPCR/Shell/Console/Command/Phpcr/NodeMoveCommand.php +++ b/src/PHPCR/Shell/Console/Command/Phpcr/NodeMoveCommand.php @@ -41,5 +41,7 @@ public function execute(InputInterface $input, OutputInterface $output) $destPath = $input->getArgument('destPath'); $session->move($srcPath, $destPath); + + return 0; } } diff --git a/src/PHPCR/Shell/Console/Command/Phpcr/NodeOrderBeforeCommand.php b/src/PHPCR/Shell/Console/Command/Phpcr/NodeOrderBeforeCommand.php index e57d79c7..a8121ba0 100644 --- a/src/PHPCR/Shell/Console/Command/Phpcr/NodeOrderBeforeCommand.php +++ b/src/PHPCR/Shell/Console/Command/Phpcr/NodeOrderBeforeCommand.php @@ -47,5 +47,7 @@ public function execute(InputInterface $input, OutputInterface $output) $destChildRelPath = $input->getArgument('destChildRelPath'); $node = $session->getNodeByPathOrIdentifier($path); $node->orderBefore($srcChildRelPath, $destChildRelPath); + + return 0; } } diff --git a/src/PHPCR/Shell/Console/Command/Phpcr/NodePropertyRemoveCommand.php b/src/PHPCR/Shell/Console/Command/Phpcr/NodePropertyRemoveCommand.php index dab10f41..d13ae934 100644 --- a/src/PHPCR/Shell/Console/Command/Phpcr/NodePropertyRemoveCommand.php +++ b/src/PHPCR/Shell/Console/Command/Phpcr/NodePropertyRemoveCommand.php @@ -44,5 +44,7 @@ public function execute(InputInterface $input, OutputInterface $output) } $property->remove(); + + return 0; } } diff --git a/src/PHPCR/Shell/Console/Command/Phpcr/NodePropertySetCommand.php b/src/PHPCR/Shell/Console/Command/Phpcr/NodePropertySetCommand.php index 1cdae185..6f118338 100644 --- a/src/PHPCR/Shell/Console/Command/Phpcr/NodePropertySetCommand.php +++ b/src/PHPCR/Shell/Console/Command/Phpcr/NodePropertySetCommand.php @@ -96,5 +96,7 @@ public function execute(InputInterface $input, OutputInterface $output) $node->setProperty($propName, $value, $intType); } + + return 0; } } diff --git a/src/PHPCR/Shell/Console/Command/Phpcr/NodePropertyShowCommand.php b/src/PHPCR/Shell/Console/Command/Phpcr/NodePropertyShowCommand.php index 8416063b..53e4cd32 100644 --- a/src/PHPCR/Shell/Console/Command/Phpcr/NodePropertyShowCommand.php +++ b/src/PHPCR/Shell/Console/Command/Phpcr/NodePropertyShowCommand.php @@ -67,5 +67,7 @@ public function execute(InputInterface $input, OutputInterface $output) )); } } + + return 0; } } diff --git a/src/PHPCR/Shell/Console/Command/Phpcr/NodeReferencesCommand.php b/src/PHPCR/Shell/Console/Command/Phpcr/NodeReferencesCommand.php index 40e5c037..efdf142f 100644 --- a/src/PHPCR/Shell/Console/Command/Phpcr/NodeReferencesCommand.php +++ b/src/PHPCR/Shell/Console/Command/Phpcr/NodeReferencesCommand.php @@ -75,5 +75,7 @@ public function execute(InputInterface $input, OutputInterface $output) $table->render($output); } } + + return 0; } } diff --git a/src/PHPCR/Shell/Console/Command/Phpcr/NodeRemoveCommand.php b/src/PHPCR/Shell/Console/Command/Phpcr/NodeRemoveCommand.php index 944a20fd..919e0759 100644 --- a/src/PHPCR/Shell/Console/Command/Phpcr/NodeRemoveCommand.php +++ b/src/PHPCR/Shell/Console/Command/Phpcr/NodeRemoveCommand.php @@ -80,5 +80,7 @@ public function execute(InputInterface $input, OutputInterface $output) if (in_array($currentPath, $nodePaths)) { $session->chdir('..'); } + + return 0; } } diff --git a/src/PHPCR/Shell/Console/Command/Phpcr/NodeRenameCommand.php b/src/PHPCR/Shell/Console/Command/Phpcr/NodeRenameCommand.php index c53cfe9d..6fc753b6 100644 --- a/src/PHPCR/Shell/Console/Command/Phpcr/NodeRenameCommand.php +++ b/src/PHPCR/Shell/Console/Command/Phpcr/NodeRenameCommand.php @@ -41,5 +41,7 @@ public function execute(InputInterface $input, OutputInterface $output) $newName = $input->getArgument('newName'); $currentNode = $session->getNodeByPathOrIdentifier($path); $currentNode->rename($newName); + + return 0; } } diff --git a/src/PHPCR/Shell/Console/Command/Phpcr/NodeSetPrimaryTypeCommand.php b/src/PHPCR/Shell/Console/Command/Phpcr/NodeSetPrimaryTypeCommand.php index 98465fc0..aa825ddf 100644 --- a/src/PHPCR/Shell/Console/Command/Phpcr/NodeSetPrimaryTypeCommand.php +++ b/src/PHPCR/Shell/Console/Command/Phpcr/NodeSetPrimaryTypeCommand.php @@ -44,5 +44,7 @@ public function execute(InputInterface $input, OutputInterface $output) foreach ($nodes as $node) { $node->setPrimaryType($nodeTypeName); } + + return 0; } } diff --git a/src/PHPCR/Shell/Console/Command/Phpcr/NodeSharedShowCommand.php b/src/PHPCR/Shell/Console/Command/Phpcr/NodeSharedShowCommand.php index 50e4f9e2..e2402645 100644 --- a/src/PHPCR/Shell/Console/Command/Phpcr/NodeSharedShowCommand.php +++ b/src/PHPCR/Shell/Console/Command/Phpcr/NodeSharedShowCommand.php @@ -51,5 +51,7 @@ public function execute(InputInterface $input, OutputInterface $output) $output->writeln($sharedNode->getPath()); } } + + return 0; } } diff --git a/src/PHPCR/Shell/Console/Command/Phpcr/NodeTypeEditCommand.php b/src/PHPCR/Shell/Console/Command/Phpcr/NodeTypeEditCommand.php index c94002a8..5452daa0 100644 --- a/src/PHPCR/Shell/Console/Command/Phpcr/NodeTypeEditCommand.php +++ b/src/PHPCR/Shell/Console/Command/Phpcr/NodeTypeEditCommand.php @@ -115,5 +115,7 @@ public function execute(InputInterface $input, OutputInterface $output) $out = $res; } } while (false === $valid); + + return 0; } } diff --git a/src/PHPCR/Shell/Console/Command/Phpcr/NodeTypeListCommand.php b/src/PHPCR/Shell/Console/Command/Phpcr/NodeTypeListCommand.php index d616051e..e0b90a5a 100644 --- a/src/PHPCR/Shell/Console/Command/Phpcr/NodeTypeListCommand.php +++ b/src/PHPCR/Shell/Console/Command/Phpcr/NodeTypeListCommand.php @@ -60,5 +60,7 @@ public function execute(InputInterface $input, OutputInterface $output) } $table->render($output); + + return 0; } } diff --git a/src/PHPCR/Shell/Console/Command/Phpcr/NodeTypeLoadCommand.php b/src/PHPCR/Shell/Console/Command/Phpcr/NodeTypeLoadCommand.php index e708f9e1..608fcd18 100644 --- a/src/PHPCR/Shell/Console/Command/Phpcr/NodeTypeLoadCommand.php +++ b/src/PHPCR/Shell/Console/Command/Phpcr/NodeTypeLoadCommand.php @@ -56,5 +56,7 @@ public function execute(InputInterface $input, OutputInterface $output) $cndData = file_get_contents($cndFile); $nodeTypeManager->registerNodeTypesCnd($cndData, $update); + + return 0; } } diff --git a/src/PHPCR/Shell/Console/Command/Phpcr/NodeTypeShowCommand.php b/src/PHPCR/Shell/Console/Command/Phpcr/NodeTypeShowCommand.php index ac8b6668..361cf498 100644 --- a/src/PHPCR/Shell/Console/Command/Phpcr/NodeTypeShowCommand.php +++ b/src/PHPCR/Shell/Console/Command/Phpcr/NodeTypeShowCommand.php @@ -48,5 +48,7 @@ public function execute(InputInterface $input, OutputInterface $output) $cndWriter = new CndWriter($namespaceRegistry); $out = $cndWriter->writeString([$nodeType]); $output->writeln(sprintf('%s', $out)); + + return 0; } } diff --git a/src/PHPCR/Shell/Console/Command/Phpcr/NodeTypeUnregisterCommand.php b/src/PHPCR/Shell/Console/Command/Phpcr/NodeTypeUnregisterCommand.php index d7133532..9bb3a764 100644 --- a/src/PHPCR/Shell/Console/Command/Phpcr/NodeTypeUnregisterCommand.php +++ b/src/PHPCR/Shell/Console/Command/Phpcr/NodeTypeUnregisterCommand.php @@ -40,5 +40,7 @@ public function execute(InputInterface $input, OutputInterface $output) $nodeTypeManager = $workspace->getNodeTypeManager(); $nodeType = $nodeTypeManager->unregisterNodeTypes([$nodeTypeName]); + + return 0; } } diff --git a/src/PHPCR/Shell/Console/Command/Phpcr/NodeUpdateCommand.php b/src/PHPCR/Shell/Console/Command/Phpcr/NodeUpdateCommand.php index 64de3f34..9783b313 100644 --- a/src/PHPCR/Shell/Console/Command/Phpcr/NodeUpdateCommand.php +++ b/src/PHPCR/Shell/Console/Command/Phpcr/NodeUpdateCommand.php @@ -56,5 +56,7 @@ public function execute(InputInterface $input, OutputInterface $output) $output->writeln(''.$node->getPath().''); $node->update($srcWorkspace); } + + return 0; } } diff --git a/src/PHPCR/Shell/Console/Command/Phpcr/QueryCommand.php b/src/PHPCR/Shell/Console/Command/Phpcr/QueryCommand.php index 5bf410f8..3c209aea 100644 --- a/src/PHPCR/Shell/Console/Command/Phpcr/QueryCommand.php +++ b/src/PHPCR/Shell/Console/Command/Phpcr/QueryCommand.php @@ -72,5 +72,7 @@ public function execute(InputInterface $input, OutputInterface $output) $elapsed = microtime(true) - $start; $this->get('helper.result_formatter')->formatQueryResult($result, $output, $elapsed); + + return 0; } } diff --git a/src/PHPCR/Shell/Console/Command/Phpcr/QueryDeleteCommand.php b/src/PHPCR/Shell/Console/Command/Phpcr/QueryDeleteCommand.php index e9aaedc0..88695a2b 100644 --- a/src/PHPCR/Shell/Console/Command/Phpcr/QueryDeleteCommand.php +++ b/src/PHPCR/Shell/Console/Command/Phpcr/QueryDeleteCommand.php @@ -66,5 +66,7 @@ public function execute(InputInterface $input, OutputInterface $output) $elapsed = microtime(true) - $start; $output->writeln(sprintf('%s row(s) affected in %ss', $rows, number_format($elapsed, 2))); + + return 0; } } diff --git a/src/PHPCR/Shell/Console/Command/Phpcr/QuerySelectCommand.php b/src/PHPCR/Shell/Console/Command/Phpcr/QuerySelectCommand.php index 47e10e39..ac338442 100644 --- a/src/PHPCR/Shell/Console/Command/Phpcr/QuerySelectCommand.php +++ b/src/PHPCR/Shell/Console/Command/Phpcr/QuerySelectCommand.php @@ -47,5 +47,7 @@ public function execute(InputInterface $input, OutputInterface $output) $elapsed = microtime(true) - $start; $this->get('helper.result_formatter')->formatQueryResult($result, $output, $elapsed); + + return 0; } } diff --git a/src/PHPCR/Shell/Console/Command/Phpcr/QueryUpdateCommand.php b/src/PHPCR/Shell/Console/Command/Phpcr/QueryUpdateCommand.php index d926e7cb..408aee6c 100644 --- a/src/PHPCR/Shell/Console/Command/Phpcr/QueryUpdateCommand.php +++ b/src/PHPCR/Shell/Console/Command/Phpcr/QueryUpdateCommand.php @@ -99,5 +99,7 @@ public function execute(InputInterface $input, OutputInterface $output) $elapsed = microtime(true) - $start; $output->writeln(sprintf('%s row(s) affected in %ss', $rows, number_format($elapsed, 2))); + + return 0; } } diff --git a/src/PHPCR/Shell/Console/Command/Phpcr/RepositoryDescriptorListCommand.php b/src/PHPCR/Shell/Console/Command/Phpcr/RepositoryDescriptorListCommand.php index 609e842d..9262d32f 100644 --- a/src/PHPCR/Shell/Console/Command/Phpcr/RepositoryDescriptorListCommand.php +++ b/src/PHPCR/Shell/Console/Command/Phpcr/RepositoryDescriptorListCommand.php @@ -52,6 +52,8 @@ public function execute(InputInterface $input, OutputInterface $output) } $table->render($output); + + return 0; } private function getDescriptorValue($value) diff --git a/src/PHPCR/Shell/Console/Command/Phpcr/RetentionHoldAddCommand.php b/src/PHPCR/Shell/Console/Command/Phpcr/RetentionHoldAddCommand.php index 00907b7b..71be906d 100644 --- a/src/PHPCR/Shell/Console/Command/Phpcr/RetentionHoldAddCommand.php +++ b/src/PHPCR/Shell/Console/Command/Phpcr/RetentionHoldAddCommand.php @@ -49,5 +49,7 @@ public function execute(InputInterface $input, OutputInterface $output) $name = $input->getArgument('name'); $retentionManager->addHold($absPath, $name, $isDeep); + + return 0; } } diff --git a/src/PHPCR/Shell/Console/Command/Phpcr/RetentionHoldListCommand.php b/src/PHPCR/Shell/Console/Command/Phpcr/RetentionHoldListCommand.php index 8f75997e..f7a3b7db 100644 --- a/src/PHPCR/Shell/Console/Command/Phpcr/RetentionHoldListCommand.php +++ b/src/PHPCR/Shell/Console/Command/Phpcr/RetentionHoldListCommand.php @@ -49,5 +49,7 @@ public function execute(InputInterface $input, OutputInterface $output) } $table->render($output); + + return 0; } } diff --git a/src/PHPCR/Shell/Console/Command/Phpcr/RetentionHoldRemoveCommand.php b/src/PHPCR/Shell/Console/Command/Phpcr/RetentionHoldRemoveCommand.php index 74e13ff7..f9b6eb8b 100644 --- a/src/PHPCR/Shell/Console/Command/Phpcr/RetentionHoldRemoveCommand.php +++ b/src/PHPCR/Shell/Console/Command/Phpcr/RetentionHoldRemoveCommand.php @@ -56,5 +56,7 @@ public function execute(InputInterface $input, OutputInterface $output) } $retentionManager->removeHold($absPath, $indexed[$name]); + + return 0; } } diff --git a/src/PHPCR/Shell/Console/Command/Phpcr/RetentionPolicyGetCommand.php b/src/PHPCR/Shell/Console/Command/Phpcr/RetentionPolicyGetCommand.php index d7ed9a0b..74ab5d15 100644 --- a/src/PHPCR/Shell/Console/Command/Phpcr/RetentionPolicyGetCommand.php +++ b/src/PHPCR/Shell/Console/Command/Phpcr/RetentionPolicyGetCommand.php @@ -44,5 +44,7 @@ public function execute(InputInterface $input, OutputInterface $output) } else { $output->writeln($policy->getName()); } + + return 0; } } diff --git a/src/PHPCR/Shell/Console/Command/Phpcr/RetentionPolicyRemoveCommand.php b/src/PHPCR/Shell/Console/Command/Phpcr/RetentionPolicyRemoveCommand.php index a5149c87..15a42b7b 100644 --- a/src/PHPCR/Shell/Console/Command/Phpcr/RetentionPolicyRemoveCommand.php +++ b/src/PHPCR/Shell/Console/Command/Phpcr/RetentionPolicyRemoveCommand.php @@ -44,5 +44,7 @@ public function execute(InputInterface $input, OutputInterface $output) } else { $output->writeln($policy->remove()); } + + return 0; } } diff --git a/src/PHPCR/Shell/Console/Command/Phpcr/SessionExportCommand.php b/src/PHPCR/Shell/Console/Command/Phpcr/SessionExportCommand.php index 18eef323..b7158e60 100644 --- a/src/PHPCR/Shell/Console/Command/Phpcr/SessionExportCommand.php +++ b/src/PHPCR/Shell/Console/Command/Phpcr/SessionExportCommand.php @@ -69,7 +69,7 @@ public function execute(InputInterface $input, OutputInterface $output) } if (false === $confirmed) { - return; + return 0; } } @@ -102,5 +102,7 @@ public function execute(InputInterface $input, OutputInterface $output) $xml->formatOutput = true; $xml->save($file); } + + return 0; } } diff --git a/src/PHPCR/Shell/Console/Command/Phpcr/SessionImpersonateCommand.php b/src/PHPCR/Shell/Console/Command/Phpcr/SessionImpersonateCommand.php index 0dc80871..7d9164ed 100644 --- a/src/PHPCR/Shell/Console/Command/Phpcr/SessionImpersonateCommand.php +++ b/src/PHPCR/Shell/Console/Command/Phpcr/SessionImpersonateCommand.php @@ -42,5 +42,7 @@ public function execute(InputInterface $input, OutputInterface $output) $credentials = new SimpleCredentials($username, ''); $session->impersonate($credentials); + + return 0; } } diff --git a/src/PHPCR/Shell/Console/Command/Phpcr/SessionImportCommand.php b/src/PHPCR/Shell/Console/Command/Phpcr/SessionImportCommand.php index 72b238f0..a34d713c 100644 --- a/src/PHPCR/Shell/Console/Command/Phpcr/SessionImportCommand.php +++ b/src/PHPCR/Shell/Console/Command/Phpcr/SessionImportCommand.php @@ -104,5 +104,7 @@ public function execute(InputInterface $input, OutputInterface $output) $uuidBehavior = constant('\PHPCR\ImportUUIDBehaviorInterface::IMPORT_UUID_'.strtoupper(str_replace('-', '_', $uuidBehavior))); $session->importXml($parentAbsPath, $file, $uuidBehavior); + + return 0; } } diff --git a/src/PHPCR/Shell/Console/Command/Phpcr/SessionInfoCommand.php b/src/PHPCR/Shell/Console/Command/Phpcr/SessionInfoCommand.php index dc784760..c69c37c9 100644 --- a/src/PHPCR/Shell/Console/Command/Phpcr/SessionInfoCommand.php +++ b/src/PHPCR/Shell/Console/Command/Phpcr/SessionInfoCommand.php @@ -54,5 +54,7 @@ public function execute(InputInterface $input, OutputInterface $output) } $table->render($output); + + return 0; } } diff --git a/src/PHPCR/Shell/Console/Command/Phpcr/SessionLoginCommand.php b/src/PHPCR/Shell/Console/Command/Phpcr/SessionLoginCommand.php index b11c6493..5f098ff9 100644 --- a/src/PHPCR/Shell/Console/Command/Phpcr/SessionLoginCommand.php +++ b/src/PHPCR/Shell/Console/Command/Phpcr/SessionLoginCommand.php @@ -37,5 +37,7 @@ public function execute(InputInterface $input, OutputInterface $output) $password = $input->getArgument('password'); $workspaceName = $input->getArgument('workspaceName'); $this->get('phpcr.session_manager')->relogin($username, $password, $workspaceName); + + return 0; } } diff --git a/src/PHPCR/Shell/Console/Command/Phpcr/SessionLogoutCommand.php b/src/PHPCR/Shell/Console/Command/Phpcr/SessionLogoutCommand.php index 2c7e2f2c..91f7c17a 100644 --- a/src/PHPCR/Shell/Console/Command/Phpcr/SessionLogoutCommand.php +++ b/src/PHPCR/Shell/Console/Command/Phpcr/SessionLogoutCommand.php @@ -33,5 +33,7 @@ public function execute(InputInterface $input, OutputInterface $output) { $session = $this->get('phpcr.session'); $session->logout(); + + return 0; } } diff --git a/src/PHPCR/Shell/Console/Command/Phpcr/SessionNamespaceListCommand.php b/src/PHPCR/Shell/Console/Command/Phpcr/SessionNamespaceListCommand.php index c0abaf03..74c97848 100644 --- a/src/PHPCR/Shell/Console/Command/Phpcr/SessionNamespaceListCommand.php +++ b/src/PHPCR/Shell/Console/Command/Phpcr/SessionNamespaceListCommand.php @@ -42,5 +42,7 @@ public function execute(InputInterface $input, OutputInterface $output) } $table->render($output); + + return 0; } } diff --git a/src/PHPCR/Shell/Console/Command/Phpcr/SessionNamespaceSetCommand.php b/src/PHPCR/Shell/Console/Command/Phpcr/SessionNamespaceSetCommand.php index 1a9b7293..61e42108 100644 --- a/src/PHPCR/Shell/Console/Command/Phpcr/SessionNamespaceSetCommand.php +++ b/src/PHPCR/Shell/Console/Command/Phpcr/SessionNamespaceSetCommand.php @@ -44,5 +44,7 @@ public function execute(InputInterface $input, OutputInterface $output) $uri = $input->getArgument('uri'); $session->setNamespacePrefix($prefix, $uri); + + return 0; } } diff --git a/src/PHPCR/Shell/Console/Command/Phpcr/SessionRefreshCommand.php b/src/PHPCR/Shell/Console/Command/Phpcr/SessionRefreshCommand.php index a1ef575f..12cdb316 100644 --- a/src/PHPCR/Shell/Console/Command/Phpcr/SessionRefreshCommand.php +++ b/src/PHPCR/Shell/Console/Command/Phpcr/SessionRefreshCommand.php @@ -43,5 +43,7 @@ public function execute(InputInterface $input, OutputInterface $output) $keepChanges = $input->getOption('keep-changes'); $session->refresh($keepChanges); + + return 0; } } diff --git a/src/PHPCR/Shell/Console/Command/Phpcr/SessionSaveCommand.php b/src/PHPCR/Shell/Console/Command/Phpcr/SessionSaveCommand.php index 79ca1c4f..00b3d261 100644 --- a/src/PHPCR/Shell/Console/Command/Phpcr/SessionSaveCommand.php +++ b/src/PHPCR/Shell/Console/Command/Phpcr/SessionSaveCommand.php @@ -45,5 +45,7 @@ public function execute(InputInterface $input, OutputInterface $output) $session = $this->get('phpcr.session'); $session->save(); + + return 0; } } diff --git a/src/PHPCR/Shell/Console/Command/Phpcr/VersionCheckinCommand.php b/src/PHPCR/Shell/Console/Command/Phpcr/VersionCheckinCommand.php index 5e6d3b7f..766121d3 100644 --- a/src/PHPCR/Shell/Console/Command/Phpcr/VersionCheckinCommand.php +++ b/src/PHPCR/Shell/Console/Command/Phpcr/VersionCheckinCommand.php @@ -72,5 +72,7 @@ public function execute(InputInterface $input, OutputInterface $output) $version = $versionManager->checkin($node->getPath()); $output->writeln('Version: '.$version->getName()); + + return 0; } } diff --git a/src/PHPCR/Shell/Console/Command/Phpcr/VersionCheckoutCommand.php b/src/PHPCR/Shell/Console/Command/Phpcr/VersionCheckoutCommand.php index 991d3824..74f609c4 100644 --- a/src/PHPCR/Shell/Console/Command/Phpcr/VersionCheckoutCommand.php +++ b/src/PHPCR/Shell/Console/Command/Phpcr/VersionCheckoutCommand.php @@ -56,5 +56,7 @@ public function execute(InputInterface $input, OutputInterface $output) $versionManager = $workspace->getVersionManager(); $version = $versionManager->checkout($node->getPath()); + + return 0; } } diff --git a/src/PHPCR/Shell/Console/Command/Phpcr/VersionCheckpointCommand.php b/src/PHPCR/Shell/Console/Command/Phpcr/VersionCheckpointCommand.php index c4a6171c..8c5e98e7 100644 --- a/src/PHPCR/Shell/Console/Command/Phpcr/VersionCheckpointCommand.php +++ b/src/PHPCR/Shell/Console/Command/Phpcr/VersionCheckpointCommand.php @@ -47,5 +47,7 @@ public function execute(InputInterface $input, OutputInterface $output) $version = $versionManager->checkpoint($node->getPath()); $output->writeln('Version: '.$version->getName()); + + return 0; } } diff --git a/src/PHPCR/Shell/Console/Command/Phpcr/VersionHistoryCommand.php b/src/PHPCR/Shell/Console/Command/Phpcr/VersionHistoryCommand.php index 52c3fd5e..8689c957 100644 --- a/src/PHPCR/Shell/Console/Command/Phpcr/VersionHistoryCommand.php +++ b/src/PHPCR/Shell/Console/Command/Phpcr/VersionHistoryCommand.php @@ -59,5 +59,7 @@ public function execute(InputInterface $input, OutputInterface $output) } $table->render($output); + + return 0; } } diff --git a/src/PHPCR/Shell/Console/Command/Phpcr/VersionRemoveCommand.php b/src/PHPCR/Shell/Console/Command/Phpcr/VersionRemoveCommand.php index 079c14f6..5b0fcc56 100644 --- a/src/PHPCR/Shell/Console/Command/Phpcr/VersionRemoveCommand.php +++ b/src/PHPCR/Shell/Console/Command/Phpcr/VersionRemoveCommand.php @@ -61,5 +61,7 @@ public function execute(InputInterface $input, OutputInterface $output) $history = $versionManager->getVersionHistory($node->getPath()); $history->removeVersion($versionName); + + return 0; } } diff --git a/src/PHPCR/Shell/Console/Command/Phpcr/VersionRestoreCommand.php b/src/PHPCR/Shell/Console/Command/Phpcr/VersionRestoreCommand.php index c506d165..123cc9fd 100644 --- a/src/PHPCR/Shell/Console/Command/Phpcr/VersionRestoreCommand.php +++ b/src/PHPCR/Shell/Console/Command/Phpcr/VersionRestoreCommand.php @@ -54,5 +54,7 @@ public function execute(InputInterface $input, OutputInterface $output) $workspace = $session->getWorkspace(); $versionManager = $workspace->getVersionManager(); $versionManager->restore($removeExisting, $versionName, $node->getPath()); + + return 0; } } diff --git a/src/PHPCR/Shell/Console/Command/Phpcr/WorkspaceCreateCommand.php b/src/PHPCR/Shell/Console/Command/Phpcr/WorkspaceCreateCommand.php index aca0ae70..c07bab08 100644 --- a/src/PHPCR/Shell/Console/Command/Phpcr/WorkspaceCreateCommand.php +++ b/src/PHPCR/Shell/Console/Command/Phpcr/WorkspaceCreateCommand.php @@ -45,5 +45,7 @@ public function execute(InputInterface $input, OutputInterface $output) $workspace = $session->getWorkspace(); $workspace->createWorkspace($name, $srcWorkspace); + + return 0; } } diff --git a/src/PHPCR/Shell/Console/Command/Phpcr/WorkspaceDeleteCommand.php b/src/PHPCR/Shell/Console/Command/Phpcr/WorkspaceDeleteCommand.php index ad50ddce..4a8862c9 100644 --- a/src/PHPCR/Shell/Console/Command/Phpcr/WorkspaceDeleteCommand.php +++ b/src/PHPCR/Shell/Console/Command/Phpcr/WorkspaceDeleteCommand.php @@ -38,5 +38,7 @@ public function execute(InputInterface $input, OutputInterface $output) $workspace = $session->getWorkspace(); $workspace->deleteWorkspace($name); + + return 0; } } diff --git a/src/PHPCR/Shell/Console/Command/Phpcr/WorkspaceListCommand.php b/src/PHPCR/Shell/Console/Command/Phpcr/WorkspaceListCommand.php index 647e6d2b..650306da 100644 --- a/src/PHPCR/Shell/Console/Command/Phpcr/WorkspaceListCommand.php +++ b/src/PHPCR/Shell/Console/Command/Phpcr/WorkspaceListCommand.php @@ -56,5 +56,7 @@ public function execute(InputInterface $input, OutputInterface $output) } $table->render($output); + + return 0; } } diff --git a/src/PHPCR/Shell/Console/Command/Phpcr/WorkspaceNamespaceListCommand.php b/src/PHPCR/Shell/Console/Command/Phpcr/WorkspaceNamespaceListCommand.php index d979ab95..8cb0e71f 100644 --- a/src/PHPCR/Shell/Console/Command/Phpcr/WorkspaceNamespaceListCommand.php +++ b/src/PHPCR/Shell/Console/Command/Phpcr/WorkspaceNamespaceListCommand.php @@ -45,5 +45,7 @@ public function execute(InputInterface $input, OutputInterface $output) } $table->render($output); + + return 0; } } diff --git a/src/PHPCR/Shell/Console/Command/Phpcr/WorkspaceNamespaceRegisterCommand.php b/src/PHPCR/Shell/Console/Command/Phpcr/WorkspaceNamespaceRegisterCommand.php index cc4c8b86..1e9ad49a 100644 --- a/src/PHPCR/Shell/Console/Command/Phpcr/WorkspaceNamespaceRegisterCommand.php +++ b/src/PHPCR/Shell/Console/Command/Phpcr/WorkspaceNamespaceRegisterCommand.php @@ -40,5 +40,7 @@ public function execute(InputInterface $input, OutputInterface $output) $uri = $input->getArgument('uri'); $namespaceRegistry->registerNamespace($prefix, $uri); + + return 0; } } diff --git a/src/PHPCR/Shell/Console/Command/Phpcr/WorkspaceNamespaceUnregisterCommand.php b/src/PHPCR/Shell/Console/Command/Phpcr/WorkspaceNamespaceUnregisterCommand.php index 7282735e..b8363812 100644 --- a/src/PHPCR/Shell/Console/Command/Phpcr/WorkspaceNamespaceUnregisterCommand.php +++ b/src/PHPCR/Shell/Console/Command/Phpcr/WorkspaceNamespaceUnregisterCommand.php @@ -48,5 +48,7 @@ public function execute(InputInterface $input, OutputInterface $output) $uri = $input->getArgument('uri'); $namespaceRegistry->unregisterNamespaceByURI($uri); + + return 0; } } diff --git a/src/PHPCR/Shell/Console/Command/Phpcr/WorkspaceUseCommand.php b/src/PHPCR/Shell/Console/Command/Phpcr/WorkspaceUseCommand.php index b42c02eb..54dd8866 100644 --- a/src/PHPCR/Shell/Console/Command/Phpcr/WorkspaceUseCommand.php +++ b/src/PHPCR/Shell/Console/Command/Phpcr/WorkspaceUseCommand.php @@ -34,5 +34,7 @@ public function execute(InputInterface $input, OutputInterface $output) { $workspaceName = $input->getArgument('name'); $this->get('phpcr.session_manager')->changeWorkspace($workspaceName); + + return 0; } } diff --git a/src/PHPCR/Shell/Console/Command/Shell/AliasListCommand.php b/src/PHPCR/Shell/Console/Command/Shell/AliasListCommand.php index dd6c6eaf..c09b2a5d 100644 --- a/src/PHPCR/Shell/Console/Command/Shell/AliasListCommand.php +++ b/src/PHPCR/Shell/Console/Command/Shell/AliasListCommand.php @@ -42,5 +42,7 @@ public function execute(InputInterface $input, OutputInterface $output) } $table->render($output); + + return 0; } } diff --git a/src/PHPCR/Shell/Console/Command/Shell/ClearCommand.php b/src/PHPCR/Shell/Console/Command/Shell/ClearCommand.php index f98925b4..10debe72 100644 --- a/src/PHPCR/Shell/Console/Command/Shell/ClearCommand.php +++ b/src/PHPCR/Shell/Console/Command/Shell/ClearCommand.php @@ -31,5 +31,7 @@ public function configure() public function execute(InputInterface $input, OutputInterface $output) { $output->write("\033[2J\033[;H"); + + return 0; } } diff --git a/src/PHPCR/Shell/Console/Command/Shell/ConfigInitCommand.php b/src/PHPCR/Shell/Console/Command/Shell/ConfigInitCommand.php index 8f797752..c042e543 100644 --- a/src/PHPCR/Shell/Console/Command/Shell/ConfigInitCommand.php +++ b/src/PHPCR/Shell/Console/Command/Shell/ConfigInitCommand.php @@ -35,5 +35,7 @@ public function execute(InputInterface $input, OutputInterface $output) $this->output = $output; $configHelper = $this->get('config.manager'); $configHelper->initConfig($output); + + return 0; } } diff --git a/src/PHPCR/Shell/Console/Command/Shell/ConfigReloadCommand.php b/src/PHPCR/Shell/Console/Command/Shell/ConfigReloadCommand.php index 419c8199..189c9161 100644 --- a/src/PHPCR/Shell/Console/Command/Shell/ConfigReloadCommand.php +++ b/src/PHPCR/Shell/Console/Command/Shell/ConfigReloadCommand.php @@ -35,5 +35,7 @@ public function execute(InputInterface $input, OutputInterface $output) $this->output = $output; $config = $this->get('config.manager'); $config->loadConfig(); + + return 0; } } diff --git a/src/PHPCR/Shell/Console/Command/Shell/ExitCommand.php b/src/PHPCR/Shell/Console/Command/Shell/ExitCommand.php index 065a01d3..d500d6f2 100644 --- a/src/PHPCR/Shell/Console/Command/Shell/ExitCommand.php +++ b/src/PHPCR/Shell/Console/Command/Shell/ExitCommand.php @@ -38,7 +38,7 @@ public function execute(InputInterface $input, OutputInterface $output) } if (false === $res) { - return; + return 0; } } diff --git a/src/PHPCR/Shell/Console/Command/Shell/PathChangeCommand.php b/src/PHPCR/Shell/Console/Command/Shell/PathChangeCommand.php index 62326cce..fe9f3a4d 100644 --- a/src/PHPCR/Shell/Console/Command/Shell/PathChangeCommand.php +++ b/src/PHPCR/Shell/Console/Command/Shell/PathChangeCommand.php @@ -37,5 +37,7 @@ public function execute(InputInterface $input, OutputInterface $output) } catch (PathNotFoundException $e) { $output->writeln(''.$e->getMessage().''); } + + return 0; } } diff --git a/src/PHPCR/Shell/Console/Command/Shell/PathShowCommand.php b/src/PHPCR/Shell/Console/Command/Shell/PathShowCommand.php index 52c79ece..f4287c52 100644 --- a/src/PHPCR/Shell/Console/Command/Shell/PathShowCommand.php +++ b/src/PHPCR/Shell/Console/Command/Shell/PathShowCommand.php @@ -29,5 +29,7 @@ public function execute(InputInterface $input, OutputInterface $output) $output->writeln( ''.$this->get('phpcr.session')->getCwd().'' ); + + return 0; } } diff --git a/src/PHPCR/Shell/Console/Command/Shell/ProfileShowCommand.php b/src/PHPCR/Shell/Console/Command/Shell/ProfileShowCommand.php index a7da5a8f..3efb4bf2 100644 --- a/src/PHPCR/Shell/Console/Command/Shell/ProfileShowCommand.php +++ b/src/PHPCR/Shell/Console/Command/Shell/ProfileShowCommand.php @@ -55,5 +55,7 @@ public function execute(InputInterface $input, OutputInterface $output) } $table->render($output); } + + return 0; } } diff --git a/src/PHPCR/Shell/Console/Command/ShellCommand.php b/src/PHPCR/Shell/Console/Command/ShellCommand.php index 32b94a15..7e419b34 100644 --- a/src/PHPCR/Shell/Console/Command/ShellCommand.php +++ b/src/PHPCR/Shell/Console/Command/ShellCommand.php @@ -106,7 +106,7 @@ public function execute(InputInterface $input, OutputInterface $output) $application->run($input, $output); } - return; + return 0; } else { $application = new Shell($this->application); } @@ -116,5 +116,7 @@ public function execute(InputInterface $input, OutputInterface $output) } $application->run($output); + + return 0; } } From 19675e86dff3afdaf6628fb9b921ed6605c6514f Mon Sep 17 00:00:00 2001 From: Alexander Schranz Date: Thu, 6 Feb 2020 13:22:03 +0100 Subject: [PATCH 09/17] Update dependencies to symfony 5 --- composer.json | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/composer.json b/composer.json index 3854e909..3ef87aaa 100644 --- a/composer.json +++ b/composer.json @@ -2,25 +2,25 @@ "name": "phpcr/phpcr-shell", "description": "Shell for PHPCR", "require": { - "php": "^5.6|^7.0", - "symfony/console": "~2.8|~3.0|~4.0|~5.0", - "jackalope/jackalope": "~1.1", + "php": "^7.2", + "symfony/console": "^5.0", + "jackalope/jackalope": "^1.1", "phpcr/phpcr": "~2.1", - "phpcr/phpcr-utils": "~1.2", - "symfony/finder": "~2.8|~3.0|~4.0|~5.0", - "symfony/serializer": "~2.8|~3.0|~4.0|~5.0", - "symfony/yaml": "~2.8|~3.0|~4.0|~5.0", - "symfony/dependency-injection": "~2.8|~3.0|~4.0|~5.0", - "symfony/expression-language": "~2.8|~3.0|~4.0|~5.0", - "dantleech/glob-finder": "~1.0" + "phpcr/phpcr-utils": "^1.2", + "symfony/finder": "^5.0", + "symfony/serializer": "^5.0", + "symfony/yaml": "^5.0", + "symfony/dependency-injection": "^5.0", + "symfony/expression-language": "^5.0", + "dantleech/glob-finder": "^1.0" }, "require-dev": { - "symfony/phpunit-bridge": "~5.0", - "symfony/symfony": "~2.8|~3.0|~4.0|~5.0", - "behat/behat": "~3.1", - "phpspec/phpspec": "~3.2|~4.0|~5.0|~6.0", - "jackalope/jackalope-doctrine-dbal": "~1.2", - "jackalope/jackalope-jackrabbit": "~1.2", + "phpunit/phpunit": "^8.5", + "symfony/symfony": "^5.0", + "behat/behat": "^3.1", + "phpspec/phpspec": "^6.0", + "jackalope/jackalope-doctrine-dbal": "^1.2", + "jackalope/jackalope-jackrabbit": "^1.2", "webmozart/assert": "^1.6" }, "suggest": { From 1b9d7e870440fbc016b5e25e94776905adfbf397 Mon Sep 17 00:00:00 2001 From: Alexander Schranz Date: Thu, 6 Feb 2020 13:25:28 +0100 Subject: [PATCH 10/17] Remove legacy dispatcher compatibility --- .../Console/Application/ShellApplication.php | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/src/PHPCR/Shell/Console/Application/ShellApplication.php b/src/PHPCR/Shell/Console/Application/ShellApplication.php index cce85ddf..1112543e 100644 --- a/src/PHPCR/Shell/Console/Application/ShellApplication.php +++ b/src/PHPCR/Shell/Console/Application/ShellApplication.php @@ -28,7 +28,6 @@ use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\DependencyInjection\ContainerAwareInterface; use Symfony\Component\EventDispatcher\EventDispatcher; -use Symfony\Component\EventDispatcher\LegacyEventDispatcherProxy; /** * Main application for PHPCRSH. @@ -100,7 +99,7 @@ public function init() $this->registerShellCommands(); $event = new ApplicationInitEvent($this); - $this->dispatch(PhpcrShellEvents::APPLICATION_INIT, $event); + $this->dispatcher->dispatch($event, PhpcrShellEvents::APPLICATION_INIT); $this->initialized = true; } @@ -247,7 +246,7 @@ public function doRun(InputInterface $input, OutputInterface $output) $name = $this->getCommandName($input); $event = new Event\CommandPreRunEvent($name, $input); - $this->dispatch(PhpcrShellEvents::COMMAND_PRE_RUN, $event); + $this->dispatcher->dispatch($event, PhpcrShellEvents::COMMAND_PRE_RUN); $input = $event->getInput(); if (!$name) { @@ -257,7 +256,7 @@ public function doRun(InputInterface $input, OutputInterface $output) try { $exitCode = parent::doRun($input, $output); } catch (\Exception $e) { - $this->dispatch(PhpcrShellEvents::COMMAND_EXCEPTION, new Event\CommandExceptionEvent($e, $this, $output)); + $this->dispatcher->dispatch(new Event\CommandExceptionEvent($e, $this, $output), PhpcrShellEvents::COMMAND_EXCEPTION); return 1; } @@ -297,7 +296,7 @@ public function add(Command $command) public function dispatchProfileInitEvent(InputInterface $sessionInput, OutputInterface $output) { $event = new Event\ProfileInitEvent($this->container->get('config.profile'), $sessionInput, $output); - $this->dispatch(PhpcrShellEvents::PROFILE_INIT, $event); + $this->dispatcher->dispatch($event, PhpcrShellEvents::PROFILE_INIT); } /** @@ -334,14 +333,4 @@ public function setDebug($debug) { $this->debug = $debug; } - - private function dispatch(string $eventName, $event) - { - // LegacyEventDispatcherProxy exists in Symfony >= 4.3 - if (class_exists(LegacyEventDispatcherProxy::class)) { - return $this->dispatcher->dispatch($event, $eventName); - } - - return $this->dispatcher->dispatch($eventName, $event); - } } From b2a273b2febf9a81cda48abf5434c309c8f99980 Mon Sep 17 00:00:00 2001 From: Alexander Schranz Date: Thu, 6 Feb 2020 13:27:49 +0100 Subject: [PATCH 11/17] Run tests only for symfony 5 and php 7.2/7.4 --- .travis.yml | 71 ++++++----------------------------------------------- 1 file changed, 7 insertions(+), 64 deletions(-) diff --git a/.travis.yml b/.travis.yml index 690dfcab..d5e14e02 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,94 +2,37 @@ language: php matrix: include: - - php: 5.6 - env: - - PREFER="--prefer-lowest" - - BEHAT_SUITE=standalone - - SYMFONY_VERSION=^2.8 - - php: 5.6 - env: - - PREFER="--prefer-lowest" - - BEHAT_SUITE=embedded - - SYMFONY_VERSION=^3.0 - - php: 5.6 - env: - - PREFER="--prefer-lowest" - - BEHAT_SUITE=cli - - SYMFONY_VERSION=^3.0 - - php: 7.0 - env: - - PREFER="" - - BEHAT_SUITE=standalone - - SYMFONY_VERSION=^2.8 - - php: 7.0 - env: - - PREFER="" - - BEHAT_SUITE=embedded - - SYMFONY_VERSION=^3.0 - - php: 7.0 - env: - - PREFER="" - - BEHAT_SUITE=cli - - SYMFONY_VERSION=^3.0 - - php: 7.1 - env: - - PREFER="" - - BEHAT_SUITE=standalone - - SYMFONY_VERSION=^2.8 - - php: 7.1 - env: - - PREFER="" - - BEHAT_SUITE=embedded - - SYMFONY_VERSION=^3.4 - - php: 7.1 - env: - - PREFER="" - - BEHAT_SUITE=cli - - SYMFONY_VERSION=^4.0 - php: 7.2 env: - - PREFER="" + - PREFER="--prefer-lowest" - BEHAT_SUITE=standalone - - SYMFONY_VERSION=^2.8 - php: 7.2 env: - - PREFER="" + - PREFER="--prefer-lowest" - BEHAT_SUITE=embedded - - SYMFONY_VERSION=^3.0 - php: 7.2 env: - - PREFER="" + - PREFER="--prefer-lowest" - BEHAT_SUITE=cli - - SYMFONY_VERSION=^4.0 - - php: 7.3 + - php: 7.4 env: - PREFER="" - BEHAT_SUITE=standalone - - SYMFONY_VERSION=^2.8 - - php: 7.3 - env: - - PREFER="" - - BEHAT_SUITE=embedded - - SYMFONY_VERSION=^3.0 - - php: 7.3 + - php: 7.4 env: - PREFER="" - BEHAT_SUITE=embedded - - SYMFONY_VERSION=^4.0 - - php: 7.3 + - php: 7.4 env: - PREFER="" - BEHAT_SUITE=cli - - SYMFONY_VERSION=^5.0 before_script: - composer self-update - - composer require "symfony/symfony" "$SYMFONY_VERSION" --no-update - composer update $PREFER - bash tests/bin/travis_jackrabbit.sh -script: +script: - vendor/bin/simple-phpunit - php vendor/bin/phpspec run - php vendor/behat/behat/bin/behat --suite=$BEHAT_SUITE From 5fb6b4fb5fc62176f83238cf3f3858cc57f0778a Mon Sep 17 00:00:00 2001 From: Alexander Schranz Date: Thu, 6 Feb 2020 13:29:26 +0100 Subject: [PATCH 12/17] Revert "Use webmozart assert in behat tests" This reverts commit 54cc4d508046faf67da11cbd74ac5dd7340019e2. Conflicts: composer.json --- composer.json | 3 +- src/PHPCR/Shell/Test/CliContext.php | 3 +- src/PHPCR/Shell/Test/ContextBase.php | 45 ++++++++++++++-------------- 3 files changed, 24 insertions(+), 27 deletions(-) diff --git a/composer.json b/composer.json index 3ef87aaa..d316a80e 100644 --- a/composer.json +++ b/composer.json @@ -20,8 +20,7 @@ "behat/behat": "^3.1", "phpspec/phpspec": "^6.0", "jackalope/jackalope-doctrine-dbal": "^1.2", - "jackalope/jackalope-jackrabbit": "^1.2", - "webmozart/assert": "^1.6" + "jackalope/jackalope-jackrabbit": "^1.2" }, "suggest": { "jackalope/jackalope-doctrine-dbal": "To connect to jackalope doctrine-dbal", diff --git a/src/PHPCR/Shell/Test/CliContext.php b/src/PHPCR/Shell/Test/CliContext.php index 95748a26..5c0b1923 100644 --- a/src/PHPCR/Shell/Test/CliContext.php +++ b/src/PHPCR/Shell/Test/CliContext.php @@ -16,7 +16,6 @@ use Behat\Behat\Context\SnippetAcceptingContext; use Behat\Gherkin\Node\PyStringNode; use Symfony\Component\Filesystem\Filesystem; -use Webmozart\Assert\Assert; /** * Features context. @@ -113,6 +112,6 @@ public function initializeDoctrineDbal() */ public function theCommandShouldNotFail() { - Assert::eq(0, $this->lastExitCode); + \PHPUnit_Framework_Assert::assertEquals(0, $this->lastExitCode); } } diff --git a/src/PHPCR/Shell/Test/ContextBase.php b/src/PHPCR/Shell/Test/ContextBase.php index e27f058b..8385fe86 100644 --- a/src/PHPCR/Shell/Test/ContextBase.php +++ b/src/PHPCR/Shell/Test/ContextBase.php @@ -25,7 +25,6 @@ use PHPCR\Util\NodeHelper; use PHPCR\Util\PathHelper; use Symfony\Component\Filesystem\Filesystem; -use Webmozart\Assert\Assert; /** * Features context. @@ -200,7 +199,7 @@ public function iShouldSeeATableContainingTheFollowingRows(TableNode $table) } } - Assert::greaterThanEq(count($expectedRows), $foundRows, $this->getOutput()); + \PHPUnit_Framework_Assert::assertGreaterThanOrEqual(count($expectedRows), $foundRows, $this->getOutput()); } /** @@ -209,7 +208,7 @@ public function iShouldSeeATableContainingTheFollowingRows(TableNode $table) public function iShouldSeeTheFollowing(PyStringNode $string) { $output = $this->getOutput(); - Assert::contains($string->getRaw(), $output); + \PHPUnit_Framework_Assert::assertContains($string->getRaw(), $output); } /** @@ -218,7 +217,7 @@ public function iShouldSeeTheFollowing(PyStringNode $string) public function iShouldNotSeeTheFollowing(PyStringNode $string) { $output = $this->getOutput(); - Assert::notContains($string->getRaw(), $output); + \PHPUnit_Framework_Assert::assertNotContains($string->getRaw(), $output); } /** @@ -249,7 +248,7 @@ public function theCommandShouldNotFail() throw new \Exception('Command failed: ('.$exitCode.') '.$this->getOutput()); } - Assert::eq(0, $exitCode, 'Command exited with code: '.$exitCode); + \PHPUnit_Framework_Assert::assertEquals(0, $exitCode, 'Command exited with code: '.$exitCode); } /** @@ -259,7 +258,7 @@ public function theCommandShouldFail() { $exitCode = $this->applicationTester->getLastExitCode(); - Assert::notEq(0, $exitCode, 'Command exited with code '.$exitCode); + \PHPUnit_Framework_Assert::assertNotEquals(0, $exitCode, 'Command exited with code '.$exitCode); } /** @@ -270,7 +269,7 @@ public function theCommandShouldFailWithMessage($arg1) $exitCode = $this->applicationTester->getLastExitCode(); $output = $this->getOutput(); - Assert::eq($arg1, $output); + \PHPUnit_Framework_Assert::assertEquals($arg1, $output); } /** @@ -278,7 +277,7 @@ public function theCommandShouldFailWithMessage($arg1) */ public function theFileShouldExist($arg1) { - Assert::true(file_exists($this->getWorkingFilePath($arg1))); + \PHPUnit_Framework_Assert::assertTrue(file_exists($this->getWorkingFilePath($arg1))); } /** @@ -305,7 +304,7 @@ public function theFileExists($arg1) public function theOutputShouldContain(PyStringNode $string) { foreach ($string->getStrings() as $line) { - Assert::contains($line, $this->getOutput()); + \PHPUnit_Framework_Assert::assertContains($line, $this->getOutput()); } } @@ -316,7 +315,7 @@ public function theNodeShouldNotExist($arg1) { $session = $this->getSession(); $node = $session->getNode($arg1); - Assert::null($node); + \PHPUnit_Framework_Assert::assertNull($node); } /** @@ -327,7 +326,7 @@ public function theXpathCountIsInFile($arg1, $arg2, $arg3) $xpath = $this->getXPathForFile($arg3); $res = $xpath->query($arg1); - Assert::eq($arg2, $res->length); + \PHPUnit_Framework_Assert::assertEquals($arg2, $res->length); } /** @@ -364,7 +363,7 @@ public function iShouldNotBeLoggedIntoTheSession() { $this->executeCommand('session:info'); $output = $this->getOutput(); - Assert::regex('/live .*no/', $output); + \PHPUnit_Framework_Assert::assertRegExp('/live .*no/', $output); } /** @@ -428,7 +427,7 @@ public function thereShouldExistANodeAtBefore($arg1, $arg2) throw new \Exception('Could not find child node '.$arg1); } - Assert::eq($arg2, $afterNode->getPath()); + \PHPUnit_Framework_Assert::assertEquals($arg2, $afterNode->getPath()); } /** @@ -531,7 +530,7 @@ public function thenIShouldBeLoggedInAs($arg1) $session = $this->getSession(); $userId = $session->getUserID(); - Assert::eq($userId, $arg1); + \PHPUnit_Framework_Assert::assertEquals($userId, $arg1); } /** @@ -691,7 +690,7 @@ public function theCurrentNodeShouldBe($arg1) { $this->executeCommand('shell:path:show'); $cnp = $this->applicationTester->getLastLine(); - Assert::eq($arg1, $cnp, 'Current path is '.$arg1); + \PHPUnit_Framework_Assert::assertEquals($arg1, $cnp, 'Current path is '.$arg1); } /** @@ -729,7 +728,7 @@ public function thePrimaryTypeOfShouldBe($arg1, $arg2) $session = $this->getSession(); $node = $session->getNode($arg1); $primaryTypeName = $node->getPrimaryNodeType()->getName(); - Assert::eq($arg2, $primaryTypeName, 'Node type of '.$arg1.' is '.$arg2); + \PHPUnit_Framework_Assert::assertEquals($arg2, $primaryTypeName, 'Node type of '.$arg1.' is '.$arg2); } /** @@ -746,7 +745,7 @@ public function theNodeAtShouldHaveThePropertyWithValue($arg1, $arg2, $arg3) $propertyValue = $propertyValue->getIdentifier(); } - Assert::eq($arg3, $propertyValue); + \PHPUnit_Framework_Assert::assertEquals($arg3, $propertyValue); } /** @@ -762,7 +761,7 @@ public function theNodeAtShouldHaveThePropertyWithValueAtIndex($arg1, $arg2, $ar } $propertyType = $property->getValue(); - Assert::eq($arg3, $propertyType[$index]); + \PHPUnit_Framework_Assert::assertEquals($arg3, $propertyType[$index]); } /** @@ -778,7 +777,7 @@ public function thePropertyShouldHaveType($arg1, $arg2) )); } - Assert::eq($arg2, PropertyType::nameFromValue($property->getType())); + \PHPUnit_Framework_Assert::assertEquals($arg2, PropertyType::nameFromValue($property->getType())); } /** @@ -794,8 +793,8 @@ public function thePropertyShouldHaveTypeAndValue($arg1, $arg2, $arg3) )); } - Assert::eq($arg2, PropertyType::nameFromValue($property->getType())); - Assert::eq($arg3, $property->getValue()); + \PHPUnit_Framework_Assert::assertEquals($arg2, PropertyType::nameFromValue($property->getType())); + \PHPUnit_Framework_Assert::assertEquals($arg3, $property->getValue()); } /** @@ -865,7 +864,7 @@ public function theNodeShouldBeLocked($arg1) $lockManager = $workspace->getLockManager(); $isLocked = $lockManager->isLocked($arg1); - Assert::true($isLocked); + \PHPUnit_Framework_Assert::assertTrue($isLocked); } /** @@ -878,7 +877,7 @@ public function theNodeShouldNotBeLocked($arg1) $lockManager = $workspace->getLockManager(); $isLocked = $lockManager->isLocked($arg1); - Assert::false($isLocked); + \PHPUnit_Framework_Assert::assertFalse($isLocked); } /** From 4b20e85f938a00c245b287be025e8af690e89b62 Mon Sep 17 00:00:00 2001 From: Alexander Schranz Date: Thu, 6 Feb 2020 13:45:27 +0100 Subject: [PATCH 13/17] Upgrade to PhpUnit 8 and remove webmozart/asserts again --- .travis.yml | 2 +- phpunit.xml.dist | 4 -- src/PHPCR/Shell/Test/CliContext.php | 3 +- src/PHPCR/Shell/Test/ContextBase.php | 45 ++++++++++--------- tests/PHPCR/Shell/Helper/EditorHelperTest.php | 2 +- tests/PHPCR/Shell/Helper/NodeHelperTest.php | 2 +- tests/PHPCR/Shell/Helper/TextHelperTest.php | 2 +- tests/PHPCR/Shell/Phpcr/PhpcrSessionTest.php | 2 +- 8 files changed, 30 insertions(+), 32 deletions(-) diff --git a/.travis.yml b/.travis.yml index d5e14e02..4ea13244 100644 --- a/.travis.yml +++ b/.travis.yml @@ -33,6 +33,6 @@ before_script: - bash tests/bin/travis_jackrabbit.sh script: - - vendor/bin/simple-phpunit + - vendor/bin/phpunit - php vendor/bin/phpspec run - php vendor/behat/behat/bin/behat --suite=$BEHAT_SUITE diff --git a/phpunit.xml.dist b/phpunit.xml.dist index cc7aac5c..478f79be 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -6,10 +6,6 @@ bootstrap="vendor/autoload.php" > - - - - ./tests diff --git a/src/PHPCR/Shell/Test/CliContext.php b/src/PHPCR/Shell/Test/CliContext.php index 5c0b1923..c6f8f6da 100644 --- a/src/PHPCR/Shell/Test/CliContext.php +++ b/src/PHPCR/Shell/Test/CliContext.php @@ -15,6 +15,7 @@ use Behat\Behat\Context\Context; use Behat\Behat\Context\SnippetAcceptingContext; use Behat\Gherkin\Node\PyStringNode; +use PHPUnit\Framework\Assert; use Symfony\Component\Filesystem\Filesystem; /** @@ -112,6 +113,6 @@ public function initializeDoctrineDbal() */ public function theCommandShouldNotFail() { - \PHPUnit_Framework_Assert::assertEquals(0, $this->lastExitCode); + Assert::assertEquals(0, $this->lastExitCode); } } diff --git a/src/PHPCR/Shell/Test/ContextBase.php b/src/PHPCR/Shell/Test/ContextBase.php index 8385fe86..4558d2d9 100644 --- a/src/PHPCR/Shell/Test/ContextBase.php +++ b/src/PHPCR/Shell/Test/ContextBase.php @@ -24,6 +24,7 @@ use PHPCR\SimpleCredentials; use PHPCR\Util\NodeHelper; use PHPCR\Util\PathHelper; +use PHPUnit\Framework\Assert; use Symfony\Component\Filesystem\Filesystem; /** @@ -199,7 +200,7 @@ public function iShouldSeeATableContainingTheFollowingRows(TableNode $table) } } - \PHPUnit_Framework_Assert::assertGreaterThanOrEqual(count($expectedRows), $foundRows, $this->getOutput()); + Assert::assertGreaterThanOrEqual(count($expectedRows), $foundRows, $this->getOutput()); } /** @@ -208,7 +209,7 @@ public function iShouldSeeATableContainingTheFollowingRows(TableNode $table) public function iShouldSeeTheFollowing(PyStringNode $string) { $output = $this->getOutput(); - \PHPUnit_Framework_Assert::assertContains($string->getRaw(), $output); + Assert::assertContains($string->getRaw(), $output); } /** @@ -217,7 +218,7 @@ public function iShouldSeeTheFollowing(PyStringNode $string) public function iShouldNotSeeTheFollowing(PyStringNode $string) { $output = $this->getOutput(); - \PHPUnit_Framework_Assert::assertNotContains($string->getRaw(), $output); + Assert::assertNotContains($string->getRaw(), $output); } /** @@ -248,7 +249,7 @@ public function theCommandShouldNotFail() throw new \Exception('Command failed: ('.$exitCode.') '.$this->getOutput()); } - \PHPUnit_Framework_Assert::assertEquals(0, $exitCode, 'Command exited with code: '.$exitCode); + Assert::assertEquals(0, $exitCode, 'Command exited with code: '.$exitCode); } /** @@ -258,7 +259,7 @@ public function theCommandShouldFail() { $exitCode = $this->applicationTester->getLastExitCode(); - \PHPUnit_Framework_Assert::assertNotEquals(0, $exitCode, 'Command exited with code '.$exitCode); + Assert::assertNotEquals(0, $exitCode, 'Command exited with code '.$exitCode); } /** @@ -269,7 +270,7 @@ public function theCommandShouldFailWithMessage($arg1) $exitCode = $this->applicationTester->getLastExitCode(); $output = $this->getOutput(); - \PHPUnit_Framework_Assert::assertEquals($arg1, $output); + Assert::assertEquals($arg1, $output); } /** @@ -277,7 +278,7 @@ public function theCommandShouldFailWithMessage($arg1) */ public function theFileShouldExist($arg1) { - \PHPUnit_Framework_Assert::assertTrue(file_exists($this->getWorkingFilePath($arg1))); + Assert::assertTrue(file_exists($this->getWorkingFilePath($arg1))); } /** @@ -304,7 +305,7 @@ public function theFileExists($arg1) public function theOutputShouldContain(PyStringNode $string) { foreach ($string->getStrings() as $line) { - \PHPUnit_Framework_Assert::assertContains($line, $this->getOutput()); + Assert::assertContains($line, $this->getOutput()); } } @@ -315,7 +316,7 @@ public function theNodeShouldNotExist($arg1) { $session = $this->getSession(); $node = $session->getNode($arg1); - \PHPUnit_Framework_Assert::assertNull($node); + Assert::assertNull($node); } /** @@ -326,7 +327,7 @@ public function theXpathCountIsInFile($arg1, $arg2, $arg3) $xpath = $this->getXPathForFile($arg3); $res = $xpath->query($arg1); - \PHPUnit_Framework_Assert::assertEquals($arg2, $res->length); + Assert::assertEquals($arg2, $res->length); } /** @@ -363,7 +364,7 @@ public function iShouldNotBeLoggedIntoTheSession() { $this->executeCommand('session:info'); $output = $this->getOutput(); - \PHPUnit_Framework_Assert::assertRegExp('/live .*no/', $output); + Assert::assertRegExp('/live .*no/', $output); } /** @@ -427,7 +428,7 @@ public function thereShouldExistANodeAtBefore($arg1, $arg2) throw new \Exception('Could not find child node '.$arg1); } - \PHPUnit_Framework_Assert::assertEquals($arg2, $afterNode->getPath()); + Assert::assertEquals($arg2, $afterNode->getPath()); } /** @@ -530,7 +531,7 @@ public function thenIShouldBeLoggedInAs($arg1) $session = $this->getSession(); $userId = $session->getUserID(); - \PHPUnit_Framework_Assert::assertEquals($userId, $arg1); + Assert::assertEquals($userId, $arg1); } /** @@ -690,7 +691,7 @@ public function theCurrentNodeShouldBe($arg1) { $this->executeCommand('shell:path:show'); $cnp = $this->applicationTester->getLastLine(); - \PHPUnit_Framework_Assert::assertEquals($arg1, $cnp, 'Current path is '.$arg1); + Assert::assertEquals($arg1, $cnp, 'Current path is '.$arg1); } /** @@ -728,7 +729,7 @@ public function thePrimaryTypeOfShouldBe($arg1, $arg2) $session = $this->getSession(); $node = $session->getNode($arg1); $primaryTypeName = $node->getPrimaryNodeType()->getName(); - \PHPUnit_Framework_Assert::assertEquals($arg2, $primaryTypeName, 'Node type of '.$arg1.' is '.$arg2); + Assert::assertEquals($arg2, $primaryTypeName, 'Node type of '.$arg1.' is '.$arg2); } /** @@ -745,7 +746,7 @@ public function theNodeAtShouldHaveThePropertyWithValue($arg1, $arg2, $arg3) $propertyValue = $propertyValue->getIdentifier(); } - \PHPUnit_Framework_Assert::assertEquals($arg3, $propertyValue); + Assert::assertEquals($arg3, $propertyValue); } /** @@ -761,7 +762,7 @@ public function theNodeAtShouldHaveThePropertyWithValueAtIndex($arg1, $arg2, $ar } $propertyType = $property->getValue(); - \PHPUnit_Framework_Assert::assertEquals($arg3, $propertyType[$index]); + Assert::assertEquals($arg3, $propertyType[$index]); } /** @@ -777,7 +778,7 @@ public function thePropertyShouldHaveType($arg1, $arg2) )); } - \PHPUnit_Framework_Assert::assertEquals($arg2, PropertyType::nameFromValue($property->getType())); + Assert::assertEquals($arg2, PropertyType::nameFromValue($property->getType())); } /** @@ -793,8 +794,8 @@ public function thePropertyShouldHaveTypeAndValue($arg1, $arg2, $arg3) )); } - \PHPUnit_Framework_Assert::assertEquals($arg2, PropertyType::nameFromValue($property->getType())); - \PHPUnit_Framework_Assert::assertEquals($arg3, $property->getValue()); + Assert::assertEquals($arg2, PropertyType::nameFromValue($property->getType())); + Assert::assertEquals($arg3, $property->getValue()); } /** @@ -864,7 +865,7 @@ public function theNodeShouldBeLocked($arg1) $lockManager = $workspace->getLockManager(); $isLocked = $lockManager->isLocked($arg1); - \PHPUnit_Framework_Assert::assertTrue($isLocked); + Assert::assertTrue($isLocked); } /** @@ -877,7 +878,7 @@ public function theNodeShouldNotBeLocked($arg1) $lockManager = $workspace->getLockManager(); $isLocked = $lockManager->isLocked($arg1); - \PHPUnit_Framework_Assert::assertFalse($isLocked); + Assert::assertFalse($isLocked); } /** diff --git a/tests/PHPCR/Shell/Helper/EditorHelperTest.php b/tests/PHPCR/Shell/Helper/EditorHelperTest.php index afa2a071..67a81cee 100644 --- a/tests/PHPCR/Shell/Helper/EditorHelperTest.php +++ b/tests/PHPCR/Shell/Helper/EditorHelperTest.php @@ -18,7 +18,7 @@ class EditorHelperTest extends TestCase { protected $helper; - public function setUp() + public function setUp(): void { $this->helper = new EditorHelper(); putenv('EDITOR=cat'); diff --git a/tests/PHPCR/Shell/Helper/NodeHelperTest.php b/tests/PHPCR/Shell/Helper/NodeHelperTest.php index dadf3487..7495cb7b 100644 --- a/tests/PHPCR/Shell/Helper/NodeHelperTest.php +++ b/tests/PHPCR/Shell/Helper/NodeHelperTest.php @@ -19,7 +19,7 @@ class NodeHelperTest extends TestCase { protected $nodeHelper; - public function setUp() + public function setUp(): void { $this->session = $this->prophesize('PHPCR\SessionInterface'); $this->helper = new NodeHelper($this->session->reveal()); diff --git a/tests/PHPCR/Shell/Helper/TextHelperTest.php b/tests/PHPCR/Shell/Helper/TextHelperTest.php index f632392c..a40cefa1 100644 --- a/tests/PHPCR/Shell/Helper/TextHelperTest.php +++ b/tests/PHPCR/Shell/Helper/TextHelperTest.php @@ -18,7 +18,7 @@ class TextHelperTest extends TestCase { protected $textHelper; - public function setUp() + public function setUp(): void { $this->textHelper = new TextHelper(); } diff --git a/tests/PHPCR/Shell/Phpcr/PhpcrSessionTest.php b/tests/PHPCR/Shell/Phpcr/PhpcrSessionTest.php index c3d49fc1..e98bf54f 100644 --- a/tests/PHPCR/Shell/Phpcr/PhpcrSessionTest.php +++ b/tests/PHPCR/Shell/Phpcr/PhpcrSessionTest.php @@ -17,7 +17,7 @@ class PhpcrSessionTest extends TestCase { - public function setUp() + public function setUp(): void { $this->phpcr = $this->prophesize('PHPCR\SessionInterface'); $this->session = new PhpcrSession($this->phpcr->reveal()); From 6989bbb63a822ea85967eb1c8d49680d64b29000 Mon Sep 17 00:00:00 2001 From: Alexander Schranz Date: Thu, 6 Feb 2020 22:14:02 +0100 Subject: [PATCH 14/17] Try older distribution --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 4ea13244..1761f139 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,4 +1,5 @@ language: php +dist: trusty matrix: include: From d7cf3216f40bbabe016192254d3c025313feef17 Mon Sep 17 00:00:00 2001 From: Alexander Schranz Date: Thu, 6 Feb 2020 22:43:28 +0100 Subject: [PATCH 15/17] Try using newest behat version --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index d316a80e..cf621337 100644 --- a/composer.json +++ b/composer.json @@ -17,7 +17,7 @@ "require-dev": { "phpunit/phpunit": "^8.5", "symfony/symfony": "^5.0", - "behat/behat": "^3.1", + "behat/behat": "^3.6.1", "phpspec/phpspec": "^6.0", "jackalope/jackalope-doctrine-dbal": "^1.2", "jackalope/jackalope-jackrabbit": "^1.2" From 34c0577e868d125a3d109e56796fc57071b8934f Mon Sep 17 00:00:00 2001 From: Alexander Schranz Date: Thu, 6 Feb 2020 23:53:07 +0100 Subject: [PATCH 16/17] Upgrade jackalope version --- composer.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/composer.json b/composer.json index cf621337..3b4bf080 100644 --- a/composer.json +++ b/composer.json @@ -5,7 +5,7 @@ "php": "^7.2", "symfony/console": "^5.0", "jackalope/jackalope": "^1.1", - "phpcr/phpcr": "~2.1", + "phpcr/phpcr": "^2.1", "phpcr/phpcr-utils": "^1.2", "symfony/finder": "^5.0", "symfony/serializer": "^5.0", @@ -19,8 +19,8 @@ "symfony/symfony": "^5.0", "behat/behat": "^3.6.1", "phpspec/phpspec": "^6.0", - "jackalope/jackalope-doctrine-dbal": "^1.2", - "jackalope/jackalope-jackrabbit": "^1.2" + "jackalope/jackalope-doctrine-dbal": "^1.3", + "jackalope/jackalope-jackrabbit": "^1.3" }, "suggest": { "jackalope/jackalope-doctrine-dbal": "To connect to jackalope doctrine-dbal", From 3fe55649055ee7d622934b0386d7667ffa90dc90 Mon Sep 17 00:00:00 2001 From: Alexander Schranz Date: Fri, 7 Feb 2020 00:28:27 +0100 Subject: [PATCH 17/17] Fix prefer lowest tests --- composer.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index 3b4bf080..05416541 100644 --- a/composer.json +++ b/composer.json @@ -4,7 +4,7 @@ "require": { "php": "^7.2", "symfony/console": "^5.0", - "jackalope/jackalope": "^1.1", + "jackalope/jackalope": "^1.3.4", "phpcr/phpcr": "^2.1", "phpcr/phpcr-utils": "^1.2", "symfony/finder": "^5.0", @@ -17,7 +17,7 @@ "require-dev": { "phpunit/phpunit": "^8.5", "symfony/symfony": "^5.0", - "behat/behat": "^3.6.1", + "behat/behat": "^3.6", "phpspec/phpspec": "^6.0", "jackalope/jackalope-doctrine-dbal": "^1.3", "jackalope/jackalope-jackrabbit": "^1.3"