Skip to content

Commit cbcdea1

Browse files
committed
Fix container reqs
1 parent 0ff0f79 commit cbcdea1

File tree

4 files changed

+25
-2
lines changed

4 files changed

+25
-2
lines changed

Diff for: composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"php": "^5.5 || ^7.0",
1313
"maximebf/debugbar": "^1.10",
1414
"psr/http-message": "^1.0",
15-
"container-interop/container-interop": "^1.0",
15+
"container-interop/container-interop": "^1.1",
1616
"zendframework/zend-diactoros": "^1.1.3"
1717
},
1818
"require-dev": {

Diff for: config/dependency.config.php

+1
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,6 @@
33
return [
44
'factories' => [
55
PhpMiddleware\PhpDebugBar\PhpDebugBarMiddleware::class => PhpMiddleware\PhpDebugBar\PhpDebugBarMiddlewareFactory::class,
6+
DebugBar\DataCollector\ConfigCollector::class => PhpMiddleware\PhpDebugBar\ConfigCollectorFactory::class,
67
],
78
];

Diff for: config/phpdebugbar.config.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@
66
'javascript_renderer' => [
77
'base_url' => '/phpdebugbar',
88
],
9-
'collectors' => [],
9+
'collectors' => [
10+
DebugBar\DataCollector\ConfigCollector::class,
11+
],
1012
'storage' => null,
1113
],
1214
],

Diff for: test/ZendExpressiveTest.php

+20
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,12 @@
44

55
use Interop\Container\ContainerInterface;
66
use PhpMiddleware\PhpDebugBar\ConfigProvider;
7+
use Psr\Http\Message\ServerRequestInterface;
78
use Zend\Diactoros\Response\EmitterInterface;
89
use Zend\Diactoros\ServerRequestFactory;
910
use Zend\Expressive\Container\ApplicationFactory;
1011
use Zend\ServiceManager\ServiceManager;
12+
use Zend\Stratigility\Http\ResponseInterface;
1113

1214
final class ZendExpressiveTest extends AbstractMiddlewareRunnerTest
1315
{
@@ -20,6 +22,24 @@ protected function setUp()
2022
$this->testEmitter = new TestEmitter();
2123
}
2224

25+
final public function testContainsConfigCollectorOutput()
26+
{
27+
$response = $this->dispatchApplication([
28+
'REQUEST_URI' => '/hello',
29+
'REQUEST_METHOD' => 'GET',
30+
'HTTP_ACCEPT' => 'text/html',
31+
], [
32+
'/hello' => function (ServerRequestInterface $request, ResponseInterface $response, $next) {
33+
$response->getBody()->write('Hello!');
34+
return $response;
35+
},
36+
]);
37+
38+
$responseBody = (string) $response->getBody();
39+
40+
$this->assertContains('DebugBar\\\DataCollector\\\ConfigCollector', $responseBody);
41+
}
42+
2343
protected function dispatchApplication(array $server, array $pipe = [])
2444
{
2545
$container = $this->createContainer();

0 commit comments

Comments
 (0)