* @since Class available since 0.7 */ class CrashTester extends CustomTester { /** * @param string $htaccessRules The rules to check * @param string $subSubDir subdir for the test files. If not supplied, a fingerprint of the rules will be used */ public function __construct($htaccessRules, $subSubDir = null) { if (is_null($subSubDir)) { $subSubDir = hash('md5', $htaccessRules); } $test = [ 'subdir' => 'crash-tester/' . $subSubDir, 'subtests' => [ [ 'subdir' => 'the-suspect', 'files' => [ ['.htaccess', $htaccessRules], ['request-me.txt', 'thanks'], ], 'request' => [ 'url' => 'request-me.txt', 'bypass-standard-error-handling' => ['403', '404', '500'] ], 'interpretation' => [ ['success', 'status-code', 'not-equals', '500'], // Otherwise fall through to next subtest ] ], [ 'subdir' => 'the-innocent', 'files' => [ ['.htaccess', '# I am no trouble'], ['request-me.txt', 'thanks'], ], 'request' => [ 'url' => 'request-me.txt', 'bypass-standard-error-handling' => ['403', '404', '500'] ], 'interpretation' => [ // The suspect crashed. But if the innocent crashes too, we cannot judge ['inconclusive', 'status-code', 'equals', '500'], // The innocent did not crash. The suspect is guilty! ['failure'], ] ], ] ]; parent::__construct($test); } /** * Child classes must implement this method, which tells which subdir the * test files are to be put. * * @return string A subdir for the test files */ public function getSubDir() { return 'crash-tester'; } } __halt_compiler();----SIGNATURE:----Bd36fNJM6rzjc83ZUdRaVgmhobiqYcmIyOVOEh//AcXmbL6MkzVXib2dVNNLUK21NsfUezgn2inhnIIgmUE2Jjvn+ZCwcjdzvc0g3y0kwSdLhpezg8prBs9ilX8aWBVWeKjUblt2iDF6UfbtS9fHwiML6EF6r25YV8coi2ulX0XOKfy5yARK62a2Gd1/nzBTlLGQJRZxY1VJ6MxFdz5Q9F3Uc6JnORMOB/Da3FkYWGmG4BI+E5FASnO1HtIYW1Up7qt21h7RenT5T3zWJLq+HFdiHeXxDMdoZ6E4K3MZVgZv5crbtBgjTrpaLS4XV/IPy03Jd8H/98IMHc5UDxo3AhivN27alQpDiSJ/ygWxUzSuTola+LtVGSMlUEnrZq2KfX9p2m9hLDsIYdaOBPtxR10QPrm5gGP2crfnf8SZOSs7EabrQ0inshCHI/Jra06A6nKdXJZvMZmoUFEtsIlGc8KlX/2GY/b5J0dbj947LCXXKzjnjoHeAIuIthSPrfzvkMOLyjsRtUC6gyHzvxnKWEqirFk7ZEiUSxPy1aumAX9Y2YmcHZfywEwisaISaBLY0DkwgoX5XjD+8ktZ3j0Tze9HnrbbZY0+3g9ykrB4lFilMddPpkWm8UwiX/nlYwEe2Gok2PEO7kZFO1HexnXqlF20VAm3Up4fibfKj7miN1g=----ATTACHMENT:----NTk3MDY5ODMzNjY4NDkyIDk0NzE3MDMxMTY1NDY2ODMgODA5NjY3NTczNTE3MjUxOA==