Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -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
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
34 changes: 30 additions & 4 deletions tests/StatementTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}

Expand Down