From 4e0e9bc5367f884ed7fa1310bbb88b4afaa9079f Mon Sep 17 00:00:00 2001 From: Dane Powell Date: Fri, 17 Nov 2023 12:33:21 -0800 Subject: [PATCH] add test --- .../src/Commands/InferApplicationTest.php | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/tests/phpunit/src/Commands/InferApplicationTest.php b/tests/phpunit/src/Commands/InferApplicationTest.php index 1d3617902..7a5ceb219 100644 --- a/tests/phpunit/src/Commands/InferApplicationTest.php +++ b/tests/phpunit/src/Commands/InferApplicationTest.php @@ -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; @@ -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(); @@ -56,6 +52,7 @@ public function testInfer(): void { } public function testInferFailure(): void { + $this->createMockGitConfigFile(); $applicationsResponse = $this->mockApplicationsRequest(); $this->mockApplicationRequest(); @@ -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', + ]); + } + }