diff --git a/.travis.yml b/.travis.yml
index 51d78aa..1c46773 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,8 +1,5 @@
language: php
php:
- - '5.5'
- - '5.6'
- - '7.0'
- '7.1'
- '7.2'
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 785091b..24938e2 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,37 +1,9 @@
-CHANGELOG for 3.X
+CHANGELOG for 4.X
=================
-* 3.4.0 (2018-03-29)
- * [Issue#380] Throw exception if log_dir is defined but directory doesn't exists
- * [BUGFIX] [Issue#405] Malformed ssh command when defining host:port notation
- * [Issue#415] Remove timeout on Deploy with Tar or Rsync tasks
-
-
-* 3.3.0 (2017-07-22)
- * [PR#386] Allow to define timeout (default 120s) for symfony/assetic-dump task.
- * [PR#392] Allow to define Host Port in Host configuration.
- * Allow to specify the binary path of tar on for create and extract
-
-* 3.2.0 (2017-04-14)
- * Allow to pre-register Custom Tasks
- * [PR#365] New option "from" to define deployment start point
- * Allow to define excludes in the global scope.
- * Improve code quality, remove duplications on Symfony Tasks.
- * Improve code quality, remove duplications on Composer Tasks.
- * [PR#364] Allow to define custom timeout to Composer:Install
-
-* 3.1.0 (2017-02-25)
- * Add new Exec task to execute arbitrary shell commands
- * Add new Composer task, to update phar (composer/self-update)
- * [#344] Allow to flag Filesystem tasks
- * [PR#346] Add new File System task, to change file's modes (fs/chmod)
- * [BUGFIX] [PR#342] Ignore empty exclude lines
- * [PR#330] Allow Composer task options to be overwritten at environment level
- * [PR#330] Add new method Runtime::getMergedOption to merge ConfigOption and EnvOption
- * [Documentation] [PR#333] Improve example config file
-
-* 3.0.1 (2017-01-10)
- * [BUGFIX] [#350] [#353] Fix escape issue when commands are sent through SSH
-
-* 3.0.0 (2017-01-31)
- * v3 series release
+* 4.0.0 (2018-04-02)
+ * v4 series release
+ * Refactored for Symfony 4 and PHP 7.1
+ * Symfony Pool Clear task added
+ * Symfony Pool Prune task added
+ * Symfony Assetic task removed
diff --git a/README.md b/README.md
index 8190ae2..76af922 100644
--- a/README.md
+++ b/README.md
@@ -16,7 +16,7 @@ Simply add the following dependency to your project’s composer.json file:
```json
"require": {
- "andres-montanez/magallanes": "^3.0"
+ "andres-montanez/magallanes": "^4.0"
}
```
Finally you can use **Magallanes** from the vendor's bin:
@@ -25,8 +25,5 @@ Finally you can use **Magallanes** from the vendor's bin:
$ vendor/bin/mage version
```
-### What happend to version 2?
-There is no version 2. I've skipped it and jumpped stright from v1 to v3. This new version of **Magallanes** is quite radical and different from it's successor. The whole application has been rewritten using **_Symfony3 Components_**, so naming it v3 makes a lot of sense.
-
-### Codename Nostromo
-Each new mayor version of **Magallanes** will have a codename (like Ubuntu), and in the current version it is **_Nostromo_**, like the spaceship from the movie *Alien (1979)*.
+### Codename Discovery One
+Each new mayor version of **Magallanes** will have a codename (like Ubuntu), version 3 was _Nostromo_, and in the current version it is **_Discovery One_**, in homage to the spaceship from the ground breaking film *2001: A Space Odyssey (1968)*.
diff --git a/composer.json b/composer.json
index 10ae4de..580533c 100644
--- a/composer.json
+++ b/composer.json
@@ -1,7 +1,7 @@
{
"name": "andres-montanez/magallanes",
"description": "The Deployment Tool for PHP Applications",
- "homepage": "http://magephp.com",
+ "homepage": "https://magephp.com",
"license": "MIT",
"type": "library",
"keywords": ["deployment"],
@@ -12,17 +12,17 @@
}
],
"require": {
- "php": ">=5.5.9",
- "monolog/monolog": "^1.0",
- "symfony/console": "^3.0",
- "symfony/filesystem": "^3.0",
- "symfony/event-dispatcher": "^3.0",
- "symfony/finder": "^3.0",
- "symfony/yaml": "^3.0",
- "symfony/process": "^3.0"
+ "php": "^7.1.3",
+ "monolog/monolog": "~1.11",
+ "symfony/console": "^4.0",
+ "symfony/filesystem": "^4.0",
+ "symfony/event-dispatcher": "^4.0",
+ "symfony/finder": "^4.0",
+ "symfony/yaml": "^4.0",
+ "symfony/process": "^4.0"
},
"require-dev": {
- "phpunit/phpunit": "4.8.*",
+ "phpunit/phpunit": "^7.0",
"satooshi/php-coveralls": "~1.0"
},
"autoload": {
@@ -38,8 +38,8 @@
"bin": ["bin/mage"],
"extra": {
"branch-alias": {
- "dev-master": "3.0.x-dev",
- "dev-nostromo": "3.x-dev"
+ "dev-master": "4.0.x-dev",
+ "dev-discovery-one": "4.x-dev"
}
}
}
diff --git a/docs/dockers/php7.1/Dockerfile b/docs/dockers/php7.1/Dockerfile
index cb63a2b..53607a2 100644
--- a/docs/dockers/php7.1/Dockerfile
+++ b/docs/dockers/php7.1/Dockerfile
@@ -2,7 +2,7 @@ FROM ubuntu:17.10
RUN apt-get update && apt-get upgrade -y
RUN apt-get install -y vim curl git unzip
-RUN apt-get install -y php7.1-cli php-zip php7.1-curl php7.1-xml
+RUN apt-get install -y php7.1-cli php-zip php7.1-curl php7.1-xml php7.1-mbstring
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/bin/ --filename=composer
diff --git a/src/Mage.php b/src/Mage.php
index 78e38d4..f1b6313 100644
--- a/src/Mage.php
+++ b/src/Mage.php
@@ -17,6 +17,6 @@ namespace Mage;
*/
class Mage
{
- const VERSION = '3.4.0';
- const CODENAME = 'Nostromo';
+ const VERSION = '4.x';
+ const CODENAME = 'Discovery One';
}
diff --git a/src/MageApplication.php b/src/MageApplication.php
index 77fe4e2..b7b1408 100644
--- a/src/MageApplication.php
+++ b/src/MageApplication.php
@@ -17,7 +17,7 @@ use Symfony\Component\Finder\SplFileInfo;
use Monolog\Logger;
use Monolog\Handler\StreamHandler;
use Symfony\Component\EventDispatcher\EventDispatcher;
-use Symfony\Component\Console\Event\ConsoleExceptionEvent;
+use Symfony\Component\Console\Event\ConsoleErrorEvent;
use Symfony\Component\Console\ConsoleEvents;
use Symfony\Component\Console\Application;
use Symfony\Component\Yaml\Parser;
@@ -46,12 +46,12 @@ class MageApplication extends Application
$dispatcher = new EventDispatcher();
$this->setDispatcher($dispatcher);
- $dispatcher->addListener(ConsoleEvents::EXCEPTION, function (ConsoleExceptionEvent $event) {
+ $dispatcher->addListener(ConsoleEvents::ERROR, function (ConsoleErrorEvent $event) {
$output = $event->getOutput();
$command = $event->getCommand();
$output->writeln(sprintf('Oops, exception thrown while running command %s', $command->getName()));
$exitCode = $event->getExitCode();
- $event->setException(new \LogicException('Caught exception', $exitCode, $event->getException()));
+ $event->setError(new \LogicException('Caught exception', $exitCode, $event->getError()));
});
$this->runtime = $this->instantiateRuntime();
diff --git a/src/Task/BuiltIn/Symfony/AsseticDumpTask.php b/src/Task/BuiltIn/Symfony/CachePoolClearTask.php
similarity index 50%
rename from src/Task/BuiltIn/Symfony/AsseticDumpTask.php
rename to src/Task/BuiltIn/Symfony/CachePoolClearTask.php
index 8d1400c..bd83d88 100644
--- a/src/Task/BuiltIn/Symfony/AsseticDumpTask.php
+++ b/src/Task/BuiltIn/Symfony/CachePoolClearTask.php
@@ -10,45 +10,44 @@
namespace Mage\Task\BuiltIn\Symfony;
+use Mage\Task\Exception\ErrorException;
use Symfony\Component\Process\Process;
-use Mage\Task\AbstractTask;
/**
- * Symfony Task - Dump Assetics
+ * Symfony Task - Cache Pool Clear
*
* @author Andrés Montañez
*/
-class AsseticDumpTask extends AbstractTask
+class CachePoolClearTask extends AbstractSymfonyTask
{
public function getName()
{
- return 'symfony/assetic-dump';
+ return 'symfony/cache-pool-clear';
}
public function getDescription()
{
- return '[Symfony] Assetic Dump';
+ return '[Symfony] Cache Pool Clear';
}
public function execute()
{
$options = $this->getOptions();
- $command = sprintf('%s assetic:dump --env=%s %s', $options['console'], $options['env'], $options['flags']);
+
+ if (!$options['pools']) {
+ throw new ErrorException('Parameter "pools" is not defined');
+ }
+
+ $command = $options['console'] . ' cache:pool:clear ' . $options['pools'] . ' --env=' . $options['env'] . ' ' . $options['flags'];
/** @var Process $process */
- $process = $this->runtime->runCommand(trim($command), $options['timeout']);
+ $process = $this->runtime->runCommand(trim($command));
return $process->isSuccessful();
}
- protected function getOptions()
+ protected function getSymfonyOptions()
{
- $options = array_merge(
- ['console' => 'bin/console', 'env' => 'dev', 'flags' => '', 'timeout' => 120],
- $this->runtime->getMergedOption('symfony'),
- $this->options
- );
-
- return $options;
+ return ['pools' => null];
}
}
diff --git a/src/Task/BuiltIn/Symfony/CachePoolPruneTask.php b/src/Task/BuiltIn/Symfony/CachePoolPruneTask.php
new file mode 100644
index 0000000..f8c07ac
--- /dev/null
+++ b/src/Task/BuiltIn/Symfony/CachePoolPruneTask.php
@@ -0,0 +1,42 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Mage\Task\BuiltIn\Symfony;
+
+use Symfony\Component\Process\Process;
+
+/**
+ * Symfony Task - Cache Pool Prune
+ *
+ * @author Andrés Montañez
+ */
+class CachePoolPruneTask extends AbstractSymfonyTask
+{
+ public function getName()
+ {
+ return 'symfony/cache-pool-prune';
+ }
+
+ public function getDescription()
+ {
+ return '[Symfony] Cache Pool Prune';
+ }
+
+ public function execute()
+ {
+ $options = $this->getOptions();
+ $command = $options['console'] . ' cache:pool:prune --env=' . $options['env'] . ' ' . $options['flags'];
+
+ /** @var Process $process */
+ $process = $this->runtime->runCommand(trim($command));
+
+ return $process->isSuccessful();
+ }
+}
diff --git a/tests/Command/BuiltIn/Config/DumpCommandTest.php b/tests/Command/BuiltIn/Config/DumpCommandTest.php
index 4eb25a9..d97aec3 100644
--- a/tests/Command/BuiltIn/Config/DumpCommandTest.php
+++ b/tests/Command/BuiltIn/Config/DumpCommandTest.php
@@ -14,7 +14,7 @@ use Mage\Command\BuiltIn\Config\DumpCommand;
use Mage\Command\AbstractCommand;
use Mage\Tests\MageApplicationMockup;
use Symfony\Component\Console\Tester\CommandTester;
-use PHPUnit_Framework_TestCase as TestCase;
+use PHPUnit\Framework\TestCase;
class DumpCommandTest extends TestCase
{
diff --git a/tests/Command/BuiltIn/Config/EnvironmentsCommandTest.php b/tests/Command/BuiltIn/Config/EnvironmentsCommandTest.php
index 58a6600..a52657c 100644
--- a/tests/Command/BuiltIn/Config/EnvironmentsCommandTest.php
+++ b/tests/Command/BuiltIn/Config/EnvironmentsCommandTest.php
@@ -14,7 +14,7 @@ use Mage\Command\BuiltIn\Config\EnvironmentsCommand;
use Mage\Command\AbstractCommand;
use Mage\Tests\MageApplicationMockup;
use Symfony\Component\Console\Tester\CommandTester;
-use PHPUnit_Framework_TestCase as TestCase;
+use PHPUnit\Framework\TestCase;
class EnvironmentsCommandTest extends TestCase
{
diff --git a/tests/Command/BuiltIn/DeployCommandMiscTasksTest.php b/tests/Command/BuiltIn/DeployCommandMiscTasksTest.php
index c8be597..7bad23a 100644
--- a/tests/Command/BuiltIn/DeployCommandMiscTasksTest.php
+++ b/tests/Command/BuiltIn/DeployCommandMiscTasksTest.php
@@ -14,7 +14,7 @@ use Mage\Command\BuiltIn\DeployCommand;
use Mage\Tests\MageApplicationMockup;
use Mage\Command\AbstractCommand;
use Symfony\Component\Console\Tester\CommandTester;
-use PHPUnit_Framework_TestCase as TestCase;
+use PHPUnit\Framework\TestCase;
class DeployCommandMiscTasksTest extends TestCase
{
@@ -35,8 +35,10 @@ class DeployCommandMiscTasksTest extends TestCase
0 => 'rsync -e "ssh -p 22 -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no" -avz --exclude=.git --exclude=./var/cache/* --exclude=./var/log/* --exclude=./web/app_dev.php ./ tester@testhost:/var/www/test',
1 => 'ssh -p 22 -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no tester@testhost "cd /var/www/test && bin/console cache:warmup --env=testenv"',
2 => 'ssh -p 22 -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no tester@testhost "cd /var/www/test && bin/console assets:install web --env=testenv --symlink --relative"',
- 3 => 'ssh -p 22 -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no tester@testhost "cd /var/www/test && bin/console assetic:dump --env=testenv"',
- 4 => 'ssh -p 22 -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no tester@testhost "cd /var/www/test && bin/console assetic:dump --env=prod"',
+ 3 => 'ssh -p 22 -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no tester@testhost "cd /var/www/test && bin/console cache:pool:prune --env=testenv"',
+ 4 => 'ssh -p 22 -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no tester@testhost "cd /var/www/test && bin/console cache:pool:prune --env=prod"',
+ 5 => 'ssh -p 22 -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no tester@testhost "cd /var/www/test && bin/console cache:pool:clear main --env=testenv"',
+ 6 => 'ssh -p 22 -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no tester@testhost "cd /var/www/test && bin/console cache:pool:clear main --env=prod"',
);
// Check total of Executed Commands
diff --git a/tests/Command/BuiltIn/DeployCommandMiscTest.php b/tests/Command/BuiltIn/DeployCommandMiscTest.php
index 8df52ef..4b4cec3 100644
--- a/tests/Command/BuiltIn/DeployCommandMiscTest.php
+++ b/tests/Command/BuiltIn/DeployCommandMiscTest.php
@@ -15,7 +15,7 @@ use Mage\Runtime\Exception\RuntimeException;
use Mage\Tests\MageApplicationMockup;
use Mage\Command\AbstractCommand;
use Symfony\Component\Console\Tester\CommandTester;
-use PHPUnit_Framework_TestCase as TestCase;
+use PHPUnit\Framework\TestCase;
class DeployCommandMiscTest extends TestCase
{
@@ -78,7 +78,7 @@ class DeployCommandMiscTest extends TestCase
6 => 'ssh -p 22 -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no tester@testhost "cd /var/www/test && sudo bin/console cache:clear --env=dev"',
7 => 'ssh -p 22 -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no tester@testhost "cd /var/www/test && sudo bin/console cache:warmup --env=dev"',
8 => 'ssh -p 22 -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no tester@testhost "cd /var/www/test && sudo bin/console assets:install web --env=dev --symlink --relative"',
- 9 => 'ssh -p 22 -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no tester@testhost "cd /var/www/test && sudo bin/console assetic:dump --env=dev"',
+ 9 => 'ssh -p 22 -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no tester@testhost "cd /var/www/test && sudo bin/console cache:pool:prune --env=dev"',
10 => 'git checkout master',
);
@@ -115,7 +115,7 @@ class DeployCommandMiscTest extends TestCase
5 => 'rsync -e "ssh -p 22 -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no" -avz --exclude=.git --exclude=./var/cache/* --exclude=./var/log/* --exclude=./web/app_dev.php ./ tester@testhost:/var/www/test',
6 => 'ssh -p 22 -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no tester@testhost "cd /var/www/test && bin/console cache:warmup --env=dev"',
7 => 'ssh -p 22 -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no tester@testhost "cd /var/www/test && bin/console assets:install web --env=dev --symlink --relative"',
- 8 => 'ssh -p 22 -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no tester@testhost "cd /var/www/test && bin/console assetic:dump --env=dev"',
+ 8 => 'ssh -p 22 -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no tester@testhost "cd /var/www/test && bin/console cache:pool:prune --env=dev"',
9 => 'git checkout master',
);
@@ -259,7 +259,7 @@ class DeployCommandMiscTest extends TestCase
4 => 'rsync -e "ssh -p 22 -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no" -avz --exclude=.git --exclude=./var/cache/* --exclude=./var/log/* --exclude=./web/app_dev.php ./ tester@testhost:/var/www/test',
5 => 'ssh -p 22 -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no tester@testhost "cd /var/www/test && bin/console cache:warmup --env=dev"',
6 => 'ssh -p 22 -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no tester@testhost "cd /var/www/test && bin/console assets:install web --env=dev --symlink --relative"',
- 7 => 'ssh -p 22 -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no tester@testhost "cd /var/www/test && bin/console assetic:dump --env=dev"',
+ 7 => 'ssh -p 22 -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no tester@testhost "cd /var/www/test && bin/console cache:pool:prune --env=dev"',
8 => 'git branch | grep "*"',
);
diff --git a/tests/Command/BuiltIn/DeployCommandWithReleasesTest.php b/tests/Command/BuiltIn/DeployCommandWithReleasesTest.php
index de3e201..366e38d 100644
--- a/tests/Command/BuiltIn/DeployCommandWithReleasesTest.php
+++ b/tests/Command/BuiltIn/DeployCommandWithReleasesTest.php
@@ -14,7 +14,7 @@ use Mage\Command\BuiltIn\DeployCommand;
use Mage\Command\AbstractCommand;
use Mage\Tests\MageApplicationMockup;
use Symfony\Component\Console\Tester\CommandTester;
-use PHPUnit_Framework_TestCase as TestCase;
+use PHPUnit\Framework\TestCase;
class DeployCommandWithReleasesTest extends TestCase
{
@@ -46,7 +46,7 @@ class DeployCommandWithReleasesTest extends TestCase
9 => 'ssh -p 22 -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no tester@testhost "rm /var/www/test/releases/1234567890/mageXYZ"',
10 => 'ssh -p 22 -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no tester@testhost "cd /var/www/test/releases/1234567890 && bin/console cache:warmup --env=dev"',
11 => 'ssh -p 22 -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no tester@testhost "cd /var/www/test/releases/1234567890 && bin/console assets:install web --env=dev --symlink --relative"',
- 12 => 'ssh -p 22 -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no tester@testhost "cd /var/www/test/releases/1234567890 && bin/console assetic:dump --env=dev"',
+ 12 => 'ssh -p 22 -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no tester@testhost "cd /var/www/test/releases/1234567890 && bin/console cache:pool:prune --env=dev"',
13 => 'ssh -p 22 -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no tester@testhost "cd /var/www/test && ln -snf releases/1234567890 current"',
14 => 'ssh -p 22 -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no tester@testhost "ls -1 /var/www/test/releases"',
15 => 'ssh -p 22 -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no tester@testhost "rm -rf /var/www/test/releases/20170101015110"',
@@ -96,7 +96,7 @@ class DeployCommandWithReleasesTest extends TestCase
9 => 'ssh -p 202 -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no tester@testhost "rm /var/www/test/releases/1234567890/mageXYZ"',
10 => 'ssh -p 202 -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no tester@testhost "cd /var/www/test/releases/1234567890 && bin/console cache:warmup --env=prod"',
11 => 'ssh -p 202 -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no tester@testhost "cd /var/www/test/releases/1234567890 && bin/console assets:install web --env=prod --symlink --relative"',
- 12 => 'ssh -p 202 -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no tester@testhost "cd /var/www/test/releases/1234567890 && bin/console assetic:dump --env=prod"',
+ 12 => 'ssh -p 202 -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no tester@testhost "cd /var/www/test/releases/1234567890 && bin/console cache:pool:prune --env=prod"',
13 => 'ssh -p 202 -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no tester@testhost "cd /var/www/test && ln -snf releases/1234567890 current"',
14 => 'ssh -p 202 -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no tester@testhost "ls -1 /var/www/test/releases"',
15 => 'ssh -p 202 -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no tester@testhost "rm -rf /var/www/test/releases/20170101015110"',
@@ -146,7 +146,7 @@ class DeployCommandWithReleasesTest extends TestCase
9 => 'ssh -p 22 -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no tester@testhost "rm /var/www/test/releases/1234567890/mageXYZ"',
10 => 'ssh -p 22 -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no tester@testhost "cd /var/www/test/releases/1234567890 && bin/console cache:warmup --env=dev"',
11 => 'ssh -p 22 -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no tester@testhost "cd /var/www/test/releases/1234567890 && bin/console assets:install web --env=dev --symlink --relative"',
- 12 => 'ssh -p 22 -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no tester@testhost "cd /var/www/test/releases/1234567890 && bin/console assetic:dump --env=dev"',
+ 12 => 'ssh -p 22 -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no tester@testhost "cd /var/www/test/releases/1234567890 && bin/console cache:pool:prune --env=dev"',
13 => 'ssh -p 22 -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no tester@testhost "cd /var/www/test && ln -snf releases/1234567890 current"',
14 => 'ssh -p 22 -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no tester@testhost "ls -1 /var/www/test/releases"',
15 => 'ssh -p 22 -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no tester@testhost "rm -rf /var/www/test/releases/20170101015110"',
@@ -356,7 +356,7 @@ class DeployCommandWithReleasesTest extends TestCase
9 => 'ssh -p 22 -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no tester@testhost "rm /var/www/test/releases/1234567890/mageXYZ"',
10 => 'ssh -p 22 -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no tester@testhost "cd /var/www/test/releases/1234567890 && bin/console cache:warmup --env=dev"',
11 => 'ssh -p 22 -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no tester@testhost "cd /var/www/test/releases/1234567890 && bin/console assets:install web --env=dev --symlink --relative"',
- 12 => 'ssh -p 22 -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no tester@testhost "cd /var/www/test/releases/1234567890 && bin/console assetic:dump --env=dev"',
+ 12 => 'ssh -p 22 -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no tester@testhost "cd /var/www/test/releases/1234567890 && bin/console cache:pool:prune --env=dev"',
13 => 'ssh -p 22 -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no tester@testhost "cd /var/www/test && ln -snf releases/1234567890 current"',
14 => 'ssh -p 22 -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no tester@testhost "ls -1 /var/www/test/releases"',
15 => 'ssh -p 22 -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no tester@testhost "rm -rf /var/www/test/releases/20170101015110"',
@@ -409,7 +409,7 @@ class DeployCommandWithReleasesTest extends TestCase
9 => 'ssh -p 22 -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no tester@testhost "rm /var/www/test/releases/1234567890/mageXYZ"',
10 => 'ssh -p 22 -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no tester@testhost "cd /var/www/test/releases/1234567890 && bin/console cache:warmup --env=dev"',
11 => 'ssh -p 22 -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no tester@testhost "cd /var/www/test/releases/1234567890 && bin/console assets:install web --env=dev --symlink --relative"',
- 12 => 'ssh -p 22 -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no tester@testhost "cd /var/www/test/releases/1234567890 && bin/console assetic:dump --env=dev"',
+ 12 => 'ssh -p 22 -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no tester@testhost "cd /var/www/test/releases/1234567890 && bin/console cache:pool:prune --env=dev"',
13 => 'ssh -p 22 -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no tester@testhost "cd /var/www/test && ln -snf releases/1234567890 current"',
14 => 'ssh -p 22 -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no tester@testhost "ls -1 /var/www/test/releases"',
);
diff --git a/tests/Command/BuiltIn/DeployCommandWithoutReleasesTest.php b/tests/Command/BuiltIn/DeployCommandWithoutReleasesTest.php
index 1e58531..4674096 100644
--- a/tests/Command/BuiltIn/DeployCommandWithoutReleasesTest.php
+++ b/tests/Command/BuiltIn/DeployCommandWithoutReleasesTest.php
@@ -14,7 +14,7 @@ use Mage\Command\BuiltIn\DeployCommand;
use Mage\Command\AbstractCommand;
use Mage\Tests\MageApplicationMockup;
use Symfony\Component\Console\Tester\CommandTester;
-use PHPUnit_Framework_TestCase as TestCase;
+use PHPUnit\Framework\TestCase;
class DeployCommandWithoutReleasesTest extends TestCase
{
@@ -40,7 +40,7 @@ class DeployCommandWithoutReleasesTest extends TestCase
5 => 'rsync -e "ssh -p 22 -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no" -avz --exclude=.git --exclude=./var/cache/* --exclude=./var/log/* --exclude=./web/app_dev.php ./ tester@testhost:/var/www/test',
6 => 'ssh -p 22 -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no tester@testhost "cd /var/www/test && bin/console cache:warmup --env=dev"',
7 => 'ssh -p 22 -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no tester@testhost "cd /var/www/test && bin/console assets:install web --env=dev --symlink --relative"',
- 8 => 'ssh -p 22 -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no tester@testhost "cd /var/www/test && bin/console assetic:dump --env=dev"',
+ 8 => 'ssh -p 22 -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no tester@testhost "cd /var/www/test && bin/console cache:pool:prune --env=dev"',
9 => 'git checkout master',
);
@@ -77,7 +77,7 @@ class DeployCommandWithoutReleasesTest extends TestCase
5 => 'rsync -e "ssh -p 202 -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no" -avz --exclude=.git --exclude=./var/cache/* --exclude=./var/log/* --exclude=./web/app_dev.php ./ tester@testhost:/var/www/test',
6 => 'ssh -p 202 -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no tester@testhost "cd /var/www/test && bin/console cache:warmup --env=dev"',
7 => 'ssh -p 202 -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no tester@testhost "cd /var/www/test && bin/console assets:install web --env=dev --symlink --relative"',
- 8 => 'ssh -p 202 -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no tester@testhost "cd /var/www/test && bin/console assetic:dump --env=dev"',
+ 8 => 'ssh -p 202 -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no tester@testhost "cd /var/www/test && bin/console cache:pool:prune --env=dev"',
9 => 'git checkout master',
);
@@ -114,7 +114,7 @@ class DeployCommandWithoutReleasesTest extends TestCase
5 => 'rsync -e "ssh -p 22 -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no" -avz --exclude=.git --exclude=./var/cache/* --exclude=./var/log/* --exclude=./web/app_dev.php ./dist tester@testhost:/var/www/test',
6 => 'ssh -p 22 -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no tester@testhost "cd /var/www/test && bin/console cache:warmup --env=dev"',
7 => 'ssh -p 22 -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no tester@testhost "cd /var/www/test && bin/console assets:install web --env=dev --symlink --relative"',
- 8 => 'ssh -p 22 -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no tester@testhost "cd /var/www/test && bin/console assetic:dump --env=dev"',
+ 8 => 'ssh -p 22 -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no tester@testhost "cd /var/www/test && bin/console cache:pool:prune --env=dev"',
9 => 'git checkout master',
);
diff --git a/tests/Command/BuiltIn/Releases/ListCommandTest.php b/tests/Command/BuiltIn/Releases/ListCommandTest.php
index 0d560cc..8c06412 100644
--- a/tests/Command/BuiltIn/Releases/ListCommandTest.php
+++ b/tests/Command/BuiltIn/Releases/ListCommandTest.php
@@ -14,7 +14,7 @@ use Mage\Command\BuiltIn\Releases\ListCommand;
use Mage\Command\AbstractCommand;
use Mage\Tests\MageApplicationMockup;
use Symfony\Component\Console\Tester\CommandTester;
-use PHPUnit_Framework_TestCase as TestCase;
+use PHPUnit\Framework\TestCase;
class ListCommandTest extends TestCase
{
diff --git a/tests/Command/BuiltIn/Releases/RollbackCommandTest.php b/tests/Command/BuiltIn/Releases/RollbackCommandTest.php
index 778c7a5..17406dd 100644
--- a/tests/Command/BuiltIn/Releases/RollbackCommandTest.php
+++ b/tests/Command/BuiltIn/Releases/RollbackCommandTest.php
@@ -14,7 +14,7 @@ use Mage\Command\BuiltIn\Releases\RollbackCommand;
use Mage\Command\AbstractCommand;
use Mage\Tests\MageApplicationMockup;
use Symfony\Component\Console\Tester\CommandTester;
-use PHPUnit_Framework_TestCase as TestCase;
+use PHPUnit\Framework\TestCase;
class RollbackCommandTest extends TestCase
{
diff --git a/tests/Command/BuiltIn/VersionCommandTest.php b/tests/Command/BuiltIn/VersionCommandTest.php
index 2f83891..239b547 100644
--- a/tests/Command/BuiltIn/VersionCommandTest.php
+++ b/tests/Command/BuiltIn/VersionCommandTest.php
@@ -15,7 +15,7 @@ use Mage\Command\BuiltIn\VersionCommand;
use Mage\Tests\MageApplicationMockup;
use Mage\Mage;
use Symfony\Component\Console\Tester\CommandTester;
-use PHPUnit_Framework_TestCase as TestCase;
+use PHPUnit\Framework\TestCase;
class VersionCommandTest extends TestCase
{
diff --git a/tests/Deploy/StrategyTest.php b/tests/Deploy/StrategyTest.php
index fd3997d..c54beed 100644
--- a/tests/Deploy/StrategyTest.php
+++ b/tests/Deploy/StrategyTest.php
@@ -15,7 +15,7 @@ use Mage\Deploy\Strategy\RsyncStrategy;
use Mage\Runtime\Exception\RuntimeException;
use Mage\Runtime\Runtime;
use Exception;
-use PHPUnit_Framework_TestCase as TestCase;
+use PHPUnit\Framework\TestCase;
class StrategyTest extends TestCase
{
diff --git a/tests/MageApplicationTest.php b/tests/MageApplicationTest.php
index 4694fe1..891cd9d 100644
--- a/tests/MageApplicationTest.php
+++ b/tests/MageApplicationTest.php
@@ -14,7 +14,7 @@ use Mage\MageApplication;
use Mage\Runtime\Exception\RuntimeException;
use Symfony\Component\Console\Tester\ApplicationTester;
use Exception;
-use PHPUnit_Framework_TestCase as TestCase;
+use PHPUnit\Framework\TestCase;
class MageApplicationTest extends TestCase
{
diff --git a/tests/Resources/basic.yml b/tests/Resources/basic.yml
index a916c32..28c7978 100644
--- a/tests/Resources/basic.yml
+++ b/tests/Resources/basic.yml
@@ -21,7 +21,7 @@ magephp:
on-deploy:
- symfony/cache-warmup: { env: 'dev' }
- symfony/assets-install: { env: 'dev' }
- - symfony/assetic-dump: { env: 'dev' }
+ - symfony/cache-pool-prune: { env: 'dev' }
on-release:
post-release:
post-deploy:
\ No newline at end of file
diff --git a/tests/Resources/invalid-log.yml b/tests/Resources/invalid-log.yml
index d6321c5..96416a9 100644
--- a/tests/Resources/invalid-log.yml
+++ b/tests/Resources/invalid-log.yml
@@ -21,7 +21,7 @@ magephp:
on-deploy:
- symfony/cache-warmup: { env: 'dev' }
- symfony/assets-install: { env: 'dev' }
- - symfony/assetic-dump: { env: 'dev' }
+ - symfony/cache-pool-prune: { env: 'dev' }
on-release:
post-release:
post-deploy:
\ No newline at end of file
diff --git a/tests/Resources/no-hosts.yml b/tests/Resources/no-hosts.yml
index f2ce2ef..6771cc6 100644
--- a/tests/Resources/no-hosts.yml
+++ b/tests/Resources/no-hosts.yml
@@ -17,7 +17,7 @@ magephp:
on-deploy:
- symfony/cache-warmup: { env: 'dev' }
- symfony/assets-install: { env: 'dev' }
- - symfony/assetic-dump: { env: 'dev' }
+ - symfony/cache-pool-prune: { env: 'dev' }
on-release:
post-release:
post-deploy:
\ No newline at end of file
diff --git a/tests/Resources/symfony-envconf.yml b/tests/Resources/symfony-envconf.yml
index d9c239f..3d4dff9 100644
--- a/tests/Resources/symfony-envconf.yml
+++ b/tests/Resources/symfony-envconf.yml
@@ -14,5 +14,7 @@ magephp:
on-deploy:
- symfony/cache-warmup
- symfony/assets-install
- - symfony/assetic-dump
- - symfony/assetic-dump: { env: 'prod' }
+ - symfony/cache-pool-prune
+ - symfony/cache-pool-prune: { env: 'prod' }
+ - symfony/cache-pool-clear: { pools: 'main' }
+ - symfony/cache-pool-clear: { env: 'prod', pools: 'main' }
diff --git a/tests/Resources/testhost-skipping.yml b/tests/Resources/testhost-skipping.yml
index e163bd1..5ce8f07 100644
--- a/tests/Resources/testhost-skipping.yml
+++ b/tests/Resources/testhost-skipping.yml
@@ -18,7 +18,7 @@ magephp:
on-deploy:
- symfony/cache-warmup: { env: 'dev' }
- symfony/assets-install: { env: 'dev' }
- - symfony/assetic-dump: { env: 'dev' }
+ - symfony/cache-pool-prune: { env: 'dev' }
on-release:
post-release:
post-deploy:
\ No newline at end of file
diff --git a/tests/Resources/testhost-sudo.yml b/tests/Resources/testhost-sudo.yml
index 04fd2e2..55a19ca 100644
--- a/tests/Resources/testhost-sudo.yml
+++ b/tests/Resources/testhost-sudo.yml
@@ -20,7 +20,7 @@ magephp:
- symfony/cache-clear: { env: 'dev' }
- symfony/cache-warmup: { env: 'dev' }
- symfony/assets-install: { env: 'dev' }
- - symfony/assetic-dump: { env: 'dev' }
+ - symfony/cache-pool-prune: { env: 'dev' }
on-release:
post-release:
post-deploy:
\ No newline at end of file
diff --git a/tests/Resources/testhost-with-from.yml b/tests/Resources/testhost-with-from.yml
index 228730d..1d4c91e 100644
--- a/tests/Resources/testhost-with-from.yml
+++ b/tests/Resources/testhost-with-from.yml
@@ -22,7 +22,7 @@ magephp:
on-deploy:
- symfony/cache-warmup: { env: 'dev' }
- symfony/assets-install: { env: 'dev' }
- - symfony/assetic-dump: { env: 'dev' }
+ - symfony/cache-pool-prune: { env: 'dev' }
on-release:
post-release:
post-deploy:
\ No newline at end of file
diff --git a/tests/Resources/testhost-with-port.yml b/tests/Resources/testhost-with-port.yml
index c6e5ff6..94e3ee6 100644
--- a/tests/Resources/testhost-with-port.yml
+++ b/tests/Resources/testhost-with-port.yml
@@ -21,7 +21,7 @@ magephp:
on-deploy:
- symfony/cache-warmup: { env: 'prod' }
- symfony/assets-install: { env: 'prod' }
- - symfony/assetic-dump: { env: 'prod' }
+ - symfony/cache-pool-prune: { env: 'prod' }
on-release:
post-release:
post-deploy:
\ No newline at end of file
diff --git a/tests/Resources/testhost-without-releases-with-from.yml b/tests/Resources/testhost-without-releases-with-from.yml
index d7b63ed..3520f7d 100644
--- a/tests/Resources/testhost-without-releases-with-from.yml
+++ b/tests/Resources/testhost-without-releases-with-from.yml
@@ -19,7 +19,7 @@ magephp:
on-deploy:
- symfony/cache-warmup: { env: 'dev' }
- symfony/assets-install: { env: 'dev' }
- - symfony/assetic-dump: { env: 'dev' }
+ - symfony/cache-pool-prune: { env: 'dev' }
on-release:
post-release:
post-deploy:
\ No newline at end of file
diff --git a/tests/Resources/testhost-without-releases-with-port.yml b/tests/Resources/testhost-without-releases-with-port.yml
index 9f4f184..27755a2 100644
--- a/tests/Resources/testhost-without-releases-with-port.yml
+++ b/tests/Resources/testhost-without-releases-with-port.yml
@@ -18,7 +18,7 @@ magephp:
on-deploy:
- symfony/cache-warmup: { env: 'dev' }
- symfony/assets-install: { env: 'dev' }
- - symfony/assetic-dump: { env: 'dev' }
+ - symfony/cache-pool-prune: { env: 'dev' }
on-release:
post-release:
post-deploy:
\ No newline at end of file
diff --git a/tests/Resources/testhost-without-releases.yml b/tests/Resources/testhost-without-releases.yml
index 8c09a74..7165c96 100644
--- a/tests/Resources/testhost-without-releases.yml
+++ b/tests/Resources/testhost-without-releases.yml
@@ -18,7 +18,7 @@ magephp:
on-deploy:
- symfony/cache-warmup: { env: 'dev' }
- symfony/assets-install: { env: 'dev' }
- - symfony/assetic-dump: { env: 'dev' }
+ - symfony/cache-pool-prune: { env: 'dev' }
on-release:
post-release:
post-deploy:
\ No newline at end of file
diff --git a/tests/Resources/testhost.yml b/tests/Resources/testhost.yml
index f55f9e9..b1b630e 100644
--- a/tests/Resources/testhost.yml
+++ b/tests/Resources/testhost.yml
@@ -21,7 +21,7 @@ magephp:
on-deploy:
- symfony/cache-warmup: { env: 'dev' }
- symfony/assets-install: { env: 'dev' }
- - symfony/assetic-dump: { env: 'dev' }
+ - symfony/cache-pool-prune: { env: 'dev' }
on-release:
post-release:
post-deploy:
\ No newline at end of file
diff --git a/tests/Runtime/ProcessMockup.php b/tests/Runtime/ProcessMockup.php
index f5b862b..e6d1fa6 100644
--- a/tests/Runtime/ProcessMockup.php
+++ b/tests/Runtime/ProcessMockup.php
@@ -19,7 +19,7 @@ class ProcessMockup extends Process
protected $timeout;
protected $success = true;
- public function __construct($commandline, $cwd = null, array $env = null, $input = null, $timeout = 60, array $options = array())
+ public function __construct($commandline, string $cwd = null, array $env = null, $input = null, ?float $timeout = 60)
{
$this->commandline = $commandline;
}
@@ -29,7 +29,7 @@ class ProcessMockup extends Process
$this->timeout = $timeout;
}
- public function run($callback = null)
+ public function run(callable $callback = null, array $env = array()): int
{
if (in_array($this->commandline, $this->forceFail)) {
$this->success = false;
@@ -50,6 +50,12 @@ class ProcessMockup extends Process
if ($this->commandline == 'ssh -p 22 -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no tester@hostdemo2 "ls -1 /var/www/test/releases"') {
$this->success = false;
}
+
+ if (!$this->success) {
+ return 10;
+ }
+
+ return 0;
}
public function isSuccessful()
diff --git a/tests/Runtime/RuntimeTest.php b/tests/Runtime/RuntimeTest.php
index cb1ccd9..02b43f9 100644
--- a/tests/Runtime/RuntimeTest.php
+++ b/tests/Runtime/RuntimeTest.php
@@ -15,7 +15,7 @@ use Mage\Runtime\Runtime;
use Exception;
use Monolog\Logger;
use Monolog\Handler\TestHandler;
-use PHPUnit_Framework_TestCase as TestCase;
+use PHPUnit\Framework\TestCase;
use Psr\Log\LogLevel;
use Symfony\Component\Process\Process;
use DateTime;
diff --git a/tests/Task/AbstractTaskTest.php b/tests/Task/AbstractTaskTest.php
index e18da77..595ac41 100644
--- a/tests/Task/AbstractTaskTest.php
+++ b/tests/Task/AbstractTaskTest.php
@@ -12,7 +12,7 @@ namespace Mage\Tests\Task;
use Mage\Task\Exception\ErrorException;
use Exception;
-use PHPUnit_Framework_TestCase as TestCase;
+use PHPUnit\Framework\TestCase;
class AbstractTaskTest extends TestCase
{
diff --git a/tests/Task/BuiltIn/Composer/BasicComposerTaskTest.php b/tests/Task/BuiltIn/Composer/BasicComposerTaskTest.php
index f8f63ac..6c1adc9 100644
--- a/tests/Task/BuiltIn/Composer/BasicComposerTaskTest.php
+++ b/tests/Task/BuiltIn/Composer/BasicComposerTaskTest.php
@@ -3,7 +3,7 @@
namespace Mage\Tests\Task\BuiltIn\Composer;
use Mage\Tests\Runtime\RuntimeMockup;
-use PHPUnit_Framework_TestCase as TestCase;
+use PHPUnit\Framework\TestCase;
class BasicComposerTaskTest extends TestCase
{
diff --git a/tests/Task/BuiltIn/Composer/SelfUpdateTaskTest.php b/tests/Task/BuiltIn/Composer/SelfUpdateTaskTest.php
index 1721e8b..880dec7 100644
--- a/tests/Task/BuiltIn/Composer/SelfUpdateTaskTest.php
+++ b/tests/Task/BuiltIn/Composer/SelfUpdateTaskTest.php
@@ -6,7 +6,7 @@ use Mage\Tests\Runtime\RuntimeMockup;
use Mage\Task\BuiltIn\Composer\SelfUpdateTask;
use Mage\Task\Exception\SkipException;
use Exception;
-use PHPUnit_Framework_TestCase as TestCase;
+use PHPUnit\Framework\TestCase;
class SelfUpdateTaskTest extends TestCase
{
diff --git a/tests/Task/BuiltIn/ExecTaskTest.php b/tests/Task/BuiltIn/ExecTaskTest.php
index d548176..c500ad0 100644
--- a/tests/Task/BuiltIn/ExecTaskTest.php
+++ b/tests/Task/BuiltIn/ExecTaskTest.php
@@ -14,7 +14,7 @@ use Mage\Task\Exception\ErrorException;
use Mage\Task\BuiltIn\ExecTask;
use Exception;
use Mage\Tests\Runtime\RuntimeMockup;
-use PHPUnit_Framework_TestCase as TestCase;
+use PHPUnit\Framework\TestCase;
class ExecTest extends TestCase
{
diff --git a/tests/Task/BuiltIn/FileSystem/ChangeModeTaskTest.php b/tests/Task/BuiltIn/FileSystem/ChangeModeTaskTest.php
index 79db322..2456502 100644
--- a/tests/Task/BuiltIn/FileSystem/ChangeModeTaskTest.php
+++ b/tests/Task/BuiltIn/FileSystem/ChangeModeTaskTest.php
@@ -14,7 +14,7 @@ use Mage\Task\Exception\ErrorException;
use Mage\Task\BuiltIn\FS\ChangeModeTask;
use Exception;
use Mage\Tests\Runtime\RuntimeMockup;
-use PHPUnit_Framework_TestCase as TestCase;
+use PHPUnit\Framework\TestCase;
class ChangeModeTest extends TestCase
{
diff --git a/tests/Task/BuiltIn/FileSystem/CopyTaskTest.php b/tests/Task/BuiltIn/FileSystem/CopyTaskTest.php
index 1d91d1a..0242b97 100644
--- a/tests/Task/BuiltIn/FileSystem/CopyTaskTest.php
+++ b/tests/Task/BuiltIn/FileSystem/CopyTaskTest.php
@@ -14,7 +14,7 @@ use Mage\Task\Exception\ErrorException;
use Mage\Task\BuiltIn\FS\CopyTask;
use Exception;
use Mage\Tests\Runtime\RuntimeMockup;
-use PHPUnit_Framework_TestCase as TestCase;
+use PHPUnit\Framework\TestCase;
class CopyTaskTest extends TestCase
{
diff --git a/tests/Task/BuiltIn/FileSystem/LinkTaskTest.php b/tests/Task/BuiltIn/FileSystem/LinkTaskTest.php
index 5869709..f7bd858 100644
--- a/tests/Task/BuiltIn/FileSystem/LinkTaskTest.php
+++ b/tests/Task/BuiltIn/FileSystem/LinkTaskTest.php
@@ -14,7 +14,7 @@ use Mage\Task\Exception\ErrorException;
use Mage\Task\BuiltIn\FS\LinkTask;
use Exception;
use Mage\Tests\Runtime\RuntimeMockup;
-use PHPUnit_Framework_TestCase as TestCase;
+use PHPUnit\Framework\TestCase;
class LinkTaskTest extends TestCase
{
diff --git a/tests/Task/BuiltIn/FileSystem/MoveTaskTest.php b/tests/Task/BuiltIn/FileSystem/MoveTaskTest.php
index 4fdab3d..fb8cea6 100644
--- a/tests/Task/BuiltIn/FileSystem/MoveTaskTest.php
+++ b/tests/Task/BuiltIn/FileSystem/MoveTaskTest.php
@@ -14,7 +14,7 @@ use Mage\Task\Exception\ErrorException;
use Mage\Task\BuiltIn\FS\MoveTask;
use Exception;
use Mage\Tests\Runtime\RuntimeMockup;
-use PHPUnit_Framework_TestCase as TestCase;
+use PHPUnit\Framework\TestCase;
class MoveTaskTest extends TestCase
{
diff --git a/tests/Task/BuiltIn/FileSystem/RemoveTaskTest.php b/tests/Task/BuiltIn/FileSystem/RemoveTaskTest.php
index 4b050a4..1b2a0ad 100644
--- a/tests/Task/BuiltIn/FileSystem/RemoveTaskTest.php
+++ b/tests/Task/BuiltIn/FileSystem/RemoveTaskTest.php
@@ -14,7 +14,7 @@ use Mage\Task\Exception\ErrorException;
use Mage\Task\BuiltIn\FS\RemoveTask;
use Exception;
use Mage\Tests\Runtime\RuntimeMockup;
-use PHPUnit_Framework_TestCase as TestCase;
+use PHPUnit\Framework\TestCase;
class RemoveTaskTest extends TestCase
{
diff --git a/tests/Task/BuiltIn/Symfony/AsseticDumpTaskTest.php b/tests/Task/BuiltIn/Symfony/AsseticDumpTaskTest.php
deleted file mode 100644
index e1f694e..0000000
--- a/tests/Task/BuiltIn/Symfony/AsseticDumpTaskTest.php
+++ /dev/null
@@ -1,70 +0,0 @@
-runtime = new RuntimeMockup();
- $this->runtime->setConfiguration(['environments' => ['test' => []]]);
- $this->runtime->setEnvironment('test');
- }
-
- public function testAsseticDumpTask()
- {
- $task = new AsseticDumpTask();
- $task->setOptions(['env' => 'test']);
- $task->setRuntime($this->runtime);
- $this->assertEquals('[Symfony] Assetic Dump', $task->getDescription());
- $task->execute();
-
- $testCase = [
- 'bin/console assetic:dump --env=test' => 120,
- ];
-
- $this->assertRanCommands($testCase);
- }
-
- public function testAsseticDumpTaskWithTimeoutOption()
- {
- $task = new AsseticDumpTask();
- $task->setOptions(['env' => 'test', 'timeout' => 300]);
- $task->setRuntime($this->runtime);
- $task->execute();
-
-
- $testCase = [
- 'bin/console assetic:dump --env=test' => 300,
- ];
-
- $this->assertRanCommands($testCase);
- }
-
- /**
- * @param $testCase
- */
- private function assertRanCommands($testCase)
- {
- $ranCommands = $this->runtime->getRanCommands();
-
- // Check total of Executed Commands
- $this->assertEquals(count($testCase), count($ranCommands));
-
- // Check Generated Commands
- $index = 0;
- foreach ($testCase as $command => $timeout) {
- $this->assertEquals($command, $ranCommands[$index++]);
- $this->assertEquals($timeout, $this->runtime->getRanCommandTimeoutFor($command));
- }
- }
-}
diff --git a/tests/Task/BuiltIn/Symfony/CachePoolClearTaskTest.php b/tests/Task/BuiltIn/Symfony/CachePoolClearTaskTest.php
new file mode 100644
index 0000000..0aa8098
--- /dev/null
+++ b/tests/Task/BuiltIn/Symfony/CachePoolClearTaskTest.php
@@ -0,0 +1,38 @@
+runtime = new RuntimeMockup();
+ $this->runtime->setConfiguration(['environments' => ['test' => []]]);
+ $this->runtime->setEnvironment('test');
+ }
+
+ public function testAsseticDumpTask()
+ {
+ $task = new CachePoolClearTask();
+ $task->setOptions(['env' => 'test']);
+ $task->setRuntime($this->runtime);
+ $this->assertEquals('[Symfony] Cache Pool Clear', $task->getDescription());
+
+ try {
+ $task->execute();
+ } catch (ErrorException $exception) {
+ $this->assertEquals('Parameter "pools" is not defined', $exception->getMessage());
+ }
+ }
+}
\ No newline at end of file
diff --git a/tests/Task/TaskFactoryTest.php b/tests/Task/TaskFactoryTest.php
index 110c4f0..0698669 100644
--- a/tests/Task/TaskFactoryTest.php
+++ b/tests/Task/TaskFactoryTest.php
@@ -17,7 +17,7 @@ use Mage\Runtime\Runtime;
use Mage\Runtime\Exception\RuntimeException;
use Exception;
use Mage\Tests\MageApplicationMockup;
-use PHPUnit_Framework_TestCase as TestCase;
+use PHPUnit\Framework\TestCase;
use Symfony\Component\Console\Tester\CommandTester;
class TaskFactoryTest extends TestCase
diff --git a/tests/UtilsTest.php b/tests/UtilsTest.php
index 0790a9d..8a62543 100644
--- a/tests/UtilsTest.php
+++ b/tests/UtilsTest.php
@@ -13,7 +13,7 @@ namespace Mage\Tests;
use Mage\Utils;
use Mage\Runtime\Runtime;
use DateTime;
-use PHPUnit_Framework_TestCase as TestCase;
+use PHPUnit\Framework\TestCase;
class UtilsTest extends TestCase
{