Skip to content

Commit

Permalink
Make gh7875.phpt more resilient
Browse files Browse the repository at this point in the history
Apparently, on Cirrus CI FreeBSD chmodding a file to 0444 doesn't make
it readonly.  So in this case, we skip the test.

[1] <#7975>
  • Loading branch information
cmb69 committed Jan 21, 2022
1 parent de4afc0 commit d2ec5be
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions ext/standard/tests/mail/gh7875.phpt
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
--TEST--
GH-7875 (mails are sent even if failure to log throws exception)
--SKIPIF--
<?php
$filename = __DIR__ . "/gh7875.mail.log";
touch($filename);
chmod($filename, 0444);
clearstatcache();
$is_writable = is_writable($filename);
chmod($filename, 0644);
unlink($filename);
if ($is_writable) die("skip cannot make file read-only");
?>
--INI--
sendmail_path={MAIL:{PWD}/gh7875.mail.out}
mail.log={PWD}/gh7875.mail.log
Expand Down

0 comments on commit d2ec5be

Please sign in to comment.