mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
Merge pull request #7849 from open-sausages/pulls/4.0/fix-debug-string-class-cli
BUG Fix issue with CLIDebugView failing on class name of existing class
This commit is contained in:
commit
95308e1af6
@ -160,7 +160,7 @@ class CliDebugView extends DebugView
|
||||
public function debugVariableText($val)
|
||||
{
|
||||
// Check debug
|
||||
if (ClassInfo::hasMethod($val, 'debug')) {
|
||||
if (is_object($val) && ClassInfo::hasMethod($val, 'debug')) {
|
||||
return $val->debug();
|
||||
}
|
||||
|
||||
|
@ -61,5 +61,16 @@ EOS
|
||||
,
|
||||
$view->debugVariable(new ObjectWithDebug(), $this->caller)
|
||||
);
|
||||
|
||||
$this->assertEquals(
|
||||
<<<EOS
|
||||
Debug (CLIDebugViewTest.php:17 - SilverStripe\\Dev\\Tests\\CLIDebugViewTest::setUp())
|
||||
SilverStripe\\Dev\\Tests\\DebugViewTest\\ObjectWithDebug
|
||||
|
||||
|
||||
EOS
|
||||
,
|
||||
$view->debugVariable(ObjectWithDebug::class, $this->caller)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user