File tree Expand file tree Collapse file tree 3 files changed +19
-6
lines changed
HttpFoundation/Tests/Session/Storage/Handler Expand file tree Collapse file tree 3 files changed +19
-6
lines changed Original file line number Diff line number Diff line change 13
13
14
14
use MongoDB \Client ;
15
15
use PHPUnit \Framework \MockObject \MockObject ;
16
+ use PHPUnit \Framework \SkippedTestSuiteError ;
16
17
use PHPUnit \Framework \TestCase ;
17
18
use Symfony \Component \HttpFoundation \Session \Storage \Handler \MongoDbSessionHandler ;
18
19
@@ -32,13 +33,16 @@ class MongoDbSessionHandlerTest extends TestCase
32
33
private $ storage ;
33
34
public $ options ;
34
35
35
- protected function setUp (): void
36
+ public static function setUpBeforeClass (): void
36
37
{
37
- parent ::setUp ();
38
-
39
38
if (!class_exists (Client::class)) {
40
- $ this -> markTestSkipped ('The mongodb/mongodb package is required. ' );
39
+ throw new SkippedTestSuiteError ('The mongodb/mongodb package is required. ' );
41
40
}
41
+ }
42
+
43
+ protected function setUp (): void
44
+ {
45
+ parent ::setUp ();
42
46
43
47
$ this ->mongo = $ this ->getMockBuilder (Client::class)
44
48
->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