From e6cfc6e64c8f212dd9a37cab7cac598725ea1db0 Mon Sep 17 00:00:00 2001 From: Dane Powell Date: Mon, 18 Nov 2024 14:22:13 -0800 Subject: [PATCH] clean up tests and kill mutant --- .../src/Commands/Api/ApiCommandTest.php | 26 ++++++++----------- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/tests/phpunit/src/Commands/Api/ApiCommandTest.php b/tests/phpunit/src/Commands/Api/ApiCommandTest.php index 6ffb920ae..447d3ed23 100644 --- a/tests/phpunit/src/Commands/Api/ApiCommandTest.php +++ b/tests/phpunit/src/Commands/Api/ApiCommandTest.php @@ -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'); @@ -135,7 +132,14 @@ public function testApiCommandErrorResponse(): void // Assert. $output = $this->getDisplay(); $this->assertJson($output); - $this->assertStringContainsString($mockBody->message, $output); + $expected = <<assertEquals($expected, $output); $this->assertEquals(1, $this->getStatusCode()); } @@ -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}', @@ -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); @@ -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');