Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
danepowell committed Nov 17, 2023
1 parent 9ab5dee commit 4e0e9bc
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions tests/phpunit/src/Commands/InferApplicationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
namespace Acquia\Cli\Tests\Commands;

use Acquia\Cli\Command\App\LinkCommand;
use Acquia\Cli\Exception\AcquiaCliException;
use Acquia\Cli\Tests\CommandTestBase;
use Symfony\Component\Console\Command\Command;

Expand All @@ -20,13 +21,8 @@ protected function createCommand(): Command {
return $this->injectCommand(LinkCommand::class);
}

public function setUp(mixed $output = NULL): void {
parent::setUp();
$this->createMockGitConfigFile();
}

public function testInfer(): void {

$this->createMockGitConfigFile();
$applicationsResponse = $this->mockApplicationsRequest();
$this->mockApplicationRequest();
$environmentResponse = $this->getMockEnvironmentResponse();
Expand Down Expand Up @@ -56,6 +52,7 @@ public function testInfer(): void {
}

public function testInferFailure(): void {
$this->createMockGitConfigFile();
$applicationsResponse = $this->mockApplicationsRequest();
$this->mockApplicationRequest();

Expand Down Expand Up @@ -87,4 +84,11 @@ public function testInferFailure(): void {
$this->assertStringContainsString('The Cloud application Sample application 1 has been linked', $output);
}

public function testInferInvalidGitConfig(): void {
$this->expectException(AcquiaCliException::class);
$this->executeCommand([], [
'y',
]);
}

}

0 comments on commit 4e0e9bc

Please sign in to comment.