diff options
author | Josh Hoyt <josh@janrain.com> | 2006-01-05 02:17:23 +0000 |
---|---|---|
committer | Josh Hoyt <josh@janrain.com> | 2006-01-05 02:17:23 +0000 |
commit | a7befe11acaf5aade5c76c9eb7d7499ef01b01da (patch) | |
tree | 74675d853182eefab2806b0acd7156db84b97590 | |
parent | f62cb53a150238105354794426a17d9ecbd4704a (diff) | |
download | php-openid-a7befe11acaf5aade5c76c9eb7d7499ef01b01da.zip php-openid-a7befe11acaf5aade5c76c9eb7d7499ef01b01da.tar.gz php-openid-a7befe11acaf5aade5c76c9eb7d7499ef01b01da.tar.bz2 |
[project @ Add more PHP 5 log message silencing to test driver]
-rw-r--r-- | Tests/TestDriver.php | 31 |
1 files changed, 24 insertions, 7 deletions
diff --git a/Tests/TestDriver.php b/Tests/TestDriver.php index 871575c..ea91629 100644 --- a/Tests/TestDriver.php +++ b/Tests/TestDriver.php @@ -1,5 +1,8 @@ <?php +require_once('PHPUnit.php'); +require_once('PHPUnit/GUI/HTML.php'); + if (defined('E_STRICT')) { // PHP 5 $_Net_OpenID_allowed_deprecation = @@ -14,15 +17,23 @@ if (defined('E_STRICT')) { // regular expression if the bug exists in another version. if (preg_match('/^5\.1\.1$/', phpversion()) && $errno == 2) { $allowed_files = array(array('/Net/OpenID/CryptUtil.php', - 'xxx'), + 'dl'), array('/Net/OpenID/OIDUtil.php', - 'parse_url')); + 'parse_url'), + array('/Net/OpenID/Store/FileStore.php', + 'mkdir'), + array('/Net/OpenID/Store/FileStore.php', + 'stat'), + array('/Net/OpenID/Store/FileStore.php', + 'fopen'), + array('/Net/OpenID/Store/FileStore.php', + 'unlink')); foreach ($allowed_files as $entry) { list($afile, $msg) = $entry; $slen = strlen($afile); $slice = substr($errfile, strlen($errfile) - $slen, $slen); - if ($slice == $afile && strpos($errstr, $msg) == 0) { + if ($slice == $afile && strpos($errstr, $msg) === 0) { // Ignore this error return; } @@ -39,8 +50,17 @@ if (defined('E_STRICT')) { return; } } + $pat = '/^Non-static method Net_OpenID_[A-Za-z0-9_]+' . + '::[A-Za-z0-9_]+\(\) (cannot|should not) be ' . + 'called statically$/'; + if (preg_match($pat, $errstr)) { + // Ignore warnings about static methods called + // non-statically since marking them static would break + // PHP 4 compatibility. + return; + } default: - error_log("$errfile:$errline - $errno: $errstr"); + error_log("$errfile:$errline - Errno=$errno:\n[$errstr]"); } } @@ -50,9 +70,6 @@ if (defined('E_STRICT')) { error_reporting(E_ALL); } -require_once('PHPUnit.php'); -require_once('PHPUnit/GUI/HTML.php'); - /** * Load the tests that are defined in the named modules. * |