diff --git a/src/Cli/AcquiaCli.php b/src/Cli/AcquiaCli.php index 130e924..aa1abe7 100644 --- a/src/Cli/AcquiaCli.php +++ b/src/Cli/AcquiaCli.php @@ -158,6 +158,7 @@ public function injectParameters($container) $parameterInjection->register('AcquiaCloudApi\Endpoints\Insights', new AcquiaCliInjector); $parameterInjection->register('AcquiaCloudApi\Endpoints\LogForwardingDestinations', new AcquiaCliInjector); $parameterInjection->register('AcquiaCloudApi\Endpoints\SslCertificates', new AcquiaCliInjector); + $parameterInjection->register('AcquiaCloudApi\Endpoints\Organizations', new AcquiaCliInjector); } /** diff --git a/src/Commands/AcquiaCommand.php b/src/Commands/AcquiaCommand.php index 5c84715..d063b16 100644 --- a/src/Commands/AcquiaCommand.php +++ b/src/Commands/AcquiaCommand.php @@ -192,7 +192,7 @@ protected function waitForNotification($response) case self::TASKFAILED: // If there's one failure we should throw an exception throw new \Exception('Acquia task failed.'); - break(2); + break(2); // If tasks are started or in progress, we should continue back // to the top of the loop and wait until tasks are complete. case self::TASKSTARTED: @@ -203,7 +203,7 @@ protected function waitForNotification($response) break(2); default: throw new \Exception('Unknown notification status.'); - break(2); + break(2); } // Timeout if the command exceeds the configured timeout threshold. diff --git a/src/Commands/ApplicationsCommand.php b/src/Commands/ApplicationsCommand.php index dba4d1c..7505bc8 100644 --- a/src/Commands/ApplicationsCommand.php +++ b/src/Commands/ApplicationsCommand.php @@ -179,7 +179,7 @@ public function applicationTagDelete(Applications $applicationsAdapter, $uuid, $ * @param string $name * * @command application:rename - * @alias app:rename,a:rename + * @aliases app:rename,a:rename */ public function applicationRename(Applications $applicationsAdapter, $uuid, $name) { diff --git a/src/Commands/CodeCommand.php b/src/Commands/CodeCommand.php index bf9b027..68bd15d 100644 --- a/src/Commands/CodeCommand.php +++ b/src/Commands/CodeCommand.php @@ -60,9 +60,9 @@ public function code(Client $client, Code $codeAdapter, $uuid, $match = null) /** * Deploys code from one environment to another. * - * @param string $uuid - * @param string $environmentFrom - * @param string $environmentTo + * @param string $uuid + * @param string $environmentFrom + * @param string $environmentTo * * @command code:deploy * @aliases c:d diff --git a/src/Commands/CronCommand.php b/src/Commands/CronCommand.php index 792cdab..937ec73 100644 --- a/src/Commands/CronCommand.php +++ b/src/Commands/CronCommand.php @@ -18,8 +18,8 @@ class CronCommand extends AcquiaCommand /** * Shows all cron tasks associated with an environment. * - * @param string $uuid - * @param string $environment + * @param string $uuid + * @param string $environment * * @command cron:list */ @@ -55,11 +55,11 @@ public function crons(Crons $cronAdapter, $uuid, $environment) /** * Adds a new cron task for an environment. * - * @param string $uuid - * @param string $environment - * @param string $commandString The command to be run on cron wrapped in quotes. - * @param string $frequency The crontab format frequency wrapped in quotes - * @param string $label An optional label for the cron command wrapped in quotes. + * @param string $uuid + * @param string $environment + * @param string $commandString The command to be run on cron wrapped in quotes. + * @param string $frequency The crontab format frequency wrapped in quotes + * @param string $label An optional label for the cron command wrapped in quotes. * * @command cron:create * @aliases cron:add @@ -75,9 +75,9 @@ public function cronAdd(Crons $cronAdapter, $uuid, $environment, $commandString, /** * Removes a cron task for an environment. * - * @param string $uuid - * @param string $environment - * @param int $cronId + * @param string $uuid + * @param string $environment + * @param int $cronId * * @command cron:delete * @aliases cron:remove @@ -95,9 +95,9 @@ public function cronDelete(Crons $cronAdapter, $uuid, $environment, $cronId) /** * Enables a disabled cron entry. * - * @param string $uuid - * @param string $environment - * @param int $cronId + * @param string $uuid + * @param string $environment + * @param int $cronId * * @command cron:enable */ @@ -112,9 +112,9 @@ public function cronEnable(Crons $cronAdapter, $uuid, $environment, $cronId) /** * Disables an enabled cron entry. * - * @param string $uuid - * @param string $environment - * @param int $cronId + * @param string $uuid + * @param string $environment + * @param int $cronId * * @command cron:disable */ @@ -131,9 +131,9 @@ public function cronDisable(Crons $cronAdapter, $uuid, $environment, $cronId) /** * Shows detailed information about a single cron command. * - * @param string $uuid - * @param string $environment - * @param int $cronId + * @param string $uuid + * @param string $environment + * @param int $cronId * * @command cron:info */ diff --git a/src/Commands/DbBackupCommand.php b/src/Commands/DbBackupCommand.php index f94113f..c533931 100644 --- a/src/Commands/DbBackupCommand.php +++ b/src/Commands/DbBackupCommand.php @@ -27,30 +27,55 @@ class DbBackupCommand extends AcquiaCommand /** * Backs up all DBs in an environment. * - * @param string $uuid - * @param string $environment + * @param string $uuid + * @param string $environment + * + * @command database:backup:all + * @aliases db:backup:all + */ + public function dbBackupAll($uuid, $environment) + { + $environment = $this->cloudapiService->getEnvironment($uuid, $environment); + $this->backupAllEnvironmentDbs($uuid, $environment); + } + + /** + * Backs up a DB in an environment. + * + * @param string $uuid + * @param string $environment + * @param string $dbName * * @command database:backup * @aliases db:backup */ - public function dbBackup($uuid, $environment) + public function dbBackup(Databases $databaseAdapter, $uuid, $environment, $dbName) { $environment = $this->cloudapiService->getEnvironment($uuid, $environment); - $this->backupAllEnvironmentDbs($uuid, $environment); + + // @TODO replace this call with a specific API call. + // https://cloudapi-docs.acquia.com/#/Environments/getEnvironmentsDatabase + $databases = $databaseAdapter->getAll($uuid); + foreach ($databases as $database) { + if ($database->name === $dbName) { + $this->backupDb($uuid, $environment, $database); + } + } } /** * Shows a list of database backups for all databases in an environment. * - * @param string $uuid - * @param string $environment - * @param string $dbName + * @param string $uuid + * @param string $environment + * @param string $dbName * * @command database:backup:list * @aliases db:backup:list */ public function dbBackupList( Client $client, + Databases $databaseAdapter, DatabaseBackups $databaseBackupsAdapter, $uuid, $environment, @@ -61,8 +86,7 @@ public function dbBackupList( if (null !== $dbName) { $client->addQuery('filter', "name=${dbName}"); } - $dbAdapter = new Databases($this->cloudapi); - $databases = $dbAdapter->getAll($uuid); + $databases = $databaseAdapter->getAll($uuid); $client->clearQuery(); $table = new Table($this->output()); @@ -97,10 +121,10 @@ public function dbBackupList( /** * Restores a database from a saved backup. * - * @param string $uuid - * @param string $environment - * @param string $dbName - * @param int $backupId + * @param string $uuid + * @param string $environment + * @param string $dbName + * @param int $backupId * * @command database:backup:restore * @aliases db:backup:restore @@ -122,10 +146,10 @@ public function dbBackupRestore(DatabaseBackups $databaseBackupsAdapter, $uuid, /** * Provides a database backup link. * - * @param string $uuid - * @param string $environment - * @param string $dbName - * @param int $backupId + * @param string $uuid + * @param string $environment + * @param string $dbName + * @param int $backupId * * @command database:backup:link * @aliases db:backup:link @@ -148,9 +172,9 @@ public function dbBackupLink($uuid, $environment, $dbName, $backupId) /** * Downloads a database backup. * - * @param string $uuid - * @param string $environment - * @param string $dbName + * @param string $uuid + * @param string $environment + * @param string $dbName * * @throws \Exception * diff --git a/src/Commands/DbCommand.php b/src/Commands/DbCommand.php index fdcb3e0..a7652d4 100644 --- a/src/Commands/DbCommand.php +++ b/src/Commands/DbCommand.php @@ -19,15 +19,6 @@ class DbCommand extends AcquiaCommand { - protected $databaseAdapter; - - public function __construct() - { - parent::__construct(); - - $this->databaseAdapter = new Databases($this->cloudapi); - } - /** * Shows all databases. * @@ -36,9 +27,9 @@ public function __construct() * @command database:list * @aliases db:list */ - public function dbList($uuid) + public function dbList(Databases $databaseAdapter, $uuid) { - $databases = $this->databaseAdapter->getAll($uuid); + $databases = $databaseAdapter->getAll($uuid); $table = new Table($this->output()); $table->setHeaders(['Databases']); foreach ($databases as $database) { @@ -63,9 +54,9 @@ public function dbList($uuid) * @command database:create * @aliases database:add,db:create,db:add */ - public function dbCreate($uuid, $dbName) + public function dbCreate(Databases $databaseAdapter, $uuid, $dbName) { - $response = $this->databaseAdapter->create($uuid, $dbName); + $response = $databaseAdapter->create($uuid, $dbName); $this->say(sprintf('Creating database (%s)', $dbName)); $this->waitForNotification($response); } @@ -79,17 +70,17 @@ public function dbCreate($uuid, $dbName) * @command database:delete * @aliases database:remove,db:remove,db:delete */ - public function dbDelete($uuid, $dbName) + public function dbDelete(Databases $databaseAdapter, $uuid, $dbName) { if ($this->confirm('Are you sure you want to delete this database?')) { $this->say(sprintf('Deleting database (%s)', $dbName)); - $response = $this->databaseAdapter->delete($uuid, $dbName); + $response = $databaseAdapter->delete($uuid, $dbName); $this->waitForNotification($response); } } /** - * Truncaates a database. + * Truncates a database (only applicable to Acquia free tier). * * @param string $uuid * @param string $dbName @@ -97,11 +88,11 @@ public function dbDelete($uuid, $dbName) * @command database:truncate * @aliases db:truncate */ - public function dbTruncate($uuid, $dbName) + public function dbTruncate(Databases $databaseAdapter, $uuid, $dbName) { if ($this->confirm('Are you sure you want to truncate this database?')) { $this->say(sprintf('Truncate database (%s)', $dbName)); - $response = $this->databaseAdapter->truncate($uuid, $dbName); + $response = $databaseAdapter->truncate($uuid, $dbName); $this->waitForNotification($response); } } diff --git a/src/Commands/DomainCommand.php b/src/Commands/DomainCommand.php index 59de411..f0335c5 100644 --- a/src/Commands/DomainCommand.php +++ b/src/Commands/DomainCommand.php @@ -70,6 +70,8 @@ public function domainInfo(OutputInterface $output, Domains $domainAdapter, $uui $table = new Table($output); $table->setHeaders(['Hostname', 'Active', 'DNS Resolves', 'IP Addresses', 'CNAMES']); + $table->setColumnStyle(1, 'center-align'); + $table->setColumnStyle(2, 'center-align'); $table ->addRows( [ @@ -94,7 +96,7 @@ public function domainInfo(OutputInterface $output, Domains $domainAdapter, $uui * @param string $domain * * @command domain:create - * @alias domain:add + * @aliases domain:add */ public function domainCreate(Domains $domainAdapter, $uuid, $environment, $domain) { @@ -112,7 +114,7 @@ public function domainCreate(Domains $domainAdapter, $uuid, $environment, $domai * @param string $domain * * @command domain:delete - * @alias domain:remove + * @aliases domain:remove */ public function domainDelete(Domains $domainAdapter, $uuid, $environment, $domain) { diff --git a/src/Commands/EnvironmentsCommand.php b/src/Commands/EnvironmentsCommand.php index a3d7735..2a2826e 100644 --- a/src/Commands/EnvironmentsCommand.php +++ b/src/Commands/EnvironmentsCommand.php @@ -204,7 +204,7 @@ protected function renderEnvironmentInfo(EnvironmentResponse $environment, Serve * @param string $name * * @command environment:rename - * @alias env:rename,e:rename + * @aliases env:rename,e:rename */ public function environmentRename(Environments $environmentsAdapter, $uuid, $environment, $name) { @@ -220,12 +220,12 @@ public function environmentRename(Environments $environmentsAdapter, $uuid, $env * @param string $environment * * @command environment:delete - * @alias env:delete,e:d,environment:remove,env:remove + * @aliases env:delete,e:d,environment:remove,env:remove */ public function environmentDelete(Environments $environmentsAdapter, $uuid, $environment) { $environment = $this->cloudapiService->getEnvironment($uuid, $environment); - if ($this->confirm("Are you sure you want to delete this environment?")) { + if ($this->confirm(sprintf('Are you sure you want to delete the %s environment?', $environment->label))) { $this->say(sprintf('Deleting %s environment', $environment->label)); $response = $environmentsAdapter->delete($environment->uuid); $this->waitForNotification($response); diff --git a/src/Commands/LogForwardCommand.php b/src/Commands/LogForwardCommand.php index 2ca7cce..e263938 100644 --- a/src/Commands/LogForwardCommand.php +++ b/src/Commands/LogForwardCommand.php @@ -62,7 +62,7 @@ public function logforwardList( } /** - * Gets information about a Log ForwaRD. + * Gets information about a Log Forward. * * @param string $uuid * @param string $environment diff --git a/src/Commands/LogsCommand.php b/src/Commands/LogsCommand.php index 7138023..dc8efb7 100644 --- a/src/Commands/LogsCommand.php +++ b/src/Commands/LogsCommand.php @@ -24,9 +24,9 @@ class LogsCommand extends AcquiaCommand /** * Streams logs from an environment. * - * @param string $uuid - * @param string $environment - * @param array $opts + * @param string $uuid + * @param string $environment + * @param array $opts * @option $colourise Colourise the output * @option $logtypes Filter to specific log types * @option $servers Filter to specific servers diff --git a/src/Commands/NotificationsCommand.php b/src/Commands/NotificationsCommand.php index 9fbad1d..33549de 100644 --- a/src/Commands/NotificationsCommand.php +++ b/src/Commands/NotificationsCommand.php @@ -26,7 +26,7 @@ class NotificationsCommand extends AcquiaCommand * A leading "~" in the field indicates the field should be sorted in a descending order. * * @command notification:list - * @alias n:l + * @aliases n:l */ public function notificationList( Config $config, @@ -85,7 +85,7 @@ public function notificationList( * @param string $notificationUuid * * @command notification:info - * @alias n:i + * @aliases n:i * @throws \Exception */ public function notificationInfo(Config $config, Notifications $notificationsAdapter, $uuid, $notificationUuid) diff --git a/src/Commands/OrganizationsCommand.php b/src/Commands/OrganizationsCommand.php index 0725a71..7d40104 100644 --- a/src/Commands/OrganizationsCommand.php +++ b/src/Commands/OrganizationsCommand.php @@ -19,24 +19,15 @@ class OrganizationsCommand extends AcquiaCommand { - protected $organizationsAdapter; - - public function __construct() - { - parent::__construct(); - - $this->organizationsAdapter = new Organizations($this->cloudapi); - } - /** * Shows a list of all organizations. * * @command organization:list * @aliases org:list,o:l */ - public function showOrganizations() + public function showOrganizations(Organizations $organizationsAdapter) { - $organizations = $this->organizationsAdapter->getAll(); + $organizations = $organizationsAdapter->getAll(); $table = new Table($this->output()); $table->setHeaders(['UUID', 'Organization', 'Owner', 'Subs', 'Admins', 'Users', 'Teams', 'Roles']); @@ -67,19 +58,17 @@ public function showOrganizations() /** * Shows a list of all applications within an organization. * - * @param string $organization + * @param string $organization * * @command organization:applications * @aliases org:apps,o:a */ - public function organizationApplications($organization) + public function organizationApplications(Organizations $organizationsAdapter, $organization) { $organization = $this->cloudapiService->getOrganization($organization); + $applications = $organizationsAdapter->getApplications($organization->uuid); - $organizationUuid = $organization->uuid; - $applications = $this->organizationsAdapter->getApplications($organizationUuid); - - $this->say("Applications in organisation: ${organizationUuid}"); + $this->say(sprintf('Applications in organisation: %s', $organization->uuid)); $table = new Table($this->output()); $table->setHeaders(['UUID', 'Name', 'Type', 'Hosting ID']); foreach ($applications as $application) { @@ -105,19 +94,17 @@ public function organizationApplications($organization) /** * Shows teams within an organization. * - * @param string $organization + * @param string $organization * * @command organization:teams * @aliases org:teams,o:t */ - public function organizationTeams($organization) + public function organizationTeams(Organizations $organizationsAdapter, $organization) { $organization = $this->cloudapiService->getOrganization($organization); + $teams = $organizationsAdapter->getTeams($organization->uuid); - $organizationUuid = $organization->uuid; - $teams = $this->organizationsAdapter->getTeams($organizationUuid); - - $this->say("Teams in organisation: ${organizationUuid}"); + $this->say(sprintf('Teams in organisation: %s', $organization->uuid)); $table = new Table($this->output()); $table->setHeaders(['UUID', 'Name']); foreach ($teams as $team) { @@ -141,19 +128,19 @@ public function organizationTeams($organization) /** * Shows all members. * - * @param string $organization + * @param string $organization * * @command organization:members * @aliases org:members,o:m */ - public function members($organization) + public function members(Organizations $organizationsAdapter, $organization) { $organization = $this->cloudapiService->getOrganization($organization); $organizationUuid = $organization->uuid; - $admins = $this->organizationsAdapter->getAdmins($organizationUuid); - $members = $this->organizationsAdapter->getMembers($organizationUuid); + $admins = $organizationsAdapter->getAdmins($organization->uuid); + $members = $organizationsAdapter->getMembers($organization->uuid); - $this->say("Members in organisation: ${organizationUuid}"); + $this->say(sprintf('Members in organisation: %s', $organization->uuid)); $table = new Table($this->output()); $table ->setHeaders(['UUID', 'Username', 'Mail', 'Teams(s)']) diff --git a/src/Commands/SetupCommand.php b/src/Commands/SetupCommand.php index 1789ce5..4e88216 100644 --- a/src/Commands/SetupCommand.php +++ b/src/Commands/SetupCommand.php @@ -2,8 +2,8 @@ namespace AcquiaCli\Commands; -use Robo\Robo; use Robo\Tasks; +use AcquiaCli\Cli\Config; use Symfony\Component\Yaml\Yaml; /** @@ -14,28 +14,20 @@ class SetupCommand extends Tasks { - protected $configFiles; - - /** - * AcquiaCommand constructor. - */ - public function __construct() - { - $this->configFiles = [ - 'global' => Robo::config()->get('config.global'), - 'project' => Robo::config()->get('config.project'), - ]; - } - /** * Performs a check of the config files and provides a view of the parameters provided. Allows the user to create * new config files with correct parameters. * * @command setup */ - public function setup() + public function setup(Config $config) { - foreach ($this->configFiles as $type => $location) { + $configFiles = [ + 'global' => $config->get('config.global'), + 'project' => $config->get('config.project'), + ]; + + foreach ($configFiles as $type => $location) { $this->say(sprintf('Checking %s configuration at %s', $type, $location)); if (file_exists($location)) { $this->yell(sprintf('%s configuration file found', $type)); diff --git a/src/Commands/TeamsCommand.php b/src/Commands/TeamsCommand.php index 806e920..d1addb9 100644 --- a/src/Commands/TeamsCommand.php +++ b/src/Commands/TeamsCommand.php @@ -37,14 +37,14 @@ public function teamCreate(Teams $teamsAdapter, $organization, $name) * Invites a user to a team. * * @param string $teamUuid - * @param string $email The email address for the user that needs to be invited. - * @param string $roles A comma separated list of roles that a user should be invited to. + * @param string $email The email address for the user that needs to be invited. + * @param string $roleUuids A comma separated list of role UUIDs that a user should be invited to. * * @command team:invite */ - public function teamInvite(Teams $teamsAdapter, $teamUuid, $email, $roles) + public function teamInvite(Teams $teamsAdapter, $teamUuid, $email, $roleUuids) { - $rolesArray = explode(',', $roles); + $rolesArray = explode(',', $roleUuids); $this->say(sprintf('Inviting %s to team.', $email)); $teamsAdapter->invite($teamUuid, $email, $rolesArray); } @@ -56,7 +56,7 @@ public function teamInvite(Teams $teamsAdapter, $teamUuid, $email, $roles) * @param string $teamUuid * * @command team:addapplication - * @alias team:addapp + * @aliases team:addapp */ public function teamAddApplication(Teams $teamsAdapter, $uuid, $teamUuid) { @@ -150,7 +150,7 @@ public function roleUpdatePermissions(Roles $rolesAdapter, $roleUuid, $permissio /** * Shows all roles within an organization. * - * @param string $organization + * @param string $organization * * @command role:list */ diff --git a/src/Commands/VariablesCommand.php b/src/Commands/VariablesCommand.php index b68a2b2..b8eef25 100644 --- a/src/Commands/VariablesCommand.php +++ b/src/Commands/VariablesCommand.php @@ -54,7 +54,7 @@ public function variablesList(CloudApi $cloudapi, Variables $variablesAdapter, $ } /** - * Gets information about a domain. + * Gets information about a variable. * * @param string $uuid * @param string $environment diff --git a/src/Injector/AcquiaCliInjector.php b/src/Injector/AcquiaCliInjector.php index 3d25849..09ccf51 100644 --- a/src/Injector/AcquiaCliInjector.php +++ b/src/Injector/AcquiaCliInjector.php @@ -23,6 +23,7 @@ use AcquiaCloudApi\Endpoints\Insights; use AcquiaCloudApi\Endpoints\LogForwardingDestinations; use AcquiaCloudApi\Endpoints\SslCertificates; +use AcquiaCloudApi\Endpoints\Organizations; class AcquiaCliInjector implements ParameterInjector { @@ -87,6 +88,8 @@ public function get(CommandData $commandData, $interfaceName) return new LogForwardingDestinations($this->client); case 'AcquiaCloudApi\Endpoints\SslCertificates': return new SslCertificates($this->client); + case 'AcquiaCloudApi\Endpoints\Organizations': + return new Organizations($this->client); } } } diff --git a/tests/AcquiaCliApplicationTest.php b/tests/AcquiaCliApplicationTest.php index 8c577f5..29c057a 100644 --- a/tests/AcquiaCliApplicationTest.php +++ b/tests/AcquiaCliApplicationTest.php @@ -111,7 +111,7 @@ public function testWaitForNotifications() { $config = new Config($this->root); - $command = ['acquiacli', '--yes', 'db:backup', 'devcloud:devcloud2', 'dev']; + $command = ['acquiacli', '--yes', 'db:backup', 'devcloud:devcloud2', 'dev', 'database1']; $input = new ArgvInput($command); $output = new BufferedOutput(); $app = new AcquiaCli($config, $this->client, $input, $output); @@ -121,7 +121,7 @@ public function testWaitForNotifications() $stopwatch->start('5s-sleep', 'notifications'); $app->run($input, $output); $sleep5 = $stopwatch->stop('5s-sleep'); - $this->assertGreaterThan(6000, $sleep5->getDuration()); + $this->assertGreaterThan(5000, $sleep5->getDuration()); $sleep5Output = $output->fetch(); // Change the task wait threshold to 2s and try again. @@ -132,7 +132,7 @@ public function testWaitForNotifications() $stopwatch->start('2s-sleep', 'notifications'); $app->run($input, $output); $sleep2 = $stopwatch->stop('2s-sleep'); - $this->assertLessThan(5000, $sleep2->getDuration()); + $this->assertLessThan(3000, $sleep2->getDuration()); $sleep2Output = $output->fetch(); \Robo\Robo::unsetContainer(); @@ -142,10 +142,6 @@ public function testWaitForNotifications() Looking up notification < 1 sec [➤⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬] 0% -> Backing up DB (database2) on Dev - Looking up notification -< 1 sec [➤⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬] 0% - OUTPUT; $this->assertSame($notificationOutput . PHP_EOL, $sleep5Output, 'Testing 5s sleep output'); diff --git a/tests/Commands/DbBackupCommandTest.php b/tests/Commands/DbBackupCommandTest.php index 78aa6ec..3263830 100644 --- a/tests/Commands/DbBackupCommandTest.php +++ b/tests/Commands/DbBackupCommandTest.php @@ -82,9 +82,11 @@ public function dbBackupProvider() +-----+-------+----------------------+ TABLE; - $createBackupText = '> Backing up DB (database1) on Dev + $createBackupAllText = '> Backing up DB (database1) on Dev > Backing up DB (database2) on Dev'; + $createBackupText = '> Backing up DB (database1) on Dev'; + $dbLink = sprintf( '%s/environments/%s/databases/%s/backups/%s/actions/download', '> https://cloud.acquia.com/api', @@ -99,7 +101,11 @@ public function dbBackupProvider() '> Restoring backup 1234 to dbName on Dev' . PHP_EOL ], [ - ['database:backup', 'devcloud:devcloud2', 'dev'], + ['database:backup:all', 'devcloud:devcloud2', 'dev'], + $createBackupAllText . PHP_EOL + ], + [ + ['database:backup', 'devcloud:devcloud2', 'dev', 'database1'], $createBackupText . PHP_EOL ], [ diff --git a/tests/Commands/DomainsCommandTest.php b/tests/Commands/DomainsCommandTest.php index 7c22299..4f7f8ca 100644 --- a/tests/Commands/DomainsCommandTest.php +++ b/tests/Commands/DomainsCommandTest.php @@ -23,7 +23,7 @@ public function domainsProvider() +-------------+--------+--------------+--------------+---------------------+ | Hostname | Active | DNS Resolves | IP Addresses | CNAMES | +-------------+--------+--------------+--------------+---------------------+ -| example.com | ✓ | ✓ | 12.23.34.45 | another.example.com | +| example.com | ✓ | ✓ | 12.23.34.45 | another.example.com | +-------------+--------+--------------+--------------+---------------------+ TABLE;