Correct path in debug()

This commit is contained in:
Kyle Robinson Young 2012-03-05 14:44:45 -08:00
parent 74b6875297
commit c7963835c7
2 changed files with 12 additions and 12 deletions

View file

@ -692,7 +692,7 @@ $expectedText = <<<EXPECTED
'this-is-a-test' 'this-is-a-test'
########################### ###########################
EXPECTED; EXPECTED;
$expected = sprintf($expectedText, substr(__FILE__, strlen(ROOT) + 1), __LINE__ - 8); $expected = sprintf($expectedText, substr(__FILE__, strlen(ROOT)), __LINE__ - 8);
$this->assertEquals($expected, $result); $this->assertEquals($expected, $result);
ob_start(); ob_start();
@ -706,7 +706,7 @@ $expectedHtml = <<<EXPECTED
</pre> </pre>
</div> </div>
EXPECTED; EXPECTED;
$expected = sprintf($expectedHtml, substr(__FILE__, strlen(ROOT) + 1), __LINE__ - 10); $expected = sprintf($expectedHtml, substr(__FILE__, strlen(ROOT)), __LINE__ - 10);
$this->assertEquals($expected, $result); $this->assertEquals($expected, $result);
ob_start(); ob_start();
@ -720,7 +720,7 @@ $expected = <<<EXPECTED
</pre> </pre>
</div> </div>
EXPECTED; EXPECTED;
$expected = sprintf($expected, substr(__FILE__, strlen(ROOT) + 1), __LINE__ - 10); $expected = sprintf($expected, substr(__FILE__, strlen(ROOT)), __LINE__ - 10);
$this->assertEquals($expected, $result); $this->assertEquals($expected, $result);
ob_start(); ob_start();
@ -734,7 +734,7 @@ $expected = <<<EXPECTED
</pre> </pre>
</div> </div>
EXPECTED; EXPECTED;
$expected = sprintf($expected, substr(__FILE__, strlen(ROOT) + 1), __LINE__ - 10); $expected = sprintf($expected, substr(__FILE__, strlen(ROOT)), __LINE__ - 10);
$this->assertEquals($expected, $result); $this->assertEquals($expected, $result);
ob_start(); ob_start();
@ -755,9 +755,9 @@ $expectedText = <<<EXPECTED
########################### ###########################
EXPECTED; EXPECTED;
if (php_sapi_name() == 'cli') { if (php_sapi_name() == 'cli') {
$expected = sprintf($expectedText, substr(__FILE__, strlen(ROOT) + 1), __LINE__ - 17); $expected = sprintf($expectedText, substr(__FILE__, strlen(ROOT)), __LINE__ - 17);
} else { } else {
$expected = sprintf($expectedHtml, substr(__FILE__, strlen(ROOT) + 1), __LINE__ - 19); $expected = sprintf($expectedHtml, substr(__FILE__, strlen(ROOT)), __LINE__ - 19);
} }
$this->assertEquals($expected, $result); $this->assertEquals($expected, $result);
@ -779,9 +779,9 @@ $expectedText = <<<EXPECTED
########################### ###########################
EXPECTED; EXPECTED;
if (php_sapi_name() == 'cli') { if (php_sapi_name() == 'cli') {
$expected = sprintf($expectedText, substr(__FILE__, strlen(ROOT) + 1), __LINE__ - 17); $expected = sprintf($expectedText, substr(__FILE__, strlen(ROOT)), __LINE__ - 17);
} else { } else {
$expected = sprintf($expectedHtml, substr(__FILE__, strlen(ROOT) + 1), __LINE__ - 19); $expected = sprintf($expectedHtml, substr(__FILE__, strlen(ROOT)), __LINE__ - 19);
} }
$this->assertEquals($expected, $result); $this->assertEquals($expected, $result);
@ -794,7 +794,7 @@ $expected = <<<EXPECTED
'<div>this-is-a-test</div>' '<div>this-is-a-test</div>'
########################### ###########################
EXPECTED; EXPECTED;
$expected = sprintf($expected, substr(__FILE__, strlen(ROOT) + 1), __LINE__ - 8); $expected = sprintf($expected, substr(__FILE__, strlen(ROOT)), __LINE__ - 8);
$this->assertEquals($expected, $result); $this->assertEquals($expected, $result);
ob_start(); ob_start();
@ -806,7 +806,7 @@ $expected = <<<EXPECTED
'<div>this-is-a-test</div>' '<div>this-is-a-test</div>'
########################### ###########################
EXPECTED; EXPECTED;
$expected = sprintf($expected, substr(__FILE__, strlen(ROOT) + 1), __LINE__ - 8); $expected = sprintf($expected, substr(__FILE__, strlen(ROOT)), __LINE__ - 8);
$this->assertEquals($expected, $result); $this->assertEquals($expected, $result);
ob_start(); ob_start();
@ -818,7 +818,7 @@ $expected = <<<EXPECTED
'<div>this-is-a-test</div>' '<div>this-is-a-test</div>'
########################### ###########################
EXPECTED; EXPECTED;
$expected = sprintf($expected, substr(__FILE__, strlen(ROOT) + 1), __LINE__ - 8); $expected = sprintf($expected, substr(__FILE__, strlen(ROOT)), __LINE__ - 8);
$this->assertEquals($expected, $result); $this->assertEquals($expected, $result);
} }

View file

@ -77,7 +77,7 @@ function debug($var = false, $showHtml = null, $showFrom = true) {
$lineInfo = ''; $lineInfo = '';
if ($showFrom) { if ($showFrom) {
$trace = Debugger::trace(array('start' => 1, 'depth' => 2, 'format' => 'array')); $trace = Debugger::trace(array('start' => 1, 'depth' => 2, 'format' => 'array'));
$file = substr($trace[0]['file'], strlen(ROOT) + 1); $file = substr($trace[0]['file'], strlen(ROOT));
$line = $trace[0]['line']; $line = $trace[0]['line'];
} }
$html = <<<HTML $html = <<<HTML