}; $stdClass = new stdClass(); function foo() { Debugger::showTrace(); } function bar() { foo(); } Debugger::debug(null); Debugger::debug(true); Debugger::debug(false); Debugger::debug('string'); Debugger::debug(123); Debugger::debug(123.123); Debugger::debug([1, 2, 3]); Debugger::debug($closure); Debugger::debug($stdClass); Debugger::debug(fopen('../README.md', 'r')); Debugger::showTrace(); foo(); bar(); Debugger::debug(Debugger::getCalledFrom()); Debugger::debug(Debugger::getCalledFrom(1)); Debugger::reflectClass('\\Xicrow\\PhpDebug\\Debugger'); Debugger::reflectClassMethod('\\Xicrow\\PhpDebug\\Debugger', 'showTrace'); ?> </body> </html>
/** * @test * @covers \Xicrow\PhpDebug\Debugger::reflectClass * @covers \Xicrow\PhpDebug\Debugger::reflectClassProperty * @covers \Xicrow\PhpDebug\Debugger::reflectClassMethod */ public function testReflectClass() { $result = Debugger::reflectClass('DebuggerTestClass'); $this->assertContains('class DebuggerTestClass', $result); $this->assertContains('public $publicProperty = "public";', $result); $this->assertContains('private $privateProperty = "private";', $result); $this->assertContains('protected $protectedProperty = "protected";', $result); $this->assertContains('public static $publicStaticProperty = "public static";', $result); $this->assertContains('private static $privateStaticProperty = "private static";', $result); $this->assertContains('protected static $protectedStaticProperty = "protected static";', $result); $this->assertContains('public function publicFunction($param1, $param2 = NULL, $param3 = TRUE, $param4 = 4, $param5 = "5", $param6 = [])', $result); $this->assertContains('private function privateFunction($param1, $param2 = NULL, $param3 = TRUE, $param4 = 4, $param5 = "5", $param6 = [])', $result); $this->assertContains('protected function protectedFunction($param1, $param2 = NULL, $param3 = TRUE, $param4 = 4, $param5 = "5", $param6 = [])', $result); $this->assertContains('public static function publicStaticFunction($param1, $param2 = NULL, $param3 = TRUE, $param4 = 4, $param5 = "5", $param6 = [])', $result); $this->assertContains('private static function privateStaticFunction($param1, $param2 = NULL, $param3 = TRUE, $param4 = 4, $param5 = "5", $param6 = [])', $result); $this->assertContains('protected static function protectedStaticFunction($param1, $param2 = NULL, $param3 = TRUE, $param4 = 4, $param5 = "5", $param6 = [])', $result); }