From a941972a753844e95dd7e866d55b91a4f0f7f55c Mon Sep 17 00:00:00 2001 From: JHGitty Date: Mon, 21 Dec 2015 16:15:30 +0100 Subject: [PATCH] Symfony 3 Compatibility --- .travis.yml | 3 +++ Tests/Form/Type/PhoneNumberTypeTest.php | 7 ++++++- composer.json | 12 ++++++------ 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/.travis.yml b/.travis.yml index d0700b8b..4574e79a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,6 +14,9 @@ matrix: - php: 5.3.3 env: dependencies=lowest +before_install: + - if [ "$TRAVIS_PHP_VERSION" != "hhvm" ]; then echo 'memory_limit=-1' >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini; fi + install: - if [ "$dependencies" = "lowest" ]; then composer update --dev --prefer-lowest --prefer-stable --prefer-source --no-interaction; else composer install --dev --prefer-source --no-interaction; fi; diff --git a/Tests/Form/Type/PhoneNumberTypeTest.php b/Tests/Form/Type/PhoneNumberTypeTest.php index 4f61a70b..578ba84f 100644 --- a/Tests/Form/Type/PhoneNumberTypeTest.php +++ b/Tests/Form/Type/PhoneNumberTypeTest.php @@ -27,7 +27,12 @@ class PhoneNumberTypeTest extends TypeTestCase */ public function testDefaultFormatting($input, $options, $output) { - $type = new PhoneNumberType(); + if (method_exists('Symfony\\Component\\Form\\FormTypeInterface', 'getName')) { + $type = new PhoneNumberType(); + } else { + $type = 'Misd\\PhoneNumberBundle\\Form\\Type\\PhoneNumberType'; + } + $form = $this->factory->create($type, null, $options); $form->submit($input); diff --git a/composer.json b/composer.json index 66129925..3daa713a 100644 --- a/composer.json +++ b/composer.json @@ -17,16 +17,16 @@ "require": { "php": ">=5.3.3", "giggsey/libphonenumber-for-php": "~5.7|~6.0|~7.0", - "symfony/framework-bundle": "~2.1" + "symfony/framework-bundle": "~2.1|~3.0" }, "require-dev": { "doctrine/doctrine-bundle": "~1.0", - "jms/serializer-bundle": "~0.11", + "jms/serializer-bundle": "~0.11|~1.0", "phpunit/phpunit": "~4.0", - "symfony/form": "~2.3", - "symfony/templating": "~2.1", - "symfony/twig-bundle": "~2.1", - "symfony/validator": "~2.1" + "symfony/form": "~2.3|~3.0", + "symfony/templating": "~2.1|~3.0", + "symfony/twig-bundle": "~2.1|~3.0", + "symfony/validator": "~2.1|~3.0" }, "conflict": { "twig/twig": "<1.12.0"