Skip to content

Commit

Permalink
Merge pull request #11 from jbouzekri/fix-tests
Browse files Browse the repository at this point in the history
Fix tests
  • Loading branch information
jbouzekri authored Jul 6, 2019
2 parents 83a660e + cc12efe commit 5394bd9
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
8 changes: 4 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
language: php

php:
- 5.4
- 5.5
- 5.6
- nightly
- 7.0
- 7.2
- 7.3

before_script:
- pear install pear/PHP_CodeSniffer
Expand All @@ -13,6 +13,6 @@ before_script:
- wget https://scrutinizer-ci.com/ocular.phar

script:
- phpunit -c Tests/ --coverage-clover=coverage.clover
- vendor/bin/phpunit -c Tests/ --coverage-clover=coverage.clover
- phpcs --standard=PSR2 --extensions=php --ignore=vendor .
- php ocular.phar code-coverage:upload --format=php-clover coverage.clover
7 changes: 7 additions & 0 deletions Tests/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,11 @@
throw new \LogicException('Could not find autoload.php in vendor/. Did you run "composer install --dev"?');
}

// PHPUnit 6 introduced a breaking change that
// removed PHPUnit_Framework_TestCase as a base class,
// and replaced it with \PHPUnit\Framework\TestCase
if (!class_exists('\PHPUnit_Framework_TestCase') && class_exists('\PHPUnit\Framework\TestCase')) {
class_alias('\PHPUnit\Framework\TestCase', '\PHPUnit_Framework_TestCase');
}

require $autoloadFile;
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
"symfony/config": "~2.4",
"symfony/http-kernel": "~2.4",
"symfony/dependency-injection": "~2.4",
"twig/extensions": "~1.0"
"twig/extensions": "~1.0",
"phpunit/phpunit": "~4.8|~5.7"
},
"autoload": {
"psr-0": { "Jb\\Bundle\\PhumborBundle": "" }
Expand Down

0 comments on commit 5394bd9

Please sign in to comment.