Bläddra i källkod

Merge pull request #3597 from rafaelcalleja/PR_refactor_integration_test

Remove method version_compare used on Form component integration tests
Oskar Stark 9 år sedan
förälder
incheckning
118a68e4f9
1 ändrade filer med 2 tillägg och 3 borttagningar
  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 Sonata\AdminBundle\Form\Type\Filter\ChoiceType;
 use Symfony\Component\Form\Tests\Fixtures\TestExtension;
 use Symfony\Component\Form\Tests\Fixtures\TestExtension;
-use Symfony\Component\HttpKernel\Kernel;
 
 
 class FormSonataFilterChoiceWidgetTest extends BaseWidgetTest
 class FormSonataFilterChoiceWidgetTest extends BaseWidgetTest
 {
 {
@@ -64,7 +63,7 @@ class FormSonataFilterChoiceWidgetTest extends BaseWidgetTest
 
 
     protected function getParentClass()
     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';
             return 'Sonata\AdminBundle\Form\Type\Filter\ChoiceType';
         } else {
         } else {
             return 'sonata_type_filter_choice';
             return 'sonata_type_filter_choice';
@@ -73,7 +72,7 @@ class FormSonataFilterChoiceWidgetTest extends BaseWidgetTest
 
 
     protected function getChoiceClass()
     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';
             return 'Symfony\Component\Form\Extension\Core\Type\ChoiceType';
         } else {
         } else {
             return 'choice';
             return 'choice';