Skip to content

Commit

Permalink
Update the new debug view to clean up URLs.
Browse files Browse the repository at this point in the history
  • Loading branch information
lonnieezell committed Oct 9, 2017
1 parent 05a7a9e commit 82c67ad
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
9 changes: 9 additions & 0 deletions system/View/View.php
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,15 @@ public function render(string $view, array $options = null, $saveData = null): s

if (in_array('toolbar', $after) || array_key_exists('toolbar', $after))
{
// Clean up our path names to make them a little cleaner
foreach (['APPPATH', 'BASEPATH', 'ROOTPATH'] as $path)
{
if (strpos($file, constant($path)) === 0)
{
$file = str_replace(constant($path), $path.'/', $file);
}
}

$output = '<div class="debug-view"><div class="debug-view-path" style="display: none;">' . $file . '</div>'
. $output . '</div>';
}
Expand Down
2 changes: 1 addition & 1 deletion tests/system/View/ViewTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ public function testRenderFindsView()
$view->setVar('testString', 'Hello World');
$expected = '<h1>Hello World</h1>';

$this->assertEquals($expected, $view->render('simple'));
$this->assertTrue(strpos($view->render('simple'), $expected) !== false);
}

//--------------------------------------------------------------------
Expand Down

0 comments on commit 82c67ad

Please sign in to comment.