File tree Expand file tree Collapse file tree 3 files changed +18
-6
lines changed
HttpFoundation/Tests/Session/Storage/Handler Expand file tree Collapse file tree 3 files changed +18
-6
lines changed Original file line number Diff line number Diff line change @@ -32,13 +32,16 @@ class MongoDbSessionHandlerTest extends TestCase
32
32
private $ storage ;
33
33
public $ options ;
34
34
35
- protected function setUp (): void
35
+ public static function setUpBeforeClass (): void
36
36
{
37
- parent ::setUp ();
38
-
39
37
if (!class_exists (Client::class)) {
40
- $ this -> markTestSkipped ('The mongodb/mongodb package is required. ' );
38
+ throw new SkippedTestSuiteError ('The mongodb/mongodb package is required. ' );
41
39
}
40
+ }
41
+
42
+ protected function setUp (): void
43
+ {
44
+ parent ::setUp ();
42
45
43
46
$ this ->mongo = $ this ->getMockBuilder (Client::class)
44
47
->disableOriginalConstructor ()
Original file line number Diff line number Diff line change 11
11
12
12
namespace Symfony \Component \Lock \Tests \Store ;
13
13
14
+ use MongoDB \Collection ;
15
+ use PHPUnit \Framework \SkippedTestSuiteError ;
14
16
use PHPUnit \Framework \TestCase ;
15
17
use Symfony \Component \Lock \Store \MongoDbStore ;
16
18
use Symfony \Component \Lock \Store \StoreFactory ;
22
24
*/
23
25
class MongoDbStoreFactoryTest extends TestCase
24
26
{
27
+ public static function setupBeforeClass (): void
28
+ {
29
+ if (!class_exists (Client::class)) {
30
+ throw new SkippedTestSuiteError ('The mongodb/mongodb package is required. ' );
31
+ }
32
+ }
33
+
25
34
public function testCreateMongoDbCollectionStore ()
26
35
{
27
- $ store = StoreFactory::createStore ($ this ->createMock (\ MongoDB \ Collection::class));
36
+ $ store = StoreFactory::createStore ($ this ->createMock (Collection::class));
28
37
29
38
$ this ->assertInstanceOf (MongoDbStore::class, $ store );
30
39
}
Original file line number Diff line number Diff line change @@ -32,7 +32,7 @@ class MongoDbStoreTest extends AbstractStoreTestCase
32
32
33
33
public static function setupBeforeClass (): void
34
34
{
35
- if (!class_exists (\ MongoDB \ Client::class)) {
35
+ if (!class_exists (Client::class)) {
36
36
throw new SkippedTestSuiteError ('The mongodb/mongodb package is required. ' );
37
37
}
38
38
You can’t perform that action at this time.
0 commit comments