Skip to content

Commit

Permalink
Merge branch '5.4' into 6.3
Browse files Browse the repository at this point in the history
* 5.4:
  [Lock] Fix mongodb extension requirement in tests
  • Loading branch information
fabpot committed Oct 28, 2023
2 parents 683d3d7 + 671769f commit 59d1837
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions Tests/Session/Storage/Handler/MongoDbSessionHandlerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

use MongoDB\Client;
use PHPUnit\Framework\MockObject\MockObject;
use PHPUnit\Framework\SkippedTestSuiteError;
use PHPUnit\Framework\TestCase;
use Symfony\Component\HttpFoundation\Session\Storage\Handler\MongoDbSessionHandler;

Expand All @@ -32,13 +33,16 @@ class MongoDbSessionHandlerTest extends TestCase
private $storage;
public $options;

protected function setUp(): void
public static function setUpBeforeClass(): void
{
parent::setUp();

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

protected function setUp(): void
{
parent::setUp();

$this->mongo = $this->getMockBuilder(Client::class)
->disableOriginalConstructor()
Expand Down

0 comments on commit 59d1837

Please sign in to comment.