Skip to content

Commit

Permalink
Merge pull request #5 from fsevestre/symfony5
Browse files Browse the repository at this point in the history
Upgrade to Symfony 5 + test against PHP 7.3 and 7.4
  • Loading branch information
fsevestre authored Nov 29, 2020
2 parents aabb0a7 + 6b97800 commit d3da23c
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 26 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
/composer.phar
/bin/
/vendor/
/.phpunit.result.cache
25 changes: 6 additions & 19 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,40 +3,27 @@ language: php
dist: trusty

php:
- hhvm
- '7.2'
- '7.3'
- '7.4'
- nightly
- '7.1'
- '7.0'
- '5.6'
- '5.5'

env:
- SYMFONY_VERSION=2.8.*
- SYMFONY_VERSION=3.0.*
- SYMFONY_VERSION=3.1.*
- SYMFONY_VERSION=3.2.*
- SYMFONY_VERSION=3.3.*
- SYMFONY_VERSION=5.0.*
- SYMFONY_VERSION=5.1.*

matrix:
fast_finish: true
include:
- php: '5.4'
env: SYMFONY_VERSION=2.8.*
dist: trusty
- php: '5.3'
env: SYMFONY_VERSION=2.8.*
dist: precise
allow_failures:
- php: nightly
- php: hhvm

before_install:
- composer self-update
- composer require --no-update symfony/form ${SYMFONY_VERSION}

install:
- composer install --no-interaction --prefer-dist
- wget https://github.com/satooshi/php-coveralls/releases/download/v1.0.1/coveralls.phar
- wget https://github.com/php-coveralls/php-coveralls/releases/download/v2.4.2/php-coveralls.phar

before_script:
- mkdir -p build/logs
Expand Down
8 changes: 4 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@
],
"homepage": "https://github.com/fsevestre/BooleanFormType",
"require": {
"php": ">=5.3.9",
"symfony/form": "~2.8|~3.0|~4.0"
"php": ">=7.2.5",
"symfony/form": "~5.0"
},
"require-dev": {
"phpunit/phpunit": "~4.5"
"phpunit/phpunit": "^8.5"
},
"autoload": {
"psr-4": { "FSevestre\\BooleanFormType\\": "src/" }
Expand All @@ -24,4 +24,4 @@
"config": {
"bin-dir": "bin"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@
namespace FSevestre\BooleanFormTypeTest\Form\DataTransformer;

use FSevestre\BooleanFormType\Form\DataTransformer\BooleanTypeToBooleanTransformer;
use PHPUnit\Framework\TestCase;
use Symfony\Component\Form\Exception\TransformationFailedException;

/**
* @author Florent SEVESTRE
*/
class BooleanTypeToBooleanTransformerTest extends \PHPUnit_Framework_TestCase
class BooleanTypeToBooleanTransformerTest extends TestCase
{
public function testTransformNull()
{
Expand Down Expand Up @@ -35,7 +37,7 @@ public function testTransformFalse()
*/
public function testTransformFailed($value)
{
$this->setExpectedException('Symfony\Component\Form\Exception\TransformationFailedException');
$this->expectException(TransformationFailedException::class);

$transformer = new BooleanTypeToBooleanTransformer(array(1, '1', true, 'true'), array(0, '0', false, 'false'));
$transformer->transform($value);
Expand Down Expand Up @@ -98,7 +100,7 @@ public function getReverseTransformFalseData()

public function testReverseTransformFailed()
{
$this->setExpectedException('Symfony\Component\Form\Exception\TransformationFailedException');
$this->expectException(TransformationFailedException::class);

$transformer = new BooleanTypeToBooleanTransformer(array(1, '1', true, 'true'), array(0, '0', false, 'false'));
$transformer->transform('');
Expand Down

0 comments on commit d3da23c

Please # to comment.