Skip to content

Commit

Permalink
Add compatibility to symfony 5
Browse files Browse the repository at this point in the history
  • Loading branch information
alexander-schranz committed Feb 19, 2020
1 parent 31258ea commit e6aed00
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 12 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ vendor
testapp/app/cache
testapp/app/logs
.htaccess
/var
18 changes: 11 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,23 @@ matrix:
- php: 5.6
env: SYMFONY_VERSION='2.8.*'
- php: 7.1
env: SYMFONY_VERSION='3.3.*'
env: SYMFONY_VERSION='^3.4'
- php: 7.1
env: DEPS=dev SYMFONY_VERSION='3.4.*'
- php: 7.1
env: DEVS=dev SYMFONY_VERSION='4.0.*'
env: SYMFONY_VERSION='^4.3'
- php: 7.2
env: SYMFONY_VERSION='^4.4'
- php: 7.3
env: SYMFONY_VERSION='5.0.*'
- php: 7.4
env: SYMFONY_VERSION='^5.0'
allow_failures:
- php: 7.1
env: SYMFONY_VERSION='4.0.x-dev'
- php: 7.4
env: DEPS=dev SYMFONY_VERSION='^5.0@dev'

before_install:
- composer self-update
- mkdir -p ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d && echo "memory_limit=-1" >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini
- if [ "$DEPS" = 'dev' ]; then perl -pi -e 's/^}$/,"minimum-stability":"dev"}/' composer.json; fi;
- if [ "$DEPS" != "" ]; then composer config minimum-stability $DEPS; fi;
- if [ "$SYMFONY_VERSION" != "" ]; then composer require --no-update "symfony/symfony:${SYMFONY_VERSION}"; fi;

install:
Expand Down
8 changes: 4 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,16 @@
"require": {
"php": ">=5.3.3",
"behat/behat": "^3.4.3",
"symfony/framework-bundle": "~2.0|~3.0|~4.0"
"symfony/framework-bundle": "~2.0|~3.0|~4.0|~5.0"
},

"require-dev": {
"symfony/symfony": "~2.1|~3.0|~4.0",
"symfony/symfony": "~2.1|~3.0|~4.0|~5.0",
"behat/mink-extension": "~2.0",
"behat/mink": "~1.7@dev",
"behat/mink-browserkit-driver": "~1.3@dev",
"phpspec/phpspec": "~2.0|~3.0|~4.0",
"phpunit/phpunit": "~4.0|~5.0"
"phpspec/phpspec": "~2.0|~3.0|~4.0|~5.0|~6.0",
"phpunit/phpunit": "^4.8 || ^5.7 || ^6.0 || ^7.0 || ^8.0 || ^9.0"
},

"autoload": {
Expand Down
4 changes: 4 additions & 0 deletions features/bootstrap/FeatureContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@
use Symfony\Component\Process\PhpExecutableFinder;
use Symfony\Component\Process\Process;

if (!class_exists('PHPUnit_Framework_Assert')) {
class_alias('PHPUnit\Framework\Assert', 'PHPUnit_Framework_Assert');
}

/**
* Behat context class.
*/
Expand Down
2 changes: 2 additions & 0 deletions testapp/behat.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
default:
translation:
locale: en
formatters:
progress:
paths: false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@
use Symfony\Component\HttpKernel\KernelInterface;
use Behat\Symfony2Extension\Context\KernelAwareContext;

if (!class_exists('PHPUnit_Framework_Assert')) {
class_alias('PHPUnit\Framework\Assert', 'PHPUnit_Framework_Assert');
}

class FeatureContext implements KernelAwareContext
{
private $kernel;
Expand Down Expand Up @@ -78,7 +82,7 @@ public function theValueShouldBeAnArray()
public function theArrayShouldContainOnlyTheValues($arg)
{
$values = explode(',', $arg);

\PHPUnit_Framework_Assert::assertSame($values, $this->containerParameters[$this->parameterKey]);
}
}

0 comments on commit e6aed00

Please sign in to comment.