From f47208482940811f7d380bf964473fca3927907c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9s=20Monta=C3=B1ez?= Date: Sun, 1 Jan 2017 01:34:14 -0300 Subject: [PATCH] [Nostromo] PSR-2 --- .../Command/BuiltIn/DeployCommandTest.php | 79 +++++++++---------- .../BuiltIn/Releases/ListCommandTest.php | 41 +++++----- .../BuiltIn/Releases/RollbackCommandTest.php | 41 +++++----- .../Command/BuiltIn/VersionCommandTest.php | 3 +- src/Mage/Tests/Runtime/ProcessMockup.php | 3 +- src/Mage/Tests/Runtime/RuntimeMockup.php | 2 +- 6 files changed, 82 insertions(+), 87 deletions(-) diff --git a/src/Mage/Tests/Command/BuiltIn/DeployCommandTest.php b/src/Mage/Tests/Command/BuiltIn/DeployCommandTest.php index 339e1d4..5d49798 100644 --- a/src/Mage/Tests/Command/BuiltIn/DeployCommandTest.php +++ b/src/Mage/Tests/Command/BuiltIn/DeployCommandTest.php @@ -1,7 +1,6 @@ add(new DeployCommand()); $runtime = new RuntimeMockup(); - $runtime->setConfiguration(array ( + $runtime->setConfiguration(array( 'environments' => - array ( + array( 'test' => - array ( + array( 'user' => 'tester', 'branch' => 'test', 'host_path' => '/var/www/test', 'releases' => 4, 'exclude' => - array ( + array( 0 => 'vendor', 1 => 'app/cache', 2 => 'app/log', 3 => 'web/app_dev.php', ), 'hosts' => - array ( + array( 0 => 'testhost', ), 'pre-deploy' => - array ( + array( 0 => 'git/update', 1 => 'composer/install', 2 => 'composer/generate-autoload', ), 'on-deploy' => - array ( + array( 0 => - array ( + array( 'symfony/cache-clear' => - array ( + array( 'env' => 'dev', ), ), 1 => - array ( + array( 'symfony/cache-warmup' => - array ( + array( 'env' => 'dev', ), ), 2 => - array ( + array( 'symfony/assets-install' => - array ( + array( 'env' => 'dev', ), ), 3 => - array ( + array( 'symfony/assetic-dump' => - array ( + array( 'env' => 'dev', ), ), ), - 'on-release' => NULL, - 'post-release' => NULL, - 'post-deploy' => NULL, + 'on-release' => null, + 'post-release' => null, + 'post-deploy' => null, ), ), ) @@ -93,7 +92,7 @@ class DeployCommandTest extends TestCase $ranCommands = $runtime->getRanCommands(); - $testCase = array ( + $testCase = array( 0 => 'git branch | grep "*"', 1 => 'git checkout test', 2 => 'git pull', @@ -133,65 +132,65 @@ class DeployCommandTest extends TestCase $application->add(new DeployCommand()); $runtime = new RuntimeMockup(); - $runtime->setConfiguration(array ( + $runtime->setConfiguration(array( 'environments' => - array ( + array( 'test' => - array ( + array( 'user' => 'tester', 'branch' => 'test', 'host_path' => '/var/www/test', 'exclude' => - array ( + array( 0 => 'vendor', 1 => 'app/cache', 2 => 'app/log', 3 => 'web/app_dev.php', ), 'hosts' => - array ( + array( 0 => 'testhost', ), 'pre-deploy' => - array ( + array( 0 => 'git/update', 1 => 'composer/install', 2 => 'composer/generate-autoload', ), 'on-deploy' => - array ( + array( 0 => - array ( + array( 'symfony/cache-clear' => - array ( + array( 'env' => 'dev', ), ), 1 => - array ( + array( 'symfony/cache-warmup' => - array ( + array( 'env' => 'dev', ), ), 2 => - array ( + array( 'symfony/assets-install' => - array ( + array( 'env' => 'dev', ), ), 3 => - array ( + array( 'symfony/assetic-dump' => - array ( + array( 'env' => 'dev', ), ), ), - 'on-release' => NULL, - 'post-release' => NULL, - 'post-deploy' => NULL, + 'on-release' => null, + 'post-release' => null, + 'post-deploy' => null, ), ), ) @@ -208,7 +207,7 @@ class DeployCommandTest extends TestCase $ranCommands = $runtime->getRanCommands(); - $testCase = array ( + $testCase = array( 0 => 'git branch | grep "*"', 1 => 'git checkout test', 2 => 'git pull', @@ -230,4 +229,4 @@ class DeployCommandTest extends TestCase $this->assertEquals($ranCommands[$index], $command); } } -} \ No newline at end of file +} diff --git a/src/Mage/Tests/Command/BuiltIn/Releases/ListCommandTest.php b/src/Mage/Tests/Command/BuiltIn/Releases/ListCommandTest.php index 0226e8d..d270bec 100644 --- a/src/Mage/Tests/Command/BuiltIn/Releases/ListCommandTest.php +++ b/src/Mage/Tests/Command/BuiltIn/Releases/ListCommandTest.php @@ -16,66 +16,66 @@ class ListCommandTest extends TestCase $application->add(new ListCommand()); $runtime = new RuntimeMockup(); - $runtime->setConfiguration(array ( + $runtime->setConfiguration(array( 'environments' => - array ( + array( 'test' => - array ( + array( 'user' => 'tester', 'branch' => 'test', 'host_path' => '/var/www/test', 'releases' => 4, 'exclude' => - array ( + array( 0 => 'vendor', 1 => 'app/cache', 2 => 'app/log', 3 => 'web/app_dev.php', ), 'hosts' => - array ( + array( 0 => 'testhost', ), 'pre-deploy' => - array ( + array( 0 => 'git/update', 1 => 'composer/install', 2 => 'composer/generate-autoload', ), 'on-deploy' => - array ( + array( 0 => - array ( + array( 'symfony/cache-clear' => - array ( + array( 'env' => 'dev', ), ), 1 => - array ( + array( 'symfony/cache-warmup' => - array ( + array( 'env' => 'dev', ), ), 2 => - array ( + array( 'symfony/assets-install' => - array ( + array( 'env' => 'dev', ), ), 3 => - array ( + array( 'symfony/assetic-dump' => - array ( + array( 'env' => 'dev', ), ), ), - 'on-release' => NULL, - 'post-release' => NULL, - 'post-deploy' => NULL, + 'on-release' => null, + 'post-release' => null, + 'post-deploy' => null, ), ), ) @@ -90,7 +90,7 @@ class ListCommandTest extends TestCase $ranCommands = $runtime->getRanCommands(); - $testCase = array ( + $testCase = array( 0 => 'ssh -p 22 -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no tester@testhost sh -c \\"ls -1 /var/www/test/releases\\"', 1 => 'ssh -p 22 -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no tester@testhost sh -c \\"readlink -f /var/www/test/current\\"', ); @@ -103,5 +103,4 @@ class ListCommandTest extends TestCase $this->assertEquals($ranCommands[$index], $command); } } - -} \ No newline at end of file +} diff --git a/src/Mage/Tests/Command/BuiltIn/Releases/RollbackCommandTest.php b/src/Mage/Tests/Command/BuiltIn/Releases/RollbackCommandTest.php index 8f4e4cc..857a37f 100644 --- a/src/Mage/Tests/Command/BuiltIn/Releases/RollbackCommandTest.php +++ b/src/Mage/Tests/Command/BuiltIn/Releases/RollbackCommandTest.php @@ -16,66 +16,66 @@ class RollbackCommandTest extends TestCase $application->add(new RollbackCommand()); $runtime = new RuntimeMockup(); - $runtime->setConfiguration(array ( + $runtime->setConfiguration(array( 'environments' => - array ( + array( 'test' => - array ( + array( 'user' => 'tester', 'branch' => 'test', 'host_path' => '/var/www/test', 'releases' => 4, 'exclude' => - array ( + array( 0 => 'vendor', 1 => 'app/cache', 2 => 'app/log', 3 => 'web/app_dev.php', ), 'hosts' => - array ( + array( 0 => 'testhost', ), 'pre-deploy' => - array ( + array( 0 => 'git/update', 1 => 'composer/install', 2 => 'composer/generate-autoload', ), 'on-deploy' => - array ( + array( 0 => - array ( + array( 'symfony/cache-clear' => - array ( + array( 'env' => 'dev', ), ), 1 => - array ( + array( 'symfony/cache-warmup' => - array ( + array( 'env' => 'dev', ), ), 2 => - array ( + array( 'symfony/assets-install' => - array ( + array( 'env' => 'dev', ), ), 3 => - array ( + array( 'symfony/assetic-dump' => - array ( + array( 'env' => 'dev', ), ), ), - 'on-release' => NULL, - 'post-release' => NULL, - 'post-deploy' => NULL, + 'on-release' => null, + 'post-release' => null, + 'post-deploy' => null, ), ), ) @@ -90,7 +90,7 @@ class RollbackCommandTest extends TestCase $ranCommands = $runtime->getRanCommands(); - $testCase = array ( + $testCase = array( 0 => 'ssh -p 22 -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no tester@testhost sh -c \\"ls -1 /var/www/test/releases\\"', 1 => 'ssh -p 22 -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no tester@testhost sh -c \\"cd /var/www/test \\&\\& ln -snf releases/20170101015115 current\\"', ); @@ -103,5 +103,4 @@ class RollbackCommandTest extends TestCase $this->assertEquals($ranCommands[$index], $command); } } - -} \ No newline at end of file +} diff --git a/src/Mage/Tests/Command/BuiltIn/VersionCommandTest.php b/src/Mage/Tests/Command/BuiltIn/VersionCommandTest.php index 12638a5..3f009f0 100644 --- a/src/Mage/Tests/Command/BuiltIn/VersionCommandTest.php +++ b/src/Mage/Tests/Command/BuiltIn/VersionCommandTest.php @@ -1,7 +1,6 @@ getDisplay()); $this->assertEquals(sprintf('Magallanes v%s [%s]', Mage::VERSION, Mage::CODENAME), $output); } -} \ No newline at end of file +} diff --git a/src/Mage/Tests/Runtime/ProcessMockup.php b/src/Mage/Tests/Runtime/ProcessMockup.php index a470107..dc2f04d 100644 --- a/src/Mage/Tests/Runtime/ProcessMockup.php +++ b/src/Mage/Tests/Runtime/ProcessMockup.php @@ -20,7 +20,6 @@ class ProcessMockup extends Process public function run($callback = null) { - } public function isSuccessful() @@ -49,4 +48,4 @@ class ProcessMockup extends Process return ''; } -} \ No newline at end of file +} diff --git a/src/Mage/Tests/Runtime/RuntimeMockup.php b/src/Mage/Tests/Runtime/RuntimeMockup.php index b80a4c0..4420cea 100644 --- a/src/Mage/Tests/Runtime/RuntimeMockup.php +++ b/src/Mage/Tests/Runtime/RuntimeMockup.php @@ -51,4 +51,4 @@ class RuntimeMockup extends Runtime { return '/tmp/mageXYZ'; } -} \ No newline at end of file +}