File tree Expand file tree Collapse file tree 2 files changed +47
-0
lines changed
Expand file tree Collapse file tree 2 files changed +47
-0
lines changed Original file line number Diff line number Diff line change 1+ <?php
2+
3+ /*
4+ * This file is part of the API Platform project.
5+ *
6+ * (c) Kévin Dunglas <dunglas@gmail.com>
7+ *
8+ * For the full copyright and license information, please view the LICENSE
9+ * file that was distributed with this source code.
10+ */
11+
12+ declare (strict_types=1 );
13+
14+ namespace ApiPlatform \Core \Tests \Fixtures \TestBundle \BrowserKit ;
15+
16+ use Symfony \Bundle \FrameworkBundle \Client as BaseClient ;
17+ use Symfony \Component \BrowserKit \Request as DomRequest ;
18+ use Symfony \Component \HttpFoundation \Request ;
19+
20+ class Client extends BaseClient
21+ {
22+ /**
23+ * {@inheritdoc}
24+ */
25+ protected function filterRequest (DomRequest $ request ): Request
26+ {
27+ $ request = parent ::filterRequest ($ request );
28+
29+ foreach ($ request ->headers ->all () as $ key => $ value ) {
30+ if ([null ] === $ value ) {
31+ $ request ->headers ->remove ($ key );
32+ }
33+ }
34+
35+ return $ request ;
36+ }
37+ }
Original file line number Diff line number Diff line change @@ -82,6 +82,16 @@ parameters:
8282 container.dumper.inline_class_loader : true
8383
8484services :
85+ test.client :
86+ class : ApiPlatform\Core\Tests\Fixtures\TestBundle\BrowserKit\Client
87+ shared : false
88+ public : true
89+ arguments :
90+ - ' @kernel'
91+ - ' %test.client.parameters%'
92+ - ' @test.client.history'
93+ - ' @test.client.cookiejar'
94+
8595 ApiPlatform\Core\Tests\Fixtures\TestBundle\MessageHandler\ :
8696 resource : ' ../../TestBundle/MessageHandler'
8797 autowire : true
You can’t perform that action at this time.
0 commit comments