8000 Merge branch '5.4' into 6.4 · symfonyaml/symfony@9adf252 · GitHub
[go: up one dir, main page]

Skip to content

Commit 9adf252

Browse files
committed
Merge branch '5.4' into 6.4
* 5.4: do not mix named and positional arguments in data provider definitions session names must not be empty fix Contracts directory name in PHPUnit configuration Passing null to parameter symfony#2 ($subject) of type string is deprecated
2 parents 7b4ec02 + 61a9137 commit 9adf252

File tree

6 files changed

+46
-6
lines changed

6 files changed

+46
-6
lines changed

phpunit.xml.dist

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
<directory>./src/Symfony/Component/*/Tests/</directory>
3535
<directory>./src/Symfony/Component/*/*/Tests/</directory>
3636
<directory>./src/Symfony/Component/*/*/*/Tests/</directory>
37-
<directory>./src/Symfony/Contract/*/Tests/</directory>
37+
<directory>./src/Symfony/Contracts/*/Tests/</directory>
3838
<directory>./src/Symfony/Bundle/*/Tests/</directory>
3939
</testsuite>
4040
</testsuites>
@@ -63,7 +63,7 @@
6363
<directory>./src/Symfony/Bundle/*/vendor</directory>
6464
<directory>./src/Symfony/Component/*/vendor</directory>
6565
<directory>./src/Symfony/Component/*/*/vendor</directory>
66-
<directory>./src/Symfony/Contract/*/vendor</directory>
66+
<directory>./src/Symfony/Contracts/*/vendor</directory>
6767
</exclude>
6868
</coverage>
6969

src/Symfony/Bridge/Monolog/Handler/ChromePhpHandler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public function onKernelResponse(ResponseEvent $event): void
3636
return;
3737
}
3838

39-
if (!preg_match(static::USER_AGENT_REGEX, $event->getRequest()->headers->get('User-Agent'))) {
39+
if (!preg_match(static::USER_AGENT_REGEX, $event->getRequest()->headers->get('User-Agent', ''))) {
4040
self::$sendHeaders = false;
4141
$this->headers = [];
4242

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
<?php
2+
3+
/*
4+
* This file is part of the Symfony package.
5+
*
6+
* (c) Fabien Potencier <fabien@symfony.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+
namespace Symfony\Bridge\Monolog\Tests\Handler;
13+
14+
use PHPUnit\Framework\TestCase;
15+
use Symfony\Bridge\Monolog\Handler\ChromePhpHandler;
16+
use Symfony\Component\HttpFoundation\Request;
17+
use Symfony\Component\HttpFoundation\Response;
18+
use Symfony\Component\HttpKernel\Event\ResponseEvent;
19+
use Symfony\Component\HttpKernel\HttpKernelInterface;
20+
21+
class ChromePhpHandlerTest extends TestCase
22+
{
23+
public function testOnKernelResponseShouldNotTriggerDeprecation()
24+
{
25+
$request = Request::create('/');
26+
$request->headers->remove('User-Agent');
27+
28+
$response = new Response('foo');
29+
$event = new ResponseEvent($this->createMock(HttpKernelInterface::class), $request, HttpKernelInterface::MAIN_REQUEST, $response);
30+
31+
$error = null;
32+
set_error_handler(function ($type, $message) use (&$error) { $error = $message; }, \E_DEPRECATED);
33+
34+
$listener = new ChromePhpHandler();
35+
$listener->onKernelResponse($event);
36+
restore_error_handler();
37+
38+
$this->assertNull($error);
39+
}
40+
}

src/Symfony/Component/Cache/Tests/Traits/RedisTraitTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ public static function provideCreateConnection(): array
7373
'Redis',
7474
],
7575
[
76-
'dsn' => sprintf('redis:?%s', implode('&', \array_slice($hosts, 0, 2))),
76+
sprintf('redis:?%s', implode('&', \array_slice($hosts, 0, 2))),
7777
'RedisArray',
7878
],
7979
];

src/Symfony/Component/HttpFoundation/Tests/Session/Storage/Handler/AbstractRedisSessionHandlerTestCase.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ public function testUseSessionGcMaxLifetimeAsTimeToLive()
8989

9090
public function testDestroySession()
9191
{
92-
$this->storage->open('', '');
92+
$this->storage->open('', 'test');
9393
$this->redisClient->set(self::PREFIX.'id', 'foo');
9494

9595
$this->assertTrue((bool) $this->redisClient->exists(self::PREFIX.'id'));

src/Symfony/Component/HttpFoundation/Tests/Session/Storage/Handler/MemcachedSessionHandlerTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ public function testWriteSessionWithLargeTTL()
109109

110110
public function testDestroySession()
111111
{
112-
$this->storage->open( 2364 '', '');
112+
$this->storage->open('', 'sid');
113113
$this->memcached
114114
->expects($this->once())
115115
->method('delete')

0 commit comments

Comments
 (0)
0