public function testFlush() { $data = new Data(array(array(456))); $collector = new DumpDataCollector(); $collector->dump($data); $line = __LINE__; ob_start(); $collector = null; $this->assertSame("DumpDataCollectorTest.php on line {$line}:\n456\n", ob_get_clean()); }
/** * @param EndRequestEvent $event */ public function onEndRequest(EndRequestEvent $event) { if (!$this->dumpCollector) { return; } $collection = $event->getDirectResponse(); if (count($collection) < 1) { return; } $dumps = $this->dumpCollector->getDumps('html'); if (empty($dumps)) { return; } $all = $collection->all(); $all[0] = new DumpResponseDecorator($all[0], $dumps); $event->setDirectResponse(new ResponseCollection($all)); }
public function testFlush() { $data = new Data(array(array(456))); $collector = new DumpDataCollector(); $collector->dump($data); $line = __LINE__ - 1; ob_start(); $collector->__destruct(); if (PHP_VERSION_ID >= 50400) { $this->assertSame("DumpDataCollectorTest.php on line {$line}:\n456\n", ob_get_clean()); } else { $this->assertSame("\"DumpDataCollectorTest.php on line {$line}:\"\n456\n", ob_get_clean()); } }