Skip to content

Commit

Permalink
clean up tests and kill mutant
Browse files Browse the repository at this point in the history
  • Loading branch information
danepowell committed Nov 18, 2024
1 parent e03dbfc commit e6cfc6e
Showing 1 changed file with 11 additions and 15 deletions.
26 changes: 11 additions & 15 deletions tests/phpunit/src/Commands/Api/ApiCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,6 @@ public function testTaskWait(): void
$this->assertEquals($expected, $output);
}

/**
* @group brokenProphecy
*/
public function testArgumentsInteraction(): void
{
$this->command = $this->getApiCommandByName('api:environments:log-download');
Expand Down Expand Up @@ -135,7 +132,14 @@ public function testApiCommandErrorResponse(): void
// Assert.
$output = $this->getDisplay();
$this->assertJson($output);
$this->assertStringContainsString($mockBody->message, $output);
$expected = <<<EOD
{
"error": "not_found",
"message": "The application you are trying to access does not exist, or you do not have permission to access it."
}
EOD;
$this->assertEquals($expected, $output);
$this->assertEquals(1, $this->getStatusCode());
}

Expand All @@ -162,12 +166,12 @@ public function testApiCommandExecutionForHttpGet(): void
$this->assertArrayHasKey('uuid', $contents[0]);
}

/**
* @group brokenProphecy
*/
public function testObjectParam(): void
{
$this->clientProphecy->addOption('headers', ['Accept' => 'application/hal+json, version=2'])
->shouldBeCalled();
$this->mockRequest('putEnvironmentCloudActions', '24-a47ac10b-58cc-4372-a567-0e02b2c3d470');
$this->clientProphecy->addOption('json', ['cloud-actions' => (object)['fb4aa87a-8be2-42c6-bdf0-ef9d09a3de70' => true]]);
$this->command = $this->getApiCommandByName('api:environments:cloud-actions-update');
$this->executeCommand([
'cloud-actions' => '{"fb4aa87a-8be2-42c6-bdf0-ef9d09a3de70":true}',
Expand Down Expand Up @@ -607,9 +611,6 @@ public function testOrganizationMemberDeleteByUserEmail(): void
$this->assertStringContainsString("Organization member removed", $output);
}

/**
* @group brokenProphecy
*/
public function testOrganizationMemberDeleteInvalidEmail(): void
{
$membersResponse = self::getMockResponseFromSpec('/organizations/{organizationUuid}/members', 'get', 200);
Expand All @@ -618,11 +619,6 @@ public function testOrganizationMemberDeleteInvalidEmail(): void
$this->clientProphecy->request('get', '/organizations/' . $orgId . '/members')
->willReturn($membersResponse->_embedded->items)->shouldBeCalled();

$this->mockRequest('postOrganizationMemberDelete', [
$orgId,
$memberUuid,
], null, 'Member removed');

$this->command = $this->getApiCommandByName('api:organizations:member-delete');
$this->expectException(AcquiaCliException::class);
$this->expectExceptionMessage('No matching user found in this organization');
Expand Down

0 comments on commit e6cfc6e

Please sign in to comment.