1
0
mirror of https://github.com/maximebf/php-debugbar.git synced 2025-07-28 04:00:43 +02:00

added support for sending the request id in headers and retreiving the data using the open handler

This commit is contained in:
maximebf
2013-09-23 10:41:54 -04:00
parent 821bf57f2d
commit 8972b82a9a
7 changed files with 118 additions and 12 deletions

@@ -46,9 +46,8 @@ class DebugBarTest extends DebugBarTestCase
}
public function testStorage()
{
$s = new MockStorage();
$this->debugbar->setStorage($s);
{
$this->debugbar->setStorage($s = new MockStorage());
$this->debugbar->addCollector(new MockCollector(array('foo')));
$data = $this->debugbar->collect();
$this->assertEquals($s->data[$this->debugbar->getCurrentRequestId()], $data);
@@ -70,6 +69,17 @@ class DebugBarTest extends DebugBarTestCase
$this->assertArrayHasKey('phpdebugbar', $http->headers);
}
public function testSendDataInHeadersWithOpenHandler()
{
$http = $this->debugbar->getHttpDriver();
$this->debugbar->setStorage($s = new MockStorage());
$this->debugbar->addCollector($c = new MockCollector(array('foo')));
$this->debugbar->sendDataInHeaders(true);
$this->assertArrayHasKey('phpdebugbar-id', $http->headers);
$this->assertEquals($this->debugbar->getCurrentRequestId(), $http->headers['phpdebugbar-id']);
}
public function testStackedData()
{
$http = $this->debugbar->getHttpDriver();