[Nostromo] Refactor config

This commit is contained in:
Andrés Montañez
2017-01-29 18:25:02 -03:00
parent 0b2968dfa5
commit 91da979151
12 changed files with 103 additions and 99 deletions
@@ -20,8 +20,8 @@ class DumpCommandTest extends TestCase
{
public function testConfigDumpTermination()
{
$application = new MageApplicationMockup();
$application->configure(__DIR__ . '/../../../Resources/basic.yml');
$application = new MageApplicationMockup(__DIR__ . '/../../../Resources/basic.yml');
$application->configure();
/** @var AbstractCommand $command */
$command = $application->find('config:dump');
@@ -20,8 +20,8 @@ class EnvironmentsCommandTest extends TestCase
{
public function testConfigDumpTermination()
{
$application = new MageApplicationMockup();
$application->configure(__DIR__ . '/../../../Resources/basic.yml');
$application = new MageApplicationMockup(__DIR__ . '/../../../Resources/basic.yml');
$application->configure();
/** @var AbstractCommand $command */
$command = $application->find('config:environments');
@@ -20,8 +20,8 @@ class DeployCommandMiscTasksTest extends TestCase
{
public function testSymfonyEnvironmentConfiguration()
{
$application = new MageApplicationMockup();
$application->configure(__DIR__ . '/../../Resources/symfony-envconf.yml');
$application = new MageApplicationMockup(__DIR__ . '/../../Resources/symfony-envconf.yml');
$application->configure();
/** @var AbstractCommand $command */
$command = $application->find('deploy');
@@ -53,8 +53,8 @@ class DeployCommandMiscTasksTest extends TestCase
public function testComposerFlags()
{
$application = new MageApplicationMockup();
$application->configure(__DIR__ . '/../../Resources/composer.yml');
$application = new MageApplicationMockup(__DIR__ . '/../../Resources/composer.yml');
$application->configure();
/** @var AbstractCommand $command */
$command = $application->find('deploy');
@@ -84,8 +84,8 @@ class DeployCommandMiscTasksTest extends TestCase
public function testInvalidTaskName()
{
$application = new MageApplicationMockup();
$application->configure(__DIR__ . '/../../Resources/invalid-task.yml');
$application = new MageApplicationMockup(__DIR__ . '/../../Resources/invalid-task.yml');
$application->configure();
/** @var AbstractCommand $command */
$command = $application->find('deploy');
@@ -100,8 +100,8 @@ class DeployCommandMiscTasksTest extends TestCase
public function testBrokenGitBranch()
{
$application = new MageApplicationMockup();
$application->configure(__DIR__ . '/../../Resources/broken-git-branch.yml');
$application = new MageApplicationMockup(__DIR__ . '/../../Resources/broken-git-branch.yml');
$application->configure();
/** @var AbstractCommand $command */
$command = $application->find('deploy');
@@ -119,8 +119,8 @@ class DeployCommandMiscTasksTest extends TestCase
public function testBrokenGitCheckout()
{
$application = new MageApplicationMockup();
$application->configure(__DIR__ . '/../../Resources/broken-git-branch.yml');
$application = new MageApplicationMockup(__DIR__ . '/../../Resources/broken-git-branch.yml');
$application->configure();
/** @var AbstractCommand $command */
$command = $application->find('deploy');
@@ -138,8 +138,8 @@ class DeployCommandMiscTasksTest extends TestCase
public function testBrokenGitUpdate()
{
$application = new MageApplicationMockup();
$application->configure(__DIR__ . '/../../Resources/broken-git-branch.yml');
$application = new MageApplicationMockup(__DIR__ . '/../../Resources/broken-git-branch.yml');
$application->configure();
/** @var AbstractCommand $command */
$command = $application->find('deploy');
+14 -14
View File
@@ -20,8 +20,8 @@ class DeployCommandMiscTest extends TestCase
{
public function testDeploymentWithNoHosts()
{
$application = new MageApplicationMockup();
$application->configure(__DIR__ . '/../../Resources/no-hosts.yml');
$application = new MageApplicationMockup(__DIR__ . '/../../Resources/no-hosts.yml');
$application->configure();
/** @var AbstractCommand $command */
$command = $application->find('deploy');
@@ -39,8 +39,8 @@ class DeployCommandMiscTest extends TestCase
public function testDeploymentWithSudo()
{
$application = new MageApplicationMockup();
$application->configure(__DIR__ . '/../../Resources/testhost-sudo.yml');
$application = new MageApplicationMockup(__DIR__ . '/../../Resources/testhost-sudo.yml');
$application->configure();
/** @var AbstractCommand $command */
$command = $application->find('deploy');
@@ -78,8 +78,8 @@ class DeployCommandMiscTest extends TestCase
public function testDeploymentWithBranchOverwrite()
{
$application = new MageApplicationMockup();
$application->configure(__DIR__ . '/../../Resources/testhost-without-releases.yml');
$application = new MageApplicationMockup(__DIR__ . '/../../Resources/testhost-without-releases.yml');
$application->configure();
/** @var AbstractCommand $command */
$command = $application->find('deploy');
@@ -116,8 +116,8 @@ class DeployCommandMiscTest extends TestCase
public function testDeploymentWithCustomTask()
{
$application = new MageApplicationMockup();
$application->configure(__DIR__ . '/../../Resources/testhost-custom-task.yml');
$application = new MageApplicationMockup(__DIR__ . '/../../Resources/testhost-custom-task.yml');
$application->configure();
/** @var AbstractCommand $command */
@@ -150,8 +150,8 @@ class DeployCommandMiscTest extends TestCase
public function testDeploymentWithErrorTaskCommands()
{
$application = new MageApplicationMockup();
$application->configure(__DIR__ . '/../../Resources/testhost-with-error.yml');
$application = new MageApplicationMockup(__DIR__ . '/../../Resources/testhost-with-error.yml');
$application->configure();
$application->getRuntime()->setReleaseId('20170101015120');
@@ -192,8 +192,8 @@ class DeployCommandMiscTest extends TestCase
public function testDeploymentWithFailingPostDeployTaskCommands()
{
$application = new MageApplicationMockup();
$application->configure(__DIR__ . '/../../Resources/testhost-with-postdeploy-error.yml');
$application = new MageApplicationMockup(__DIR__ . '/../../Resources/testhost-with-postdeploy-error.yml');
$application->configure();
/** @var AbstractCommand $command */
$command = $application->find('deploy');
@@ -228,8 +228,8 @@ class DeployCommandMiscTest extends TestCase
public function testDeploymentWithSkippingTask()
{
$application = new MageApplicationMockup();
$application->configure(__DIR__ . '/../../Resources/testhost-skipping.yml');
$application = new MageApplicationMockup(__DIR__ . '/../../Resources/testhost-skipping.yml');
$application->configure();
/** @var AbstractCommand $command */
$command = $application->find('deploy');
@@ -20,8 +20,8 @@ class DeployCommandWithReleasesTest extends TestCase
{
public function testDeploymentWithReleasesCommands()
{
$application = new MageApplicationMockup();
$application->configure(__DIR__ . '/../../Resources/testhost.yml');
$application = new MageApplicationMockup(__DIR__ . '/../../Resources/testhost.yml');
$application->configure();
$application->getRuntime()->setReleaseId('20170101015120');
@@ -71,8 +71,8 @@ class DeployCommandWithReleasesTest extends TestCase
public function testDeploymentWithoutReleasesTarPrepare()
{
$application = new MageApplicationMockup();
$application->configure(__DIR__ . '/../../Resources/testhost-force-tar1.yml');
$application = new MageApplicationMockup(__DIR__ . '/../../Resources/testhost-force-tar1.yml');
$application->configure();
/** @var AbstractCommand $command */
$command = $application->find('deploy');
@@ -87,8 +87,8 @@ class DeployCommandWithReleasesTest extends TestCase
public function testDeploymentWithoutReleasesTarCopy()
{
$application = new MageApplicationMockup();
$application->configure(__DIR__ . '/../../Resources/testhost-force-tar2.yml');
$application = new MageApplicationMockup(__DIR__ . '/../../Resources/testhost-force-tar2.yml');
$application->configure();
/** @var AbstractCommand $command */
$command = $application->find('deploy');
@@ -103,8 +103,8 @@ class DeployCommandWithReleasesTest extends TestCase
public function testDeploymentWithoutReleasesTarCleanup()
{
$application = new MageApplicationMockup();
$application->configure(__DIR__ . '/../../Resources/testhost-force-tar3.yml');
$application = new MageApplicationMockup(__DIR__ . '/../../Resources/testhost-force-tar3.yml');
$application->configure();
/** @var AbstractCommand $command */
$command = $application->find('deploy');
@@ -119,8 +119,8 @@ class DeployCommandWithReleasesTest extends TestCase
public function testDeploymentFailCopyCommands()
{
$application = new MageApplicationMockup();
$application->configure(__DIR__ . '/../../Resources/testhost-fail-copy-tar.yml');
$application = new MageApplicationMockup(__DIR__ . '/../../Resources/testhost-fail-copy-tar.yml');
$application->configure();
/** @var AbstractCommand $command */
$command = $application->find('deploy');
@@ -135,8 +135,8 @@ class DeployCommandWithReleasesTest extends TestCase
public function testDeploymentWithoutReleasesForceRelease()
{
$application = new MageApplicationMockup();
$application->configure(__DIR__ . '/../../Resources/testhost-force-release.yml');
$application = new MageApplicationMockup(__DIR__ . '/../../Resources/testhost-force-release.yml');
$application->configure();
/** @var AbstractCommand $command */
$command = $application->find('deploy');
@@ -151,8 +151,8 @@ class DeployCommandWithReleasesTest extends TestCase
public function testDeploymentFailToExtract()
{
$application = new MageApplicationMockup();
$application->configure(__DIR__ . '/../../Resources/testhost.yml');
$application = new MageApplicationMockup(__DIR__ . '/../../Resources/testhost.yml');
$application->configure();
$application->getRuntime()->setReleaseId('20170101015120');
@@ -194,8 +194,8 @@ class DeployCommandWithReleasesTest extends TestCase
public function testDeploymentFailToCopy()
{
$application = new MageApplicationMockup();
$application->configure(__DIR__ . '/../../Resources/testhost.yml');
$application = new MageApplicationMockup(__DIR__ . '/../../Resources/testhost.yml');
$application->configure();
$application->getRuntime()->setReleaseId('20170101015120');
@@ -236,8 +236,8 @@ class DeployCommandWithReleasesTest extends TestCase
public function testDeploymentFailCleanup()
{
$application = new MageApplicationMockup();
$application->configure(__DIR__ . '/../../Resources/testhost.yml');
$application = new MageApplicationMockup(__DIR__ . '/../../Resources/testhost.yml');
$application->configure();
$application->getRuntime()->setReleaseId('20170101015120');
@@ -290,8 +290,8 @@ class DeployCommandWithReleasesTest extends TestCase
public function testDeploymentFailMidway()
{
$application = new MageApplicationMockup();
$application->configure(__DIR__ . '/../../Resources/testhost.yml');
$application = new MageApplicationMockup(__DIR__ . '/../../Resources/testhost.yml');
$application->configure();
$application->getRuntime()->setReleaseId('20170101015120');
@@ -20,8 +20,8 @@ class DeployCommandWithoutReleasesTest extends TestCase
{
public function testDeploymentWithoutReleasesCommands()
{
$application = new MageApplicationMockup();
$application->configure(__DIR__ . '/../../Resources/testhost-without-releases.yml');
$application = new MageApplicationMockup(__DIR__ . '/../../Resources/testhost-without-releases.yml');
$application->configure();
/** @var AbstractCommand $command */
$command = $application->find('deploy');
@@ -58,8 +58,8 @@ class DeployCommandWithoutReleasesTest extends TestCase
public function testDeploymentFailMidway()
{
$application = new MageApplicationMockup();
$application->configure(__DIR__ . '/../../Resources/testhost-without-releases.yml');
$application = new MageApplicationMockup(__DIR__ . '/../../Resources/testhost-without-releases.yml');
$application->configure();
/** @var AbstractCommand $command */
$command = $application->find('deploy');
@@ -20,8 +20,8 @@ class ListCommandTest extends TestCase
{
public function testListReleasesCommands()
{
$application = new MageApplicationMockup();
$application->configure(__DIR__ . '/../../../Resources/testhost.yml');
$application = new MageApplicationMockup(__DIR__ . '/../../../Resources/testhost.yml');
$application->configure();
/** @var AbstractCommand $command */
$command = $application->find('releases:list');
@@ -48,8 +48,8 @@ class ListCommandTest extends TestCase
public function testListReleasesWithInvalidEnvironment()
{
$application = new MageApplicationMockup();
$application->configure(__DIR__ . '/../../../Resources/testhost.yml');
$application = new MageApplicationMockup(__DIR__ . '/../../../Resources/testhost.yml');
$application->configure();
/** @var AbstractCommand $command */
$command = $application->find('releases:list');
@@ -64,8 +64,8 @@ class ListCommandTest extends TestCase
public function testListReleasesWithoutReleases()
{
$application = new MageApplicationMockup();
$application->configure(__DIR__ . '/../../../Resources/testhost-without-releases.yml');
$application = new MageApplicationMockup(__DIR__ . '/../../../Resources/testhost-without-releases.yml');
$application->configure();
/** @var AbstractCommand $command */
$command = $application->find('releases:list');
@@ -80,8 +80,8 @@ class ListCommandTest extends TestCase
public function testFailToGetCurrentRelease()
{
$application = new MageApplicationMockup();
$application->configure(__DIR__ . '/../../../Resources/testhost-fail-get-current.yml');
$application = new MageApplicationMockup(__DIR__ . '/../../../Resources/testhost-fail-get-current.yml');
$application->configure();
/** @var AbstractCommand $command */
$command = $application->find('releases:list');
@@ -96,8 +96,8 @@ class ListCommandTest extends TestCase
public function testNoReleasesAvailable()
{
$application = new MageApplicationMockup();
$application->configure(__DIR__ . '/../../../Resources/testhost-no-releases.yml');
$application = new MageApplicationMockup(__DIR__ . '/../../../Resources/testhost-no-releases.yml');
$application->configure();
/** @var AbstractCommand $command */
$command = $application->find('releases:list');
@@ -111,8 +111,8 @@ class ListCommandTest extends TestCase
public function testFailGetReleases()
{
$application = new MageApplicationMockup();
$application->configure(__DIR__ . '/../../../Resources/testhost-fail-get-releases.yml');
$application = new MageApplicationMockup(__DIR__ . '/../../../Resources/testhost-fail-get-releases.yml');
$application->configure();
/** @var AbstractCommand $command */
$command = $application->find('releases:list');
@@ -127,8 +127,8 @@ class ListCommandTest extends TestCase
public function testNoHosts()
{
$application = new MageApplicationMockup();
$application->configure(__DIR__ . '/../../../Resources/testhost-no-hosts.yml');
$application = new MageApplicationMockup(__DIR__ . '/../../../Resources/testhost-no-hosts.yml');
$application->configure();
/** @var AbstractCommand $command */
$command = $application->find('releases:list');
@@ -20,8 +20,8 @@ class RollbackCommandTest extends TestCase
{
public function testRollbackReleaseCommands()
{
$application = new MageApplicationMockup();
$application->configure(__DIR__ . '/../../../Resources/testhost.yml');
$application = new MageApplicationMockup(__DIR__ . '/../../../Resources/testhost.yml');
$application->configure();
/** @var AbstractCommand $command */
$command = $application->find('releases:rollback');
@@ -48,8 +48,8 @@ class RollbackCommandTest extends TestCase
public function testRollbackReleaseWithInvalidEnvironment()
{
$application = new MageApplicationMockup();
$application->configure(__DIR__ . '/../../../Resources/testhost.yml');
$application = new MageApplicationMockup(__DIR__ . '/../../../Resources/testhost.yml');
$application->configure();
/** @var AbstractCommand $command */
$command = $application->find('releases:rollback');
@@ -64,8 +64,8 @@ class RollbackCommandTest extends TestCase
public function testRollbackReleaseWithoutReleases()
{
$application = new MageApplicationMockup();
$application->configure(__DIR__ . '/../../../Resources/testhost-without-releases.yml');
$application = new MageApplicationMockup(__DIR__ . '/../../../Resources/testhost-without-releases.yml');
$application->configure();
/** @var AbstractCommand $command */
$command = $application->find('releases:rollback');
@@ -80,8 +80,8 @@ class RollbackCommandTest extends TestCase
public function testRollbackReleaseNotAvailable()
{
$application = new MageApplicationMockup();
$application->configure(__DIR__ . '/../../../Resources/testhost-not-have-release.yml');
$application = new MageApplicationMockup(__DIR__ . '/../../../Resources/testhost-not-have-release.yml');
$application->configure();
/** @var AbstractCommand $command */
$command = $application->find('releases:rollback');
+2 -2
View File
@@ -21,8 +21,8 @@ class VersionCommandTest extends TestCase
{
public function testVersionOutput()
{
$application = new MageApplicationMockup();
$application->configure(__DIR__ . '/../../Resources/basic.yml');
$application = new MageApplicationMockup(__DIR__ . '/../../Resources/basic.yml');
$application->configure();
/** @var AbstractCommand $command */
$command = $application->find('version');