From bc2f1aa502bfb73f11a47b13846a522ba2b1b792 Mon Sep 17 00:00:00 2001 From: William Skates Date: Fri, 27 Jan 2017 11:09:32 +0000 Subject: [PATCH 1/9] Adding php 7.1 to the build list. --- .travis.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.travis.yml b/.travis.yml index 873079f..f321a05 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: 7.1 before_script: - cp tests/config/config.travis-ci.php tests/config/config.php - composer install --dev From c1aa8b328afcd1848f352471e55d831f14d46705 Mon Sep 17 00:00:00 2001 From: Will Date: Sat, 4 Nov 2017 03:15:40 +0000 Subject: [PATCH 2/9] Clamping phpunit to 5.7^ and adding php 7.1. --- composer.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index 7786424..d4b17e2 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": "^5.7" }, "autoload": { "psr-4": { From 4f875b0e8bd527577b6d83c82db0e6e5880bce20 Mon Sep 17 00:00:00 2001 From: Will Date: Sat, 4 Nov 2017 03:22:33 +0000 Subject: [PATCH 3/9] phpunit 5.6 for php 5.5.* --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index d4b17e2..1c87408 100644 --- a/composer.json +++ b/composer.json @@ -31,7 +31,7 @@ }, "require-dev": { "phpdocumentor/phpdocumentor": "2.*", - "phpunit/phpunit": "^5.7" + "phpunit/phpunit": "^5.6 || ^5.7" }, "autoload": { "psr-4": { From ed428087a32724a359481f24182db0653908a183 Mon Sep 17 00:00:00 2001 From: Will Date: Sat, 4 Nov 2017 03:38:54 +0000 Subject: [PATCH 4/9] Adding a php 7.1 exception catch. --- tests/StatementTest.php | 34 ++++++++++++++++++++++++++++++---- 1 file changed, 30 insertions(+), 4 deletions(-) diff --git a/tests/StatementTest.php b/tests/StatementTest.php index ba04c09..c631ba0 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(), 0 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'); } From a8106f3ad13ac5498fd4720a771bf7a20e416f07 Mon Sep 17 00:00:00 2001 From: Will Date: Sat, 4 Nov 2017 04:00:29 +0000 Subject: [PATCH 5/9] phpunit 4.8.* for php 5.5. --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 1c87408..e6163f0 100644 --- a/composer.json +++ b/composer.json @@ -31,7 +31,7 @@ }, "require-dev": { "phpdocumentor/phpdocumentor": "2.*", - "phpunit/phpunit": "^5.6 || ^5.7" + "phpunit/phpunit": "^4.8 || ^5.6 || ^5.7" }, "autoload": { "psr-4": { From c3206aac7d100c32aaac358df9c4fcfc765675b0 Mon Sep 17 00:00:00 2001 From: William Skates Date: Sat, 4 Nov 2017 14:49:02 +0000 Subject: [PATCH 6/9] Fix. Second tes passes 1 param. --- tests/StatementTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/StatementTest.php b/tests/StatementTest.php index c631ba0..af6b3d5 100644 --- a/tests/StatementTest.php +++ b/tests/StatementTest.php @@ -633,7 +633,7 @@ public function testSignOneArg() { 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 644 and at least 2 expected"; + $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( From dce07ee5fe7ca823a57cf5382bcfda99314ec2a7 Mon Sep 17 00:00:00 2001 From: William Skates Date: Sat, 4 Nov 2017 14:49:49 +0000 Subject: [PATCH 7/9] HHVM -> allowed failures. Fix is out of scope. --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index f321a05..1f8db02 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,7 +8,7 @@ php: - hhvm matrix: allow_failures: - - php: 7.1 + - php: hhvm before_script: - cp tests/config/config.travis-ci.php tests/config/config.php - composer install --dev From 13ee6fc4b7c6325604f45190d9ea9a8b0c7d526c Mon Sep 17 00:00:00 2001 From: William Skates Date: Sat, 4 Nov 2017 15:05:51 +0000 Subject: [PATCH 8/9] Code looks fine. Checking input inside travis. --- .travis.yml | 12 ++++++------ src/RemoteLRS.php | 1 + 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index 1f8db02..ac4c7fb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,14 +1,14 @@ sudo: false language: php php: - - 7.1 - - 7.0 - - 5.6 - - 5.5 +# - 7.1 +# - 7.0 +# - 5.6 +# - 5.5 - hhvm matrix: - allow_failures: - - php: hhvm +# allow_failures: +# - php: hhvm before_script: - cp tests/config/config.travis-ci.php tests/config/config.php - composer install --dev diff --git a/src/RemoteLRS.php b/src/RemoteLRS.php index 9f47257..ba62cbd 100644 --- a/src/RemoteLRS.php +++ b/src/RemoteLRS.php @@ -147,6 +147,7 @@ function ($errno, $errstr, $errfile, $errline, array $errcontext) { try { $context = stream_context_create(array( 'http' => $http )); + var_dump($url, $context); $fp = fopen($url, 'rb', false, $context); if (! $fp) { From 4961aea6cb97e26edc34d57c12fa3c06b18925ad Mon Sep 17 00:00:00 2001 From: William Skates Date: Sat, 4 Nov 2017 15:27:40 +0000 Subject: [PATCH 9/9] Can't find a fix for hhvm right now. --- .travis.yml | 12 ++++++------ src/RemoteLRS.php | 1 - 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/.travis.yml b/.travis.yml index ac4c7fb..1f8db02 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,14 +1,14 @@ sudo: false language: php php: -# - 7.1 -# - 7.0 -# - 5.6 -# - 5.5 + - 7.1 + - 7.0 + - 5.6 + - 5.5 - hhvm matrix: -# allow_failures: -# - php: hhvm + allow_failures: + - php: hhvm before_script: - cp tests/config/config.travis-ci.php tests/config/config.php - composer install --dev diff --git a/src/RemoteLRS.php b/src/RemoteLRS.php index ba62cbd..9f47257 100644 --- a/src/RemoteLRS.php +++ b/src/RemoteLRS.php @@ -147,7 +147,6 @@ function ($errno, $errstr, $errfile, $errline, array $errcontext) { try { $context = stream_context_create(array( 'http' => $http )); - var_dump($url, $context); $fp = fopen($url, 'rb', false, $context); if (! $fp) {