test: Update DebuggerTest for PHP 8.0+

This commit is contained in:
Koji Tanaka 2023-01-07 23:33:45 +09:00 committed by Kamil Wylegala
parent 1d6fd78d45
commit d47407353b

View file

@ -203,10 +203,10 @@ class DebuggerTest extends CakeTestCase {
$data = array(
'error' => array(),
'code' => array(), '8', '/code',
'code' => array(), '2', '/code',
'file' => array(), 'preg:/[^<]+/', '/file',
'line' => array(), '' . ((int)__LINE__ - 7), '/line',
'preg:/Undefined variable:\s+foo/',
'preg:/Undefined variable\s+\$foo/',
'/error'
);
$this->assertTags($result, $data, true);
@ -262,10 +262,10 @@ class DebuggerTest extends CakeTestCase {
$data = array(
'<error',
'<code', '8', '/code',
'<code', '2', '/code',
'<file', 'preg:/[^<]+/', '/file',
'<line', '' . ((int)__LINE__ - 7), '/line',
'preg:/Undefined variable:\s+foo/',
'preg:/Undefined variable\s+\$foo/',
'/error'
);
$this->assertTags($result, $data, true);
@ -286,7 +286,7 @@ class DebuggerTest extends CakeTestCase {
ob_start();
$foo .= '';
$result = ob_get_clean();
$this->assertStringContainsString('Notice: I eated an error', $result);
$this->assertStringContainsString('Warning: I eated an error', $result);
$this->assertStringContainsString('DebuggerTest.php', $result);
}