File tree 2 files changed +5
-9
lines changed
Tests/DependencyInjection
2 files changed +5
-9
lines changed Original file line number Diff line number Diff line change 3
3
namespace Prezent \Doctrine \TranslatableBundle \Tests \DependencyInjection ;
4
4
5
5
use PHPUnit \Framework \TestCase ;
6
- use PackageVersions \Versions ;
7
6
use Prezent \Doctrine \TranslatableBundle \DependencyInjection \PrezentDoctrineTranslatableExtension ;
8
- use Composer \Semver \Semver ;
9
7
use Symfony \Component \DependencyInjection \ContainerBuilder ;
10
8
11
9
class PrezentDoctrineTranslatableExtensionTest extends TestCase
@@ -30,9 +28,9 @@ public function testDefault()
30
28
31
29
public function testSonataFilter ()
32
30
{
33
- try {
34
- $ sonataVersion = Versions:: getVersion ( ' sonata-project/doctrine-orm-admin-bundle ' );
35
- } catch ( \ OutOfBoundsException $ e ) {
31
+ $ sonataVersion = getenv ( ' SONATA ' );
32
+
33
+ if (! $ sonataVersion ) {
36
34
$ this ->markTestSkipped ('Sonata is not installed. ' );
37
35
return ;
38
36
}
@@ -43,7 +41,7 @@ public function testSonataFilter()
43
41
$ extension = new PrezentDoctrineTranslatableExtension ();
44
42
$ extension ->load ([[]], $ container );
45
43
46
- if (Semver:: satisfies ( $ sonataVersion, '^3.0 ' ) ) {
44
+ if ($ sonataVersion == '^3.6 ' ) {
47
45
$ this ->assertTrue ($ container ->hasDefinition ('prezent_doctrine_translatable.sonata.filter ' ));
48
46
} else {
49
47
$ this ->assertFalse ($ container ->hasDefinition ('prezent_doctrine_translatable.sonata.filter ' ));
Original file line number Diff line number Diff line change 31
31
"symfony/http-kernel" : " ^2.7|^3.0|^4.0"
32
32
},
33
33
"require-dev" : {
34
- "symfony/phpunit-bridge" : " ^4.1" ,
35
- "composer/semver" : " ^1.4" ,
36
- "ocramius/package-versions" : " ^1.3"
34
+ "symfony/phpunit-bridge" : " ^4.1"
37
35
},
38
36
"autoload" : {
39
37
"psr-4" : { "Prezent\\ Doctrine\\ TranslatableBundle\\ " : " " }
You can’t perform that action at this time.
0 commit comments