diff --git a/module/CLI/test-cli/Command/ManageRedirectRulesTest.php b/module/CLI/test-cli/Command/ManageRedirectRulesTest.php new file mode 100644 index 00000000..3da0a767 --- /dev/null +++ b/module/CLI/test-cli/Command/ManageRedirectRulesTest.php @@ -0,0 +1,33 @@ +exec([ManageRedirectRulesCommand::NAME, 'abc123'], [ + '0', // Add new rule + 'not-a-number', // Invalid priority + '1', // Valid priority, to continue execution + 'invalid-long-url', // Invalid long URL + 'https://example.com', // Valid long URL, to continue execution + '1', // Language condition type + '', // Invalid required language + 'es-ES', // Valid language, to continue execution + 'no', // Do not add more conditions + '4', // Discard changes + ]); + + self::assertStringContainsString('The priority must be a numeric positive value', $output); + self::assertStringContainsString('The input is not valid', $output); + self::assertStringContainsString('The value is mandatory', $output); + } +}