test: Fixed DebuggerTest

Some tests relied on output format settings in other tests.
This commit is contained in:
Koji Tanaka 2023-01-08 20:07:43 +09:00 committed by Kamil Wylegala
parent d47407353b
commit c82693b920

View file

@ -165,6 +165,7 @@ class DebuggerTest extends CakeTestCase {
$this->_restoreError = true; $this->_restoreError = true;
ob_start(); ob_start();
Debugger::output('js');
$a = array(); $a = array();
$b = $a['<script>alert(1)</script>']; $b = $a['<script>alert(1)</script>'];
$result = ob_get_clean(); $result = ob_get_clean();
@ -186,6 +187,7 @@ class DebuggerTest extends CakeTestCase {
'traceLine' => '{:reference} - <a href="txmt://open?url=file://{:file}' . 'traceLine' => '{:reference} - <a href="txmt://open?url=file://{:file}' .
'&line={:line}">{:path}</a>, line {:line}' '&line={:line}">{:path}</a>, line {:line}'
)); ));
Debugger::output('js');
$result = Debugger::trace(); $result = Debugger::trace();
$this->assertMatchesRegularExpression('/' . preg_quote('txmt://open?url=file://', '/') . '(\/|[A-Z]:\\\\)' . '/', $result); $this->assertMatchesRegularExpression('/' . preg_quote('txmt://open?url=file://', '/') . '(\/|[A-Z]:\\\\)' . '/', $result);