Skip to content

Commit 2a4983d

Browse files
Merge branch '5.2' into 5.3
* 5.2: Fix usage of str_contains() fix intersection types in tests
2 parents 710a8ab + 8ee7431 commit 2a4983d

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

Tests/Session/Storage/Handler/MongoDbSessionHandlerTest.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
namespace Symfony\Component\HttpFoundation\Tests\Session\Storage\Handler;
1313

14+
use MongoDB\Client;
1415
use PHPUnit\Framework\MockObject\MockObject;
1516
use PHPUnit\Framework\TestCase;
1617
use Symfony\Component\HttpFoundation\Session\Storage\Handler\MongoDbSessionHandler;
@@ -23,7 +24,7 @@
2324
class MongoDbSessionHandlerTest extends TestCase
2425
{
2526
/**
26-
* @var MockObject
27+
* @var MockObject&Client
2728
*/
2829
private $mongo;
2930
private $storage;
@@ -33,11 +34,11 @@ protected function setUp(): void
3334
{
3435
parent::setUp();
3536

36-
if (!class_exists(\MongoDB\Client::class)) {
37+
if (!class_exists(Client::class)) {
3738
$this->markTestSkipped('The mongodb/mongodb package is required.');
3839
}
3940

40-
$this->mongo = $this->getMockBuilder(\MongoDB\Client::class)
41+
$this->mongo = $this->getMockBuilder(Client::class)
4142
->disableOriginalConstructor()
4243
->getMock();
4344

@@ -199,7 +200,7 @@ public function testGetConnection()
199200
$method = new \ReflectionMethod($this->storage, 'getMongo');
200201
$method->setAccessible(true);
201202

202-
$this->assertInstanceOf(\MongoDB\Client::class, $method->invoke($this->storage));
203+
$this->assertInstanceOf(Client::class, $method->invoke($this->storage));
203204
}
204205

205206
private function createMongoCollectionMock(): \MongoDB\Collection

0 commit comments

Comments
 (0)