File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed
tests/Symfony/Tests/Component/HttpKernel/Profiler Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change 1
1
<?php
2
-
3
2
/*
4
3
* This file is part of the Symfony package.
5
4
*
14
13
use Symfony \Component \HttpKernel \Profiler \MongoDbProfilerStorage ;
15
14
use Symfony \Component \HttpKernel \Profiler \Profile ;
16
15
16
+ class DummyMongoDbProfilerStorage extends MongoDbProfilerStorage {
17
+ public function getMongo () {
18
+ return parent ::getMongo ();
19
+ }
20
+ }
21
+
17
22
class MongoDbProfilerStorageTest extends \PHPUnit_Framework_TestCase
18
23
{
19
24
protected static $ storage ;
20
25
21
26
protected function setUp ()
22
27
{
23
28
if (extension_loaded ('mongo ' )) {
24
- self ::$ storage = new MongoDbProfilerStorage ('mongodb://localhost/symfony_tests/profiler_data ' );
29
+ self ::$ storage = new DummyMongoDbProfilerStorage ('mongodb://localhost/symfony_tests/profiler_data ' );
30
+ try {
31
+ self ::$ storage ->getMongo ();
32
+ } catch (\MongoConnectionException $ e ) {
33
+ $ this ->markTestSkipped ('MongoDbProfilerStorageTest requires that there is a MongoDB server present on localhost ' );
34
+ }
25
35
self ::$ storage ->purge ();
26
36
} else {
27
37
$ this ->markTestSkipped ('MongoDbProfilerStorageTest requires that the extension mongo is loaded ' );
You can’t perform that action at this time.
0 commit comments