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:
@@ -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();
|
||||
|
Reference in New Issue
Block a user