Skip to content

Commit

Permalink
Fixed PHP 7.2 tests with PHPUnit 5
Browse files Browse the repository at this point in the history
  • Loading branch information
Finesse committed May 1, 2018
1 parent 67c197f commit a55a009
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 15 deletions.
25 changes: 13 additions & 12 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,19 @@ php:
- hhvm

env:
- SWIFTMAILER=4 DEPENDENCIES=high
- SWIFTMAILER=4 DEPENDENCIES=low
- SWIFTMAILER=5 DEPENDENCIES=high
- SWIFTMAILER=5 DEPENDENCIES=low
- SWIFTMAILER=6 DEPENDENCIES=high
- SWIFTMAILER=6 DEPENDENCIES=low
- SWIFTMAILER=^4.0 DEPENDENCIES=high
- SWIFTMAILER=^4.0 DEPENDENCIES=low
- SWIFTMAILER=^5.0 DEPENDENCIES=high
- SWIFTMAILER=^5.0 DEPENDENCIES=low
- SWIFTMAILER=^6.0 DEPENDENCIES=high
- SWIFTMAILER=^6.0 DEPENDENCIES=low

matrix:
exclude:
- php: 5.6
env: SWIFTMAILER=6 DEPENDENCIES=high
env: SWIFTMAILER=^6.0 DEPENDENCIES=high
- php: 5.6
env: SWIFTMAILER=6 DEPENDENCIES=low
env: SWIFTMAILER=^6.0 DEPENDENCIES=low
allow_failures:
- php: hhvm
- php: nightly
Expand All @@ -30,10 +30,11 @@ cache:
- $HOME/.composer/cache

install:
- composer require "swiftmailer/swiftmailer ^$SWIFTMAILER" --no-update
- if [[ "$DEPENDENCIES" = 'high' ]]; then composer update; fi
- if [[ "$DEPENDENCIES" = 'low' ]]; then composer update --prefer-lowest; fi
- composer require php-coveralls/php-coveralls '^2.0' --dev
- if [[ ! -z $SWIFTMAILER ]]; then composer require "swiftmailer/swiftmailer $SWIFTMAILER" --no-update; fi
- if [[ ${TRAVIS_PHP_VERSION:0:3} > 7.1 ]]; then composer require "phpunit/phpunit >=6.0 <8" --dev --no-update; fi # PHPUnit 5 is installed in PHP 7.2 despite it doesn't work in PHP 7.2
- if [[ $DEPENDENCIES = high ]]; then composer update; fi
- if [[ $DEPENDENCIES = low ]]; then composer update --prefer-lowest; fi
- composer require php-coveralls/php-coveralls ^2.0 --dev

script:
- php vendor/bin/phpunit --coverage-clover ./tests/logs/clover.xml
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@
],
"require": {
"php": ">=5.6",
"swiftmailer/swiftmailer": "^4.0 || ^5.0 || ^6.0"
"swiftmailer/swiftmailer": ">=4.0 <7.0"
},
"require-dev": {
"phpunit/phpunit": "^5.0",
"phpunit/phpunit": ">=5.4 <8.0",
"mockery/mockery": "^1.0"
},
"autoload": {
Expand Down
3 changes: 2 additions & 1 deletion tests/SwiftMailerDefaultsPluginTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@
namespace Finesse\SwiftMailerDefaultsPlugin\Tests;

use Finesse\SwiftMailerDefaultsPlugin\SwiftMailerDefaultsPlugin;
use PHPUnit\Framework\TestCase;

/**
* Test for the SwiftMailerDefaultsPlugin class.
*
* @author Surgie
*/
class SwiftMailerDefaultsPluginTest extends \PHPUnit_Framework_TestCase
class SwiftMailerDefaultsPluginTest extends TestCase
{
/**
* @inheritDoc
Expand Down

0 comments on commit a55a009

Please sign in to comment.