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/.travis.yml b/.travis.yml
index 8ee9b8a1..1761f139 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,75 +1,39 @@
language: php
+dist: trusty
matrix:
include:
- - php: 5.6
+ - php: 7.2
env:
- PREFER="--prefer-lowest"
- BEHAT_SUITE=standalone
- - SYMFONY_VERSION=^2.8
- - php: 5.6
+ - php: 7.2
env:
- PREFER="--prefer-lowest"
- BEHAT_SUITE=embedded
- - SYMFONY_VERSION=^3.0
- - php: 5.6
+ - php: 7.2
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
+ - php: 7.4
env:
- PREFER=""
- BEHAT_SUITE=standalone
- - SYMFONY_VERSION=^2.8
- - php: 7.1
+ - php: 7.4
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=""
- - BEHAT_SUITE=standalone
- - SYMFONY_VERSION=^2.8
- - php: 7.2
- env:
- - PREFER=""
- - BEHAT_SUITE=embedded
- - SYMFONY_VERSION=^3.0
- - php: 7.2
+ - php: 7.4
env:
- PREFER=""
- BEHAT_SUITE=cli
- - SYMFONY_VERSION=^4.0
before_script:
- composer self-update
- - composer require "symfony/symfony" "$SYMFONY_VERSION" --no-update
- composer update $PREFER
- bash tests/bin/travis_jackrabbit.sh
-script:
- - phpunit
+script:
+ - vendor/bin/phpunit
- php vendor/bin/phpspec run
- php vendor/behat/behat/bin/behat --suite=$BEHAT_SUITE
diff --git a/composer.json b/composer.json
index b9050f74..05416541 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",
- "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",
- "dantleech/glob-finder": "~1.0"
+ "php": "^7.2",
+ "symfony/console": "^5.0",
+ "jackalope/jackalope": "^1.3.4",
+ "phpcr/phpcr": "^2.1",
+ "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/symfony": "~2.8|~3.0|~4.0",
- "phpunit/phpunit": "~5.7",
- "behat/behat": "~3.1",
- "phpspec/phpspec": "~3.2|~4.0",
- "jackalope/jackalope-doctrine-dbal": "~1.2",
- "jackalope/jackalope-jackrabbit": "~1.2"
+ "phpunit/phpunit": "^8.5",
+ "symfony/symfony": "^5.0",
+ "behat/behat": "^3.6",
+ "phpspec/phpspec": "^6.0",
+ "jackalope/jackalope-doctrine-dbal": "^1.3",
+ "jackalope/jackalope-jackrabbit": "^1.3"
},
"suggest": {
"jackalope/jackalope-doctrine-dbal": "To connect to jackalope doctrine-dbal",
diff --git a/src/PHPCR/Shell/Console/Application/ShellApplication.php b/src/PHPCR/Shell/Console/Application/ShellApplication.php
index ae7d94cc..1112543e 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;
@@ -57,6 +56,11 @@ class ShellApplication extends Application
*/
protected $initialized = false;
+ /**
+ * @var EventDispatcher
+ */
+ private $dispatcher;
+
/**
* Constructor - name and version inherited from SessionApplication.
*
@@ -95,7 +99,7 @@ public function init()
$this->registerShellCommands();
$event = new ApplicationInitEvent($this);
- $this->dispatcher->dispatch(PhpcrShellEvents::APPLICATION_INIT, $event);
+ $this->dispatcher->dispatch($event, PhpcrShellEvents::APPLICATION_INIT);
$this->initialized = true;
}
@@ -242,7 +246,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->dispatcher->dispatch($event, PhpcrShellEvents::COMMAND_PRE_RUN);
$input = $event->getInput();
if (!$name) {
@@ -252,7 +256,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->dispatcher->dispatch(new Event\CommandExceptionEvent($e, $this, $output), PhpcrShellEvents::COMMAND_EXCEPTION);
return 1;
}
@@ -292,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->dispatcher->dispatch(PhpcrShellEvents::PROFILE_INIT, $event);
+ $this->dispatcher->dispatch($event, PhpcrShellEvents::PROFILE_INIT);
}
/**
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 2298276f..b3591714 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;
@@ -50,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 2322e916..829b8600 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;
@@ -49,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 1467ae21..e3ff7425 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;
@@ -141,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 82bcbeb7..73cf3b75 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;
@@ -42,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 c7fc66fd..efdf142f 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;
@@ -76,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 099c28ec..5452daa0 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;
@@ -116,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 89bd886c..608fcd18 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;
@@ -57,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 82d116e2..3c209aea 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;
@@ -73,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 ae820c5d..88695a2b 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;
@@ -67,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 1b50bf5e..ac338442 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;
@@ -48,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 8a12b088..408aee6c 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;
@@ -100,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 12a9fe5d..9262d32f 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;
@@ -53,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 c3f663fb..7d9164ed 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;
@@ -43,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 21137f46..c69c37c9 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;
@@ -55,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 d6efc76e..91f7c17a 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;
@@ -34,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 93e868ae..c07bab08 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;
@@ -46,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 b9b0cdef..7e419b34 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'),
- ]);
+ ]);
}
/**
@@ -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;
}
}
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 @@
+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 777cd65d..67a81cee 100644
--- a/tests/PHPCR/Shell/Helper/EditorHelperTest.php
+++ b/tests/PHPCR/Shell/Helper/EditorHelperTest.php
@@ -12,11 +12,13 @@
namespace PHPCR\Shell\Console\Helper;
-class EditorHelperTest extends \PHPUnit_Framework_TestCase
+use PHPUnit\Framework\TestCase;
+
+class EditorHelperTest extends TestCase
{
protected $helper;
- public function setUp()
+ public function setUp(): void
{
$this->helper = new EditorHelper();
putenv('EDITOR=cat');
@@ -40,11 +42,10 @@ public function testFromValue()
);
}
- /**
- * @expectedException \RuntimeException
- */
public function testFromValueNoEditor()
{
+ $this->expectException(\RuntimeException::class);
+
putenv('EDITOR=');
$res = $this->helper->fromString('asd');
}
@@ -56,7 +57,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
diff --git a/tests/PHPCR/Shell/Helper/NodeHelperTest.php b/tests/PHPCR/Shell/Helper/NodeHelperTest.php
index 8fded511..7495cb7b 100644
--- a/tests/PHPCR/Shell/Helper/NodeHelperTest.php
+++ b/tests/PHPCR/Shell/Helper/NodeHelperTest.php
@@ -13,12 +13,13 @@
namespace PHPCR\Shell\Console\Helper;
use PHPCR\NodeInterface;
+use PHPUnit\Framework\TestCase;
-class NodeHelperTest extends \PHPUnit_Framework_TestCase
+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());
@@ -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..a40cefa1 100644
--- a/tests/PHPCR/Shell/Helper/TextHelperTest.php
+++ b/tests/PHPCR/Shell/Helper/TextHelperTest.php
@@ -12,11 +12,13 @@
namespace PHPCR\Shell\Console\Helper;
-class TextHelperTest extends \PHPUnit_Framework_TestCase
+use PHPUnit\Framework\TestCase;
+
+class TextHelperTest extends TestCase
{
protected $textHelper;
- public function setUp()
+ public function setUp(): void
{
$this->textHelper = new 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..e98bf54f 100644
--- a/tests/PHPCR/Shell/Phpcr/PhpcrSessionTest.php
+++ b/tests/PHPCR/Shell/Phpcr/PhpcrSessionTest.php
@@ -13,10 +13,11 @@
namespace PHPCR\Shell\Phpcr;
use PHPCR\PathNotFoundException;
+use PHPUnit\Framework\TestCase;
-class PhpcrSessionTest extends \Phpunit_Framework_TestCase
+class PhpcrSessionTest extends TestCase
{
- public function setUp()
+ public function setUp(): void
{
$this->phpcr = $this->prophesize('PHPCR\SessionInterface');
$this->session = new PhpcrSession($this->phpcr->reveal());