diff --git a/.travis.yml b/.travis.yml index 873079f..1f8db02 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,10 +1,14 @@ sudo: false language: php php: + - 7.1 - 7.0 - 5.6 - 5.5 - hhvm +matrix: + allow_failures: + - php: hhvm before_script: - cp tests/config/config.travis-ci.php tests/config/config.php - composer install --dev diff --git a/composer.json b/composer.json index 7786424..e6163f0 100644 --- a/composer.json +++ b/composer.json @@ -24,14 +24,14 @@ "issues": "https://github.com/RusticiSoftware/TinCanPHP/issues" }, "require": { - "php": "~5.5 || ^7.0.3", + "php": "~5.5 || ^7.0 || ^7.1", "ext-openssl": "*", "namshi/jose": "^7.2.1", "willdurand/negotiation": "^2.0" }, "require-dev": { "phpdocumentor/phpdocumentor": "2.*", - "phpunit/phpunit": "@stable" + "phpunit/phpunit": "^4.8 || ^5.6 || ^5.7" }, "autoload": { "psr-4": { diff --git a/tests/StatementTest.php b/tests/StatementTest.php index ba04c09..af6b3d5 100644 --- a/tests/StatementTest.php +++ b/tests/StatementTest.php @@ -601,20 +601,46 @@ public function testHasAttachmentWithContent() { public function testSignNoArgs() { $obj = new Statement(); + $expectedException = 'PHPUnit_Framework_Error_Warning'; + $expectedMessage = 'Missing argument 1'; + + if (getenv('TRAVIS_PHP_VERSION') == "hhvm") { + $expectedMessage = "sign() expects at least 2 parameters, 0 given"; + } + + if (getenv('TRAVIS_PHP_VERSION') == "7.1") { + $expectedException = "ArgumentCountError"; + $expectedMessage = "Too few arguments to function TinCan\Statement::sign(), 0 passed in /home/travis/build/RusticiSoftware/TinCanPHP/tests/StatementTest.php on line 621 and at least 2 expected"; + } + $this->setExpectedException( - 'PHPUnit_Framework_Error_Warning', - (getenv('TRAVIS_PHP_VERSION') == "hhvm" ? 'sign() expects at least 2 parameters, 0 given' : 'Missing argument 1') + $expectedException, + $expectedMessage ); + $obj->sign(); } public function testSignOneArg() { $obj = new Statement(); + $expectedException = 'PHPUnit_Framework_Error_Warning'; + $expectedMessage = 'Missing argument 2'; + + if (getenv('TRAVIS_PHP_VERSION') == "hhvm") { + $expectedMessage = "sign() expects at least 2 parameters, 1 given"; + } + + if (getenv('TRAVIS_PHP_VERSION') == "7.1") { + $expectedException = "ArgumentCountError"; + $expectedMessage = "Too few arguments to function TinCan\Statement::sign(), 1 passed in /home/travis/build/RusticiSoftware/TinCanPHP/tests/StatementTest.php on line 644 and at least 2 expected"; + } + $this->setExpectedException( - 'PHPUnit_Framework_Error_Warning', - (getenv('TRAVIS_PHP_VERSION') == "hhvm" ? 'sign() expects at least 2 parameters, 1 given' : 'Missing argument 2') + $expectedException, + $expectedMessage ); + $obj->sign('test'); }