From 50fd57b78111f74fe84fc0389bf59385ee5f7327 Mon Sep 17 00:00:00 2001 From: Dane Powell Date: Thu, 16 May 2024 16:18:00 -0700 Subject: [PATCH] commandbasetest --- .../phpunit/src/Commands/CommandBaseTest.php | 106 ------------------ 1 file changed, 106 deletions(-) delete mode 100644 tests/phpunit/src/Commands/CommandBaseTest.php diff --git a/tests/phpunit/src/Commands/CommandBaseTest.php b/tests/phpunit/src/Commands/CommandBaseTest.php deleted file mode 100644 index 79c36c4ba..000000000 --- a/tests/phpunit/src/Commands/CommandBaseTest.php +++ /dev/null @@ -1,106 +0,0 @@ -injectCommand(LinkCommand::class); - } - - public function testUnauthenticatedFailure(): void { - $this->clientServiceProphecy->isMachineAuthenticated()->willReturn(FALSE); - $this->removeMockConfigFiles(); - - $inputs = [ - // Would you like to share anonymous performance usage and data? - 'n', - ]; - $this->expectException(AcquiaCliException::class); - $this->expectExceptionMessage('This machine is not yet authenticated with the Cloud Platform.'); - $this->executeCommand([], $inputs); - } - - public function testCloudAppFromLocalConfig(): void { - $this->command = $this->injectCommand(IdeListCommand::class); - $this->mockRequest('getApplicationByUuid', 'a47ac10b-58cc-4372-a567-0e02b2c3d470'); - $this->mockRequest('getApplicationIdes', 'a47ac10b-58cc-4372-a567-0e02b2c3d470'); - $this->createMockAcliConfigFile('a47ac10b-58cc-4372-a567-0e02b2c3d470'); - $this->executeCommand(); - - } - - /** - * @return string[][] - */ - public function providerTestCloudAppUuidArg(): array { - return [ - ['a47ac10b-58cc-4372-a567-0e02b2c3d470'], - ['165c887b-7633-4f64-799d-a5d4669c768e'], - ]; - } - - /** - * @dataProvider providerTestCloudAppUuidArg - * @group brokenProphecy - */ - public function testCloudAppUuidArg(string $uuid): void { - $this->mockApplicationRequest(); - $this->assertEquals($uuid, CommandBase::validateUuid($uuid)); - } - - /** - * @return array - */ - public function providerTestInvalidCloudAppUuidArg(): array { - return [ - ['a47ac10b-58cc-4372-a567-0e02b2c3d4', 'This value should have exactly 36 characters.'], - ['a47ac10b-58cc-4372-a567-0e02b2c3d47z', 'This is not a valid UUID.'], - ]; - } - - /** - * @dataProvider providerTestInvalidCloudAppUuidArg - */ - public function testInvalidCloudAppUuidArg(string $uuid, string $message): void { - $this->expectException(ValidatorException::class); - $this->expectExceptionMessage($message); - CommandBase::validateUuid($uuid); - } - - /** - * @return array - */ - public function providerTestInvalidCloudEnvironmentAlias(): array { - return [ - ['bl.a', 'This value is too short. It should have 5 characters or more.'], - ['blarg', 'You must enter either an environment ID or alias. Environment aliases must match the pattern [app-name].[env]'], - ['12345', 'You must enter either an environment ID or alias. Environment aliases must match the pattern [app-name].[env]'], - ]; - } - - /** - * @dataProvider providerTestInvalidCloudEnvironmentAlias - */ - public function testInvalidCloudEnvironmentAlias(string $alias, string $message): void { - $this->expectException(ValidatorException::class); - $this->expectExceptionMessage($message); - CommandBase::validateEnvironmentAlias($alias); - } - -}