Skip to content

CLI-1103: Fix #1558: Notification arg formats #1801

CLI-1103: Fix #1558: Notification arg formats

CLI-1103: Fix #1558: Notification arg formats #1801

Triggered via pull request July 13, 2023 14:45
Status Success
Total duration 1m 24s
Artifacts
This run and associated checks have been archived and are scheduled for deletion. Learn more about checks retention

mutation.yml

on: pull_request
Mutation Testing
1m 14s
Mutation Testing
Fit to window
Zoom out
Zoom in

Annotations

9 warnings
Mutation Testing: src/Command/CommandBase.php#L1072
Escaped Mutant for Mutator "Catch_": --- Original +++ New @@ @@ // Last chance, maybe a URL? try { return self::getNotificationUuidFromUrl($notification); - } catch (ValidatorException|AcquiaCliException) { + } catch (AcquiaCliException) { } // Womp womp. throw new AcquiaCliException('Notification format is not one of UUID, JSON response, or URL');
Mutation Testing: src/Command/CommandBase.php#L1524
Escaped Mutant for Mutator "LogicalAnd": --- Original +++ New @@ @@ } else { throw new AcquiaCliException('JSON object must contain the _links.notification.href property'); } - if (property_exists($links, 'notification') && property_exists($links->notification, 'href')) { + if (property_exists($links, 'notification') || property_exists($links->notification, 'href')) { return self::getNotificationUuidFromUrl($links->notification->href); } throw new AcquiaCliException('JSON object must contain the _links.notification.href property');
Mutation Testing: src/Command/CommandBase.php#L1530
Escaped Mutant for Mutator "PublicVisibility": --- Original +++ New @@ @@ } throw new AcquiaCliException('JSON object must contain the _links.notification.href property'); } - public static function getNotificationUuidFromUrl(string $notificationUrl) : string + protected static function getNotificationUuidFromUrl(string $notificationUrl) : string { $notificationUrlPattern = '/^https:\\/\\/cloud.acquia.com\\/api\\/notifications\\/([\\w-]*)$/'; if (preg_match($notificationUrlPattern, $notificationUrl, $matches)) {
Mutation Testing: src/Command/CommandBase.php#L1533
Escaped Mutant for Mutator "MethodCallRemoval": --- Original +++ New @@ @@ { $notificationUrlPattern = '/^https:\\/\\/cloud.acquia.com\\/api\\/notifications\\/([\\w-]*)$/'; if (preg_match($notificationUrlPattern, $notificationUrl, $matches)) { - self::validateUuid($matches[1]); + return $matches[1]; } throw new AcquiaCliException('Notification UUID not found in URL: {url}', ['url' => $notificationUrl]);
Mutation Testing: src/Command/CommandBase.php#L1536
Escaped Mutant for Mutator "ArrayItemRemoval": --- Original +++ New @@ @@ self::validateUuid($matches[1]); return $matches[1]; } - throw new AcquiaCliException('Notification UUID not found in URL: {url}', ['url' => $notificationUrl]); + throw new AcquiaCliException('Notification UUID not found in URL: {url}', []); } protected function validateRequiredCloudPermissions(Client $acquiaCloudClient, ?string $cloudApplicationUuid, AccountResponse $account, array $requiredPermissions) : void {
Mutation Testing: src/Command/Env/EnvMirrorCommand.php#L83
Escaped Mutant for Mutator "MethodCallRemoval": --- Original +++ New @@ @@ $configCopyResponse = $this->mirrorConfig($sourceEnvironment, $destinationEnvironment, $environmentsResource, $destinationEnvironmentUuid, $outputCallback); } if (isset($codeCopyResponse)) { - $this->waitForNotificationToComplete($acquiaCloudClient, CommandBase::getNotificationUuidFromResponse($codeCopyResponse), 'Waiting for code copy to complete'); + } if (isset($dbCopyResponse)) { $this->waitForNotificationToComplete($acquiaCloudClient, CommandBase::getNotificationUuidFromResponse($dbCopyResponse), 'Waiting for database copy to complete');
Mutation Testing: src/Command/Env/EnvMirrorCommand.php#L86
Escaped Mutant for Mutator "MethodCallRemoval": --- Original +++ New @@ @@ $this->waitForNotificationToComplete($acquiaCloudClient, CommandBase::getNotificationUuidFromResponse($codeCopyResponse), 'Waiting for code copy to complete'); } if (isset($dbCopyResponse)) { - $this->waitForNotificationToComplete($acquiaCloudClient, CommandBase::getNotificationUuidFromResponse($dbCopyResponse), 'Waiting for database copy to complete'); + } if (isset($filesCopyResponse)) { $this->waitForNotificationToComplete($acquiaCloudClient, CommandBase::getNotificationUuidFromResponse($filesCopyResponse), 'Waiting for files copy to complete');
Mutation Testing: src/Command/Env/EnvMirrorCommand.php#L89
Escaped Mutant for Mutator "MethodCallRemoval": --- Original +++ New @@ @@ $this->waitForNotificationToComplete($acquiaCloudClient, CommandBase::getNotificationUuidFromResponse($dbCopyResponse), 'Waiting for database copy to complete'); } if (isset($filesCopyResponse)) { - $this->waitForNotificationToComplete($acquiaCloudClient, CommandBase::getNotificationUuidFromResponse($filesCopyResponse), 'Waiting for files copy to complete'); + } if (isset($configCopyResponse)) { $this->waitForNotificationToComplete($acquiaCloudClient, CommandBase::getNotificationUuidFromResponse($configCopyResponse), 'Waiting for config copy to complete');
Mutation Testing: src/Command/Env/EnvMirrorCommand.php#L92
Escaped Mutant for Mutator "MethodCallRemoval": --- Original +++ New @@ @@ $this->waitForNotificationToComplete($acquiaCloudClient, CommandBase::getNotificationUuidFromResponse($filesCopyResponse), 'Waiting for files copy to complete'); } if (isset($configCopyResponse)) { - $this->waitForNotificationToComplete($acquiaCloudClient, CommandBase::getNotificationUuidFromResponse($configCopyResponse), 'Waiting for config copy to complete'); + } $this->io->success(["Done! {$destinationEnvironment->label} now matches {$sourceEnvironment->label}", "You can visit it here:", "https://" . $destinationEnvironment->domains[0]]); return Command::SUCCESS;