Explorar o código

Merge pull request #3597 from rafaelcalleja/PR_refactor_integration_test

Remove method version_compare used on Form component integration tests
Oskar Stark %!s(int64=9) %!d(string=hai) anos
pai
achega
118a68e4f9
Modificáronse 1 ficheiros con 2 adicións e 3 borrados
  1. 2 3
      Tests/Form/Widget/FormSonataFilterChoiceWidgetTest.php

+ 2 - 3
Tests/Form/Widget/FormSonataFilterChoiceWidgetTest.php

@@ -13,7 +13,6 @@ namespace Sonata\AdminBundle\Tests\Form\Widget;
 
 use Sonata\AdminBundle\Form\Type\Filter\ChoiceType;
 use Symfony\Component\Form\Tests\Fixtures\TestExtension;
-use Symfony\Component\HttpKernel\Kernel;
 
 class FormSonataFilterChoiceWidgetTest extends BaseWidgetTest
 {
@@ -64,7 +63,7 @@ class FormSonataFilterChoiceWidgetTest extends BaseWidgetTest
 
     protected function getParentClass()
     {
-        if (version_compare(Kernel::VERSION, '2.8.0', '>=')) {
+        if (class_exists('Symfony\Component\Form\Extension\Core\Type\RangeType')) {
             return 'Sonata\AdminBundle\Form\Type\Filter\ChoiceType';
         } else {
             return 'sonata_type_filter_choice';
@@ -73,7 +72,7 @@ class FormSonataFilterChoiceWidgetTest extends BaseWidgetTest
 
     protected function getChoiceClass()
     {
-        if (version_compare(Kernel::VERSION, '2.8.0', '>=')) {
+        if (class_exists('Symfony\Component\Form\Extension\Core\Type\RangeType')) {
             return 'Symfony\Component\Form\Extension\Core\Type\ChoiceType';
         } else {
             return 'choice';