Skip to content

Commit

Permalink
fix intersection types in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Tobion committed Jul 21, 2021
1 parent afa486c commit e18c77c
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions Tests/Session/Storage/Handler/MongoDbSessionHandlerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

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

use MongoDB\Client;
use PHPUnit\Framework\MockObject\MockObject;
use PHPUnit\Framework\TestCase;
use Symfony\Component\HttpFoundation\Session\Storage\Handler\MongoDbSessionHandler;
Expand All @@ -23,7 +24,7 @@
class MongoDbSessionHandlerTest extends TestCase
{
/**
* @var MockObject
* @var MockObject&Client
*/
private $mongo;
private $storage;
Expand All @@ -33,11 +34,11 @@ protected function setUp(): void
{
parent::setUp();

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

$this->mongo = $this->getMockBuilder(\MongoDB\Client::class)
$this->mongo = $this->getMockBuilder(Client::class)
->disableOriginalConstructor()
->getMock();

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

$this->assertInstanceOf(\MongoDB\Client::class, $method->invoke($this->storage));
$this->assertInstanceOf(Client::class, $method->invoke($this->storage));
}

private function createMongoCollectionMock(): \MongoDB\Collection
Expand Down

0 comments on commit e18c77c

Please sign in to comment.