public function testObject() { // Reset the output file. file_put_contents('debug.txt', ''); // Perform the dump. Dump::dump(new \stdClass()); $line = __LINE__; --$line; $file = __FILE__; $datetime = new \Datetime(); $time = $datetime->format('r'); $expectation = <<<FILEOUTPUT {$time} {$file} dump:{$line} -------------------------------------------------------------------------------- object(stdClass)#20 (0) { } -------------------------------------------------------------------------------- FILEOUTPUT; $this->assertEquals($expectation, file_get_contents('debug.txt')); }
/** * Var dump like a boss with functional programming. */ function dumpdump($var, $id = null) { Dump::setBacktrace(debug_backtrace()); Dump::dump($var, $id); }