Files
xxx/tests/php/fixtures/fake-sendmail.php
T
tim ed959888b4 Add PHP unit tests and page tests.
Run "composer install", then "composer test".
2026-09-26 03:48:09 +02:00

9 lines
421 B
PHP

<?php
/*
* A sendmail for the tests: PHP's mail() runs it through sendmail_path.
* It appends the message to the file in MAIL_LOG, one JSON line each.
*/
$message = stream_get_contents(STDIN);
file_put_contents(getenv('MAIL_LOG'), json_encode(array('args' => array_slice($argv, 1), 'message' => $message),
JSON_INVALID_UTF8_SUBSTITUTE) . "\n", FILE_APPEND | LOCK_EX);