-
Notifications
You must be signed in to change notification settings - Fork 48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CLI-1302: [api:applications:environment-create] databases must be array #1715
Merged
Merged
Changes from 3 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,7 +21,6 @@ class ApiCommandTest extends CommandTestBase { | |
|
||
public function setUp(): void { | ||
parent::setUp(); | ||
$this->clientProphecy->addOption('headers', ['Accept' => 'application/json']); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is necessary to kill an escaped mutant. We need to check that this method is called, but it isn't actually called on every test case. |
||
putenv('ACQUIA_CLI_USE_CLOUD_API_SPEC_CACHE=1'); | ||
} | ||
|
||
|
@@ -79,6 +78,7 @@ public function testArgumentsInteractionValidationFormat(): void { | |
*/ | ||
public function testApiCommandErrorResponse(): void { | ||
$invalidUuid = '257a5440-22c3-49d1-894d-29497a1cf3b9'; | ||
$this->clientProphecy->addOption('headers', ['Accept' => 'application/hal+json, version=2'])->shouldBeCalled(); | ||
$this->command = $this->getApiCommandByName('api:applications:find'); | ||
$mockBody = $this->getMockResponseFromSpec($this->command->getPath(), $this->command->getMethod(), '404'); | ||
$this->clientProphecy->request('get', '/applications/' . $invalidUuid)->willThrow(new ApiErrorException($mockBody))->shouldBeCalled(); | ||
|
@@ -104,6 +104,7 @@ public function testApiCommandErrorResponse(): void { | |
} | ||
|
||
public function testApiCommandExecutionForHttpGet(): void { | ||
$this->clientProphecy->addOption('headers', ['Accept' => 'application/hal+json, version=2'])->shouldBeCalled(); | ||
$mockBody = $this->getMockResponseFromSpec('/account/ssh-keys', 'get', '200'); | ||
$this->clientProphecy->addQuery('limit', '1')->shouldBeCalled(); | ||
$this->clientProphecy->request('get', '/account/ssh-keys')->willReturn($mockBody->{'_embedded'}->items)->shouldBeCalled(); | ||
|
@@ -136,6 +137,7 @@ public function testObjectParam(): void { | |
} | ||
|
||
public function testInferApplicationUuidArgument(): void { | ||
$this->clientProphecy->addOption('headers', ['Accept' => 'application/hal+json, version=2'])->shouldBeCalled(); | ||
$applications = $this->mockRequest('getApplications'); | ||
$application = $this->mockRequest('getApplicationByUuid', $applications[0]->uuid); | ||
$this->command = $this->getApiCommandByName('api:applications:find'); | ||
|
@@ -171,6 +173,7 @@ public function providerTestConvertApplicationAliasToUuidArgument(): array { | |
*/ | ||
public function testConvertApplicationAliasToUuidArgument(bool $support): void { | ||
ClearCacheCommand::clearCaches(); | ||
$this->clientProphecy->addOption('headers', ['Accept' => 'application/hal+json, version=2'])->shouldBeCalled(); | ||
$tamper = function (&$response): void { | ||
unset($response[1]); | ||
}; | ||
|
@@ -232,7 +235,11 @@ public function testConvertNonUniqueApplicationAliasToUuidArgument(): void { | |
|
||
} | ||
|
||
/** | ||
* @serial | ||
*/ | ||
public function testConvertApplicationAliasWithRealmToUuidArgument(): void { | ||
$this->clientProphecy->addOption('headers', ['Accept' => 'application/hal+json, version=2'])->shouldBeCalled(); | ||
$this->mockApplicationsRequest(1, FALSE); | ||
$this->clientProphecy->addQuery('filter', 'hosting=@devcloud:devcloud2')->shouldBeCalled(); | ||
$this->mockApplicationRequest(); | ||
|
@@ -248,6 +255,7 @@ public function testConvertApplicationAliasWithRealmToUuidArgument(): void { | |
*/ | ||
public function testConvertEnvironmentAliasToUuidArgument(): void { | ||
ClearCacheCommand::clearCaches(); | ||
$this->clientProphecy->addOption('headers', ['Accept' => 'application/hal+json, version=2'])->shouldBeCalled(); | ||
$applicationsResponse = $this->mockApplicationsRequest(1); | ||
$this->clientProphecy->addQuery('filter', 'hosting=@*:devcloud2')->shouldBeCalled(); | ||
$this->mockEnvironmentsRequest($applicationsResponse); | ||
|
@@ -291,6 +299,7 @@ public function testConvertInvalidEnvironmentAliasToUuidArgument(): void { | |
} | ||
|
||
public function testApiCommandExecutionForHttpPost(): void { | ||
$this->clientProphecy->addOption('headers', ['Accept' => 'application/hal+json, version=2'])->shouldBeCalled(); | ||
$mockRequestArgs = $this->getMockRequestBodyFromSpec('/account/ssh-keys'); | ||
$mockResponseBody = $this->getMockResponseFromSpec('/account/ssh-keys', 'post', '202'); | ||
foreach ($mockRequestArgs as $name => $value) { | ||
|
@@ -308,6 +317,7 @@ public function testApiCommandExecutionForHttpPost(): void { | |
} | ||
|
||
public function testApiCommandExecutionForHttpPut(): void { | ||
$this->clientProphecy->addOption('headers', ['Accept' => 'application/hal+json, version=2'])->shouldBeCalled(); | ||
$mockRequestOptions = $this->getMockRequestBodyFromSpec('/environments/{environmentId}', 'put'); | ||
$mockRequestOptions['max_input_vars'] = 1001; | ||
$mockResponseBody = $this->getMockEnvironmentResponse('put', '202'); | ||
|
@@ -416,6 +426,7 @@ public function testApiCommandDefinitionRequestBody(string $commandName, string | |
} | ||
|
||
public function testGetApplicationUuidFromBltYml(): void { | ||
$this->clientProphecy->addOption('headers', ['Accept' => 'application/hal+json, version=2'])->shouldBeCalled(); | ||
$mockBody = $this->getMockResponseFromSpec('/applications/{applicationUuid}', 'get', '200'); | ||
$this->clientProphecy->request('get', '/applications/' . $mockBody->uuid)->willReturn($mockBody)->shouldBeCalled(); | ||
$this->command = $this->getApiCommandByName('api:applications:find'); | ||
|
@@ -431,6 +442,7 @@ public function testOrganizationMemberDeleteByUserUuid(): void { | |
$orgId = 'bfafd31a-83a6-4257-b0ec-afdeff83117a'; | ||
$memberUuid = '26c4af83-545b-45cb-b165-d537adc9e0b4'; | ||
|
||
$this->clientProphecy->addOption('headers', ['Accept' => 'application/hal+json, version=2'])->shouldBeCalled(); | ||
$this->mockRequest('postOrganizationMemberDelete', [$orgId, $memberUuid], NULL, 'Member removed'); | ||
|
||
$this->command = $this->getApiCommandByName('api:organizations:member-delete'); | ||
|
@@ -450,6 +462,7 @@ public function testOrganizationMemberDeleteByUserUuid(): void { | |
* Test of deletion of the user from organization by user email. | ||
*/ | ||
public function testOrganizationMemberDeleteByUserEmail(): void { | ||
$this->clientProphecy->addOption('headers', ['Accept' => 'application/hal+json, version=2'])->shouldBeCalled(); | ||
$membersResponse = $this->getMockResponseFromSpec('/organizations/{organizationUuid}/members', 'get', 200); | ||
$orgId = 'bfafd31a-83a6-4257-b0ec-afdeff83117a'; | ||
$memberMail = $membersResponse->_embedded->items[0]->mail; | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tested to confirm this is no longer necessary