Skip to content

Commit

Permalink
add coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
danepowell committed Mar 29, 2024
1 parent cf3445a commit 86b0ce4
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions tests/phpunit/src/Commands/Auth/AuthLogoutCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
use Acquia\Cli\Command\CommandBase;
use Acquia\Cli\Config\CloudDataConfig;
use Acquia\Cli\DataStore\CloudDataStore;
use Acquia\Cli\Exception\AcquiaCliException;
use Acquia\Cli\Tests\CommandTestBase;

/**
Expand All @@ -31,4 +32,25 @@ public function testAuthLogoutCommand(): void {
$this->assertStringContainsString('The active Cloud Platform API credentials were deactivated', $output);
}

public function testAuthLogoutInvalidDatastore(): void {
$this->clientServiceProphecy->isMachineAuthenticated()->willReturn(FALSE);
$this->removeMockCloudConfigFile();
$data = [
'acli_key' => 'key2',
'keys' => [
'key1' => [
'label' => 'foo',
'secret' => 'foo',
'uuid' => 'foo',
],
],
];
$this->fs->dumpFile($this->cloudConfigFilepath, json_encode($data));
$this->createDataStores();
$this->command = $this->createCommand();
$this->expectException(AcquiaCliException::class);
$this->expectExceptionMessage("Invalid key in datastore at $this->cloudConfigFilepath");
$this->executeCommand();
}

}

0 comments on commit 86b0ce4

Please sign in to comment.