1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-06 16:56:44 +02:00

[ticket/16549] Fix tests

PHPBB3-16549
This commit is contained in:
rxu
2020-08-10 15:02:25 +07:00
parent fc631040fd
commit ec565de6cb
43 changed files with 334 additions and 51 deletions

View File

@@ -51,14 +51,16 @@ class phpbb_error_collector_test extends phpbb_test_case
// Cause a warning
1/0; $line = __LINE__;
// Cause a notice
$array = array(0 => 'value');
$value = $array[1]; $line2 = __LINE__;
// Cause a "Notice: unserialize(): Error at offset 0 of 27 bytes in ..."
// "Undefined array index" used earlier was promoted to warning in PHP 8.0,
// see https://github.com/php/php-src/commit/c48b745f0090c944e77c1fbcfb6c4df3b54356ad
unserialize("obvious non-serialized data"); $line2 = __LINE__;
$collector->uninstall();
// The notice should not be collected
$this->assertEmpty($collector->errors[1]);
$this->assertFalse(isset($collector->errors[1]));
$this->assertEquals(count($collector->errors), 1);
list($errno, $msg_text, $errfile, $errline) = $collector->errors[0];
$error_contents = $collector->format_errors();