From 758a9c5942b244d497d66a5aa6cd5773a8e7c0ed Mon Sep 17 00:00:00 2001 From: pondermatic Date: Sun, 12 Nov 2017 16:17:20 -0600 Subject: [PATCH 1/6] Fix comparison of ContextActivities signatures. The grouping array was sent as argument 2 to the $contextActivities2 constructor. ContextActivities->__construct() only takes one argument and will not assign ANY properties if there is not exactly one argument. This cause $contextActivities2 to have a different number of parents than $contextActivities1. I believe the intent of 'contextActivities only: mismatch' and 'full: contextActivities mismatch' cases is to detect differences in the number of contextActivities->grouping objects. --- tests/ContextTest.php | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/tests/ContextTest.php b/tests/ContextTest.php index e90117b..f2d5bec 100644 --- a/tests/ContextTest.php +++ b/tests/ContextTest.php @@ -167,11 +167,15 @@ public function testCompareWithSignature() { [ 'account' => [ 'homePage' => COMMON_ACCT_HOMEPAGE, 'name' => COMMON_ACCT_NAME ]] ); $contextActivities1 = new ContextActivities( - [ 'parent' => [ COMMON_ACTIVITY_ID ]] + [ + 'parent' => [ COMMON_ACTIVITY_ID ] + ] ); $contextActivities2 = new ContextActivities( - [ 'parent' => [ COMMON_ACTIVITY_ID . '/parent' ]], - [ 'grouping' => [ COMMON_ACTIVITY_ID ]] + [ + 'parent' => [ COMMON_ACTIVITY_ID . '/parent' ], + 'grouping' => [ COMMON_ACTIVITY_ID ] + ] ); $ref1 = new StatementRef( [ 'id' => Util::getUUID() ] @@ -270,7 +274,7 @@ public function testCompareWithSignature() { 'description' => 'contextActivities only: mismatch', 'objArgs' => ['contextActivities' => $contextActivities1 ], 'sigArgs' => ['contextActivities' => $contextActivities2 ], - 'reason' => 'Comparison of contextActivities failed: Comparison of parent failed: array lengths differ' + 'reason' => 'Comparison of contextActivities failed: Comparison of grouping failed: array lengths differ' ], [ 'description' => 'revision only: mismatch', @@ -324,7 +328,7 @@ public function testCompareWithSignature() { 'description' => 'full: contextActivities mismatch', 'objArgs' => $full, 'sigArgs' => array_replace($full, ['contextActivities' => $contextActivities2]), - 'reason' => 'Comparison of contextActivities failed: Comparison of parent failed: array lengths differ' + 'reason' => 'Comparison of contextActivities failed: Comparison of grouping failed: array lengths differ' ], [ 'description' => 'full: revision mismatch', From 889dada702038987ddd66f319c1a36ea49857935 Mon Sep 17 00:00:00 2001 From: pondermatic Date: Sun, 12 Nov 2017 18:12:18 -0600 Subject: [PATCH 2/6] Change PHPUnit_Framework_TestCase to PHPUnit\Framework\TestCase. This allows the tests to be run with PHPUnit 4.8.*, 5.4.* and 6.*. --- tests/AboutTest.php | 3 ++- tests/ActivityDefinitionTest.php | 3 ++- tests/ActivityProfileTest.php | 3 ++- tests/ActivityTest.php | 3 ++- tests/AgentAccountTest.php | 3 ++- tests/AgentProfileTest.php | 3 ++- tests/AgentTest.php | 3 ++- tests/AsVersionTraitTest.php | 4 +++- tests/AttachmentTest.php | 3 ++- tests/ContextActivitiesTest.php | 3 ++- tests/ContextTest.php | 3 ++- tests/DocumentTest.php | 3 ++- tests/ExtensionsTest.php | 3 ++- tests/GroupTest.php | 3 ++- tests/ISO8601Test.php | 3 ++- tests/JSONParseErrorExceptionTest.php | 5 ++++- tests/LRSResponseTest.php | 3 ++- tests/LanguageMapTest.php | 3 ++- tests/MapTest.php | 3 ++- tests/PersonTest.php | 3 ++- tests/RemoteLRSTest.php | 3 ++- tests/ResultTest.php | 3 ++- tests/ScoreTest.php | 3 ++- tests/SignatureComparisonTraitTest.php | 4 +++- tests/StateTest.php | 3 ++- tests/StatementBaseTest.php | 3 ++- tests/StatementRefTest.php | 3 ++- tests/StatementTest.php | 3 ++- tests/StatementVariationsTest.php | 3 ++- tests/SubStatementTest.php | 3 ++- tests/UtilTest.php | 3 ++- tests/VerbTest.php | 3 ++- tests/VersionTest.php | 3 ++- 33 files changed, 70 insertions(+), 33 deletions(-) diff --git a/tests/AboutTest.php b/tests/AboutTest.php index 8b7b43e..7367022 100644 --- a/tests/AboutTest.php +++ b/tests/AboutTest.php @@ -17,9 +17,10 @@ namespace TinCanTest; +use PHPUnit\Framework\TestCase; use TinCan\About; -class AboutTest extends \PHPUnit_Framework_TestCase { +class AboutTest extends TestCase { const VERSION_1 = '1.0.0'; public function testInstantiation() { diff --git a/tests/ActivityDefinitionTest.php b/tests/ActivityDefinitionTest.php index 2427b7e..b1b1721 100644 --- a/tests/ActivityDefinitionTest.php +++ b/tests/ActivityDefinitionTest.php @@ -17,9 +17,10 @@ namespace TinCanTest; +use PHPUnit\Framework\TestCase; use TinCan\ActivityDefinition; -class ActivityDefinitionTest extends \PHPUnit_Framework_TestCase { +class ActivityDefinitionTest extends TestCase { const NAME = 'testName'; private $emptyProperties = array( diff --git a/tests/ActivityProfileTest.php b/tests/ActivityProfileTest.php index dbe0f98..83e02c5 100644 --- a/tests/ActivityProfileTest.php +++ b/tests/ActivityProfileTest.php @@ -17,10 +17,11 @@ namespace TinCanTest; +use PHPUnit\Framework\TestCase; use TinCan\ActivityProfile; use TinCan\Activity; -class ActivityProfileTest extends \PHPUnit_Framework_TestCase { +class ActivityProfileTest extends TestCase { public function testSetActivity() { $profile = new ActivityProfile(); $profile->setActivity(['id' => COMMON_ACTIVITY_ID]); diff --git a/tests/ActivityTest.php b/tests/ActivityTest.php index 44f3fe7..ad164f5 100644 --- a/tests/ActivityTest.php +++ b/tests/ActivityTest.php @@ -17,9 +17,10 @@ namespace TinCanTest; +use PHPUnit\Framework\TestCase; use TinCan\Activity; -class ActivityTest extends \PHPUnit_Framework_TestCase { +class ActivityTest extends TestCase { use TestCompareWithSignatureTrait; static private $DEFINITION; diff --git a/tests/AgentAccountTest.php b/tests/AgentAccountTest.php index f863a73..15f7993 100644 --- a/tests/AgentAccountTest.php +++ b/tests/AgentAccountTest.php @@ -17,9 +17,10 @@ namespace TinCanTest; +use PHPUnit\Framework\TestCase; use TinCan\AgentAccount; -class AgentAccountTest extends \PHPUnit_Framework_TestCase { +class AgentAccountTest extends TestCase { use TestCompareWithSignatureTrait; const HOMEPAGE = 'http://tincanapi.com'; diff --git a/tests/AgentProfileTest.php b/tests/AgentProfileTest.php index 3881aee..4a63b7f 100644 --- a/tests/AgentProfileTest.php +++ b/tests/AgentProfileTest.php @@ -17,11 +17,12 @@ namespace TinCanTest; +use PHPUnit\Framework\TestCase; use TinCan\AgentProfile; use TinCan\Agent; use TinCan\Group; -class AgentProfileTest extends \PHPUnit_Framework_TestCase { +class AgentProfileTest extends TestCase { public function testSetAgent() { $profile = new AgentProfile(); $profile->setAgent(['mbox' => COMMON_MBOX]); diff --git a/tests/AgentTest.php b/tests/AgentTest.php index a027de8..16a5433 100644 --- a/tests/AgentTest.php +++ b/tests/AgentTest.php @@ -17,10 +17,11 @@ namespace TinCanTest; +use PHPUnit\Framework\TestCase; use TinCan\Agent; use TinCan\AgentAccount; -class AgentTest extends \PHPUnit_Framework_TestCase { +class AgentTest extends TestCase { use TestCompareWithSignatureTrait; public function testInstantiation() { diff --git a/tests/AsVersionTraitTest.php b/tests/AsVersionTraitTest.php index 4c8b8d3..a73bde3 100644 --- a/tests/AsVersionTraitTest.php +++ b/tests/AsVersionTraitTest.php @@ -17,7 +17,9 @@ namespace TinCanTest; -class AsVersionTraitTest extends \PHPUnit_Framework_TestCase +use PHPUnit\Framework\TestCase; + +class AsVersionTraitTest extends TestCase { public function testTraitExists() { $this->assertTrue(trait_exists('TinCan\AsVersionTrait')); diff --git a/tests/AttachmentTest.php b/tests/AttachmentTest.php index 5ce76d8..91fffd3 100644 --- a/tests/AttachmentTest.php +++ b/tests/AttachmentTest.php @@ -17,10 +17,11 @@ namespace TinCanTest; +use PHPUnit\Framework\TestCase; use TinCan\Attachment; use TinCan\Version; -class AttachmentTest extends \PHPUnit_Framework_TestCase { +class AttachmentTest extends TestCase { use TestCompareWithSignatureTrait; const USAGE_TYPE = 'http://id.tincanapi.com/attachment/supporting_media'; diff --git a/tests/ContextActivitiesTest.php b/tests/ContextActivitiesTest.php index f101205..82d64a0 100644 --- a/tests/ContextActivitiesTest.php +++ b/tests/ContextActivitiesTest.php @@ -17,10 +17,11 @@ namespace TinCanTest; +use PHPUnit\Framework\TestCase; use TinCan\Activity; use TinCan\ContextActivities; -class ContextActivitiesTest extends \PHPUnit_Framework_TestCase { +class ContextActivitiesTest extends TestCase { use TestCompareWithSignatureTrait; static private $listProps = ['category', 'parent', 'grouping', 'other']; diff --git a/tests/ContextTest.php b/tests/ContextTest.php index e90117b..68827ef 100644 --- a/tests/ContextTest.php +++ b/tests/ContextTest.php @@ -17,6 +17,7 @@ namespace TinCanTest; +use PHPUnit\Framework\TestCase; use TinCan\Agent; use TinCan\Context; use TinCan\ContextActivities; @@ -25,7 +26,7 @@ use TinCan\StatementRef; use TinCan\Util; -class ContextTest extends \PHPUnit_Framework_TestCase { +class ContextTest extends TestCase { use TestCompareWithSignatureTrait; private $emptyProperties = array( diff --git a/tests/DocumentTest.php b/tests/DocumentTest.php index 0494cf4..8026630 100644 --- a/tests/DocumentTest.php +++ b/tests/DocumentTest.php @@ -17,11 +17,12 @@ namespace TinCanTest; +use PHPUnit\Framework\TestCase; use TinCan\Document; class StubDocument extends Document {} -class DocumentTest extends \PHPUnit_Framework_TestCase { +class DocumentTest extends TestCase { public function testExceptionOnInvalidDateTime() { $this->setExpectedException( "InvalidArgumentException", diff --git a/tests/ExtensionsTest.php b/tests/ExtensionsTest.php index 6bfd2c3..6c2cefa 100644 --- a/tests/ExtensionsTest.php +++ b/tests/ExtensionsTest.php @@ -17,9 +17,10 @@ namespace TinCanTest; +use PHPUnit\Framework\TestCase; use TinCan\Extensions; -class ExtensionsTest extends \PHPUnit_Framework_TestCase { +class ExtensionsTest extends TestCase { use TestCompareWithSignatureTrait; public function testInstantiation() { diff --git a/tests/GroupTest.php b/tests/GroupTest.php index 1905d2e..163d28e 100644 --- a/tests/GroupTest.php +++ b/tests/GroupTest.php @@ -17,11 +17,12 @@ namespace TinCanTest; +use PHPUnit\Framework\TestCase; use TinCan\Agent; use TinCan\AgentAccount; use TinCan\Group; -class GroupTest extends \PHPUnit_Framework_TestCase { +class GroupTest extends TestCase { use TestCompareWithSignatureTrait; public function testInstantiation() { diff --git a/tests/ISO8601Test.php b/tests/ISO8601Test.php index 0ab3c94..836ca59 100644 --- a/tests/ISO8601Test.php +++ b/tests/ISO8601Test.php @@ -19,10 +19,11 @@ use DateTime; use DateTimeZone; +use PHPUnit\Framework\TestCase; use TinCan\Statement; use TinCan\State; -class ISO8601Test extends \PHPUnit_Framework_TestCase { +class ISO8601Test extends TestCase { public function testProperties() { $str_datetime = '2014-12-15T19:16:05+00:00'; $str_datetime_tz = '2014-12-15T13:16:05-06:00'; diff --git a/tests/JSONParseErrorExceptionTest.php b/tests/JSONParseErrorExceptionTest.php index a74b8ae..4f8046a 100644 --- a/tests/JSONParseErrorExceptionTest.php +++ b/tests/JSONParseErrorExceptionTest.php @@ -15,9 +15,12 @@ limitations under the License. */ +namespace TinCanTest; + +use PHPUnit\Framework\TestCase; use TinCan\JSONParseErrorException; -class JSONParseErrorExceptionTest extends PHPUnit_Framework_TestCase +class JSONParseErrorExceptionTest extends TestCase { private $exception; private $malformedValue = '.....'; diff --git a/tests/LRSResponseTest.php b/tests/LRSResponseTest.php index 9612497..ed32754 100644 --- a/tests/LRSResponseTest.php +++ b/tests/LRSResponseTest.php @@ -17,9 +17,10 @@ namespace TinCanTest; +use PHPUnit\Framework\TestCase; use TinCan\LRSResponse; -class LRSResponseTest extends \PHPUnit_Framework_TestCase { +class LRSResponseTest extends TestCase { public function testInstantiation() { $obj = new LRSResponse(true, '', false); $this->assertTrue($obj->success); diff --git a/tests/LanguageMapTest.php b/tests/LanguageMapTest.php index 56ab20b..c3607a6 100644 --- a/tests/LanguageMapTest.php +++ b/tests/LanguageMapTest.php @@ -17,9 +17,10 @@ namespace TinCanTest; +use PHPUnit\Framework\TestCase; use TinCan\LanguageMap; -class LanguageMapTest extends \PHPUnit_Framework_TestCase { +class LanguageMapTest extends TestCase { const NAME = 'testName'; public function testInstantiation() { diff --git a/tests/MapTest.php b/tests/MapTest.php index 484bfd9..a774e97 100644 --- a/tests/MapTest.php +++ b/tests/MapTest.php @@ -17,11 +17,12 @@ namespace TinCanTest; +use PHPUnit\Framework\TestCase; use TinCan\Map; class StubMap extends Map {} -class MapTest extends \PHPUnit_Framework_TestCase { +class MapTest extends TestCase { public function testInstantiation() { $obj = new StubMap(); } diff --git a/tests/PersonTest.php b/tests/PersonTest.php index bceb7e8..64b7194 100644 --- a/tests/PersonTest.php +++ b/tests/PersonTest.php @@ -17,9 +17,10 @@ namespace TinCanTest; +use PHPUnit\Framework\TestCase; use TinCan\Person; -class PersonTest extends \PHPUnit_Framework_TestCase { +class PersonTest extends TestCase { use TestCompareWithSignatureTrait; public function testInstantiation() { diff --git a/tests/RemoteLRSTest.php b/tests/RemoteLRSTest.php index c41f4cc..2954aca 100644 --- a/tests/RemoteLRSTest.php +++ b/tests/RemoteLRSTest.php @@ -17,6 +17,7 @@ namespace TinCanTest; +use PHPUnit\Framework\TestCase; use TinCan\Activity; use TinCan\Agent; use TinCan\Attachment; @@ -28,7 +29,7 @@ use TinCan\Verb; use TinCan\Version; -class RemoteLRSTest extends \PHPUnit_Framework_TestCase { +class RemoteLRSTest extends TestCase { static private $endpoint; static private $version; static private $username; diff --git a/tests/ResultTest.php b/tests/ResultTest.php index a2f50bd..b707e3f 100644 --- a/tests/ResultTest.php +++ b/tests/ResultTest.php @@ -17,11 +17,12 @@ namespace TinCanTest; +use PHPUnit\Framework\TestCase; use TinCan\Extensions; use TinCan\Result; use TinCan\Score; -class ResultTest extends \PHPUnit_Framework_TestCase { +class ResultTest extends TestCase { use TestCompareWithSignatureTrait; private $emptyProperties = array( diff --git a/tests/ScoreTest.php b/tests/ScoreTest.php index f66623a..f0ea788 100644 --- a/tests/ScoreTest.php +++ b/tests/ScoreTest.php @@ -17,9 +17,10 @@ namespace TinCanTest; +use PHPUnit\Framework\TestCase; use TinCan\Score; -class ScoreTest extends \PHPUnit_Framework_TestCase { +class ScoreTest extends TestCase { use TestCompareWithSignatureTrait; private $emptyProperties = array( diff --git a/tests/SignatureComparisonTraitTest.php b/tests/SignatureComparisonTraitTest.php index 6c217b4..ef2a580 100644 --- a/tests/SignatureComparisonTraitTest.php +++ b/tests/SignatureComparisonTraitTest.php @@ -17,6 +17,8 @@ namespace TinCanTest; +use PHPUnit\Framework\TestCase; + class SignatureComparisonStub { use \TinCan\SignatureComparisonTrait; @@ -25,7 +27,7 @@ public static function runDoMatch($a, $b, $description) { } } -class SignatureComparisonTraitTest extends \PHPUnit_Framework_TestCase { +class SignatureComparisonTraitTest extends TestCase { public function testDoMatch() { $description = "A test Description"; diff --git a/tests/StateTest.php b/tests/StateTest.php index afb4302..d1e8524 100644 --- a/tests/StateTest.php +++ b/tests/StateTest.php @@ -17,10 +17,11 @@ namespace TinCanTest; +use PHPUnit\Framework\TestCase; use TinCan\State; use TinCan\Group; -class StateTest extends \PHPUnit_Framework_TestCase { +class StateTest extends TestCase { public function testCanSetActivityWithArray() { $args = [ 'id' => COMMON_ACTIVITY_ID, diff --git a/tests/StatementBaseTest.php b/tests/StatementBaseTest.php index f32f4a0..e6682fb 100644 --- a/tests/StatementBaseTest.php +++ b/tests/StatementBaseTest.php @@ -17,6 +17,7 @@ namespace TinCanTest; +use PHPUnit\Framework\TestCase; use TinCan\StatementBase; use TinCan\SubStatement; use TinCan\Verb; @@ -26,7 +27,7 @@ class StubStatementBase extends StatementBase {} -class StatementBaseTest extends \PHPUnit_Framework_TestCase { +class StatementBaseTest extends TestCase { public function testInstantiation() { $obj = new StubStatementBase(); } diff --git a/tests/StatementRefTest.php b/tests/StatementRefTest.php index 3567d31..6d117f2 100644 --- a/tests/StatementRefTest.php +++ b/tests/StatementRefTest.php @@ -17,10 +17,11 @@ namespace TinCanTest; +use PHPUnit\Framework\TestCase; use TinCan\StatementRef; use TinCan\Util; -class StatementRefTest extends \PHPUnit_Framework_TestCase { +class StatementRefTest extends TestCase { public function testInstantiation() { $obj = new StatementRef(); $this->assertInstanceOf('TinCan\StatementRef', $obj); diff --git a/tests/StatementTest.php b/tests/StatementTest.php index ba04c09..3d5598b 100644 --- a/tests/StatementTest.php +++ b/tests/StatementTest.php @@ -17,6 +17,7 @@ namespace TinCanTest; +use PHPUnit\Framework\TestCase; use TinCan\Activity; use TinCan\Agent; use TinCan\Attachment; @@ -28,7 +29,7 @@ use TinCan\Version; use Namshi\JOSE\JWS; -class StatementTest extends \PHPUnit_Framework_TestCase { +class StatementTest extends TestCase { use TestCompareWithSignatureTrait; public function testInstantiation() { diff --git a/tests/StatementVariationsTest.php b/tests/StatementVariationsTest.php index 91c8772..8bef35d 100644 --- a/tests/StatementVariationsTest.php +++ b/tests/StatementVariationsTest.php @@ -17,12 +17,13 @@ namespace TinCanTest; +use PHPUnit\Framework\TestCase; use TinCan\Activity; use TinCan\RemoteLRS; use TinCan\Statement; use TinCan\Util; -class StatementVariationsTest extends \PHPUnit_Framework_TestCase { +class StatementVariationsTest extends TestCase { static protected $lrss; static public function setUpBeforeClass() { diff --git a/tests/SubStatementTest.php b/tests/SubStatementTest.php index 9d3ab4f..05dd279 100644 --- a/tests/SubStatementTest.php +++ b/tests/SubStatementTest.php @@ -17,6 +17,7 @@ namespace TinCanTest; +use PHPUnit\Framework\TestCase; use TinCan\Activity; use TinCan\Agent; use TinCan\Context; @@ -25,7 +26,7 @@ use TinCan\Util; use TinCan\Verb; -class SubStatementTest extends \PHPUnit_Framework_TestCase { +class SubStatementTest extends TestCase { use TestCompareWithSignatureTrait; public function testInstantiation() { diff --git a/tests/UtilTest.php b/tests/UtilTest.php index c3b8045..6f4f21c 100644 --- a/tests/UtilTest.php +++ b/tests/UtilTest.php @@ -17,9 +17,10 @@ namespace TinCanTest; +use PHPUnit\Framework\TestCase; use TinCan\Util; -class UtilTest extends \PHPUnit_Framework_TestCase { +class UtilTest extends TestCase { public function testGetUUID() { $result = Util::getUUID(); diff --git a/tests/VerbTest.php b/tests/VerbTest.php index e72a435..6c233e9 100644 --- a/tests/VerbTest.php +++ b/tests/VerbTest.php @@ -17,9 +17,10 @@ namespace TinCanTest; +use PHPUnit\Framework\TestCase; use TinCan\Verb; -class VerbTest extends \PHPUnit_Framework_TestCase { +class VerbTest extends TestCase { use TestCompareWithSignatureTrait; static private $DISPLAY; diff --git a/tests/VersionTest.php b/tests/VersionTest.php index aacba71..9792bc1 100644 --- a/tests/VersionTest.php +++ b/tests/VersionTest.php @@ -17,9 +17,10 @@ namespace TinCanTest; +use PHPUnit\Framework\TestCase; use TinCan\Version; -class VersionTest extends \PHPUnit_Framework_TestCase { +class VersionTest extends TestCase { public function testStaticFactoryReturnsInstance() { $this->assertInstanceOf("TinCan\Version", Version::v101(), "factory returns instance"); } From a916e3dd7be2a8d8f42678bec0d14edf68f4d515 Mon Sep 17 00:00:00 2001 From: pondermatic Date: Mon, 13 Nov 2017 09:44:01 -0600 Subject: [PATCH 3/6] Change PHPUnit version. '@stable' causes testing of PHP 7.0 to use PHPUnit 6.4, which breaks compatibility with PHPUnit 4.8 and 5.7. --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 7786424..7f1c0c8 100644 --- a/composer.json +++ b/composer.json @@ -31,7 +31,7 @@ }, "require-dev": { "phpdocumentor/phpdocumentor": "2.*", - "phpunit/phpunit": "@stable" + "phpunit/phpunit": "4.8.* || 5.7.*" }, "autoload": { "psr-4": { From f203ab3986bcfde3cd0744a469f982ad7345c3eb Mon Sep 17 00:00:00 2001 From: pondermatic Date: Mon, 13 Nov 2017 09:50:10 -0600 Subject: [PATCH 4/6] Update "too few arguments" tests for PHP 7.1. --- tests/StatementTest.php | 34 ++++++++++++++++++++++++++-------- 1 file changed, 26 insertions(+), 8 deletions(-) diff --git a/tests/StatementTest.php b/tests/StatementTest.php index 3d5598b..f1d7c57 100644 --- a/tests/StatementTest.php +++ b/tests/StatementTest.php @@ -602,20 +602,38 @@ public function testHasAttachmentWithContent() { public function testSignNoArgs() { $obj = new Statement(); - $this->setExpectedException( - 'PHPUnit_Framework_Error_Warning', - (getenv('TRAVIS_PHP_VERSION') == "hhvm" ? 'sign() expects at least 2 parameters, 0 given' : 'Missing argument 1') - ); + # PHP 7.1 promoted "too few arguments" warning to an error exception + if (version_compare(PHP_VERSION, '7.1') >= 0) { + $this->setExpectedExceptionRegExp( + 'ArgumentCountError', + '/Too few arguments to function ' . preg_quote(get_class($obj)) . '::sign\(\), 0 passed in ' + . preg_quote(__FILE__) . ' on line \d+ and at least 2 expected/' + ); + } else { + $this->setExpectedException( + 'PHPUnit_Framework_Error_Warning', + (getenv('TRAVIS_PHP_VERSION') == "hhvm" ? 'sign() expects at least 2 parameters, 0 given' : 'Missing argument 1') + ); + } $obj->sign(); } public function testSignOneArg() { $obj = new Statement(); - $this->setExpectedException( - 'PHPUnit_Framework_Error_Warning', - (getenv('TRAVIS_PHP_VERSION') == "hhvm" ? 'sign() expects at least 2 parameters, 1 given' : 'Missing argument 2') - ); + # PHP 7.1 promoted "too few arguments" warning to an error exception + if (version_compare(PHP_VERSION, '7.1') >= 0) { + $this->setExpectedExceptionRegExp( + 'ArgumentCountError', + '/Too few arguments to function ' . preg_quote(get_class($obj)) . '::sign\(\), 1 passed in ' + . preg_quote(__FILE__) . ' on line \d+ and at least 2 expected/' + ); + } else { + $this->setExpectedException( + 'PHPUnit_Framework_Error_Warning', + (getenv('TRAVIS_PHP_VERSION') == "hhvm" ? 'sign() expects at least 2 parameters, 1 given' : 'Missing argument 2') + ); + } $obj->sign('test'); } From ddd2f0af228f80ecd5d15c73e67f9413801dc691 Mon Sep 17 00:00:00 2001 From: pondermatic Date: Mon, 13 Nov 2017 14:51:07 -0600 Subject: [PATCH 5/6] Fix HHVM array to string issue. If the HTTP header context option is an array of headers, HHVM sends an 'Array to string conversion' notice. --- src/RemoteLRS.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/RemoteLRS.php b/src/RemoteLRS.php index 9f47257..86d75b9 100644 --- a/src/RemoteLRS.php +++ b/src/RemoteLRS.php @@ -128,6 +128,14 @@ protected function sendRequest($method, $resource) { } } + // + // If header is an array, when HHVM executes fopen(), + // it sends an 'Array to string conversion' notice, + // which is converted to an ErrorException by our error handler. + // Luckily, header is also allowed to be a string. + // + $http['header'] = implode("\r\n", $http['header']); + $success = false; // From 3508cc65980b7e78b75ecbe8959901b1794bbffa Mon Sep 17 00:00:00 2001 From: pondermatic Date: Sat, 18 Nov 2017 23:21:38 -0600 Subject: [PATCH 6/6] Revert "Merge branch 'PHPUnit' into ContextTest" This reverts commit 4f3f941b5350cc352d58a8750b8261e72dbecae8, reversing changes made to 758a9c5942b244d497d66a5aa6cd5773a8e7c0ed. --- composer.json | 2 +- src/RemoteLRS.php | 8 ------ tests/AboutTest.php | 3 +-- tests/ActivityDefinitionTest.php | 3 +-- tests/ActivityProfileTest.php | 3 +-- tests/ActivityTest.php | 3 +-- tests/AgentAccountTest.php | 3 +-- tests/AgentProfileTest.php | 3 +-- tests/AgentTest.php | 3 +-- tests/AsVersionTraitTest.php | 4 +-- tests/AttachmentTest.php | 3 +-- tests/ContextActivitiesTest.php | 3 +-- tests/ContextTest.php | 3 +-- tests/DocumentTest.php | 3 +-- tests/ExtensionsTest.php | 3 +-- tests/GroupTest.php | 3 +-- tests/ISO8601Test.php | 3 +-- tests/JSONParseErrorExceptionTest.php | 5 +--- tests/LRSResponseTest.php | 3 +-- tests/LanguageMapTest.php | 3 +-- tests/MapTest.php | 3 +-- tests/PersonTest.php | 3 +-- tests/RemoteLRSTest.php | 3 +-- tests/ResultTest.php | 3 +-- tests/ScoreTest.php | 3 +-- tests/SignatureComparisonTraitTest.php | 4 +-- tests/StateTest.php | 3 +-- tests/StatementBaseTest.php | 3 +-- tests/StatementRefTest.php | 3 +-- tests/StatementTest.php | 37 +++++++------------------- tests/StatementVariationsTest.php | 3 +-- tests/SubStatementTest.php | 3 +-- tests/UtilTest.php | 3 +-- tests/VerbTest.php | 3 +-- tests/VersionTest.php | 3 +-- 35 files changed, 42 insertions(+), 105 deletions(-) diff --git a/composer.json b/composer.json index 7f1c0c8..7786424 100644 --- a/composer.json +++ b/composer.json @@ -31,7 +31,7 @@ }, "require-dev": { "phpdocumentor/phpdocumentor": "2.*", - "phpunit/phpunit": "4.8.* || 5.7.*" + "phpunit/phpunit": "@stable" }, "autoload": { "psr-4": { diff --git a/src/RemoteLRS.php b/src/RemoteLRS.php index 86d75b9..9f47257 100644 --- a/src/RemoteLRS.php +++ b/src/RemoteLRS.php @@ -128,14 +128,6 @@ protected function sendRequest($method, $resource) { } } - // - // If header is an array, when HHVM executes fopen(), - // it sends an 'Array to string conversion' notice, - // which is converted to an ErrorException by our error handler. - // Luckily, header is also allowed to be a string. - // - $http['header'] = implode("\r\n", $http['header']); - $success = false; // diff --git a/tests/AboutTest.php b/tests/AboutTest.php index 7367022..8b7b43e 100644 --- a/tests/AboutTest.php +++ b/tests/AboutTest.php @@ -17,10 +17,9 @@ namespace TinCanTest; -use PHPUnit\Framework\TestCase; use TinCan\About; -class AboutTest extends TestCase { +class AboutTest extends \PHPUnit_Framework_TestCase { const VERSION_1 = '1.0.0'; public function testInstantiation() { diff --git a/tests/ActivityDefinitionTest.php b/tests/ActivityDefinitionTest.php index b1b1721..2427b7e 100644 --- a/tests/ActivityDefinitionTest.php +++ b/tests/ActivityDefinitionTest.php @@ -17,10 +17,9 @@ namespace TinCanTest; -use PHPUnit\Framework\TestCase; use TinCan\ActivityDefinition; -class ActivityDefinitionTest extends TestCase { +class ActivityDefinitionTest extends \PHPUnit_Framework_TestCase { const NAME = 'testName'; private $emptyProperties = array( diff --git a/tests/ActivityProfileTest.php b/tests/ActivityProfileTest.php index 83e02c5..dbe0f98 100644 --- a/tests/ActivityProfileTest.php +++ b/tests/ActivityProfileTest.php @@ -17,11 +17,10 @@ namespace TinCanTest; -use PHPUnit\Framework\TestCase; use TinCan\ActivityProfile; use TinCan\Activity; -class ActivityProfileTest extends TestCase { +class ActivityProfileTest extends \PHPUnit_Framework_TestCase { public function testSetActivity() { $profile = new ActivityProfile(); $profile->setActivity(['id' => COMMON_ACTIVITY_ID]); diff --git a/tests/ActivityTest.php b/tests/ActivityTest.php index ad164f5..44f3fe7 100644 --- a/tests/ActivityTest.php +++ b/tests/ActivityTest.php @@ -17,10 +17,9 @@ namespace TinCanTest; -use PHPUnit\Framework\TestCase; use TinCan\Activity; -class ActivityTest extends TestCase { +class ActivityTest extends \PHPUnit_Framework_TestCase { use TestCompareWithSignatureTrait; static private $DEFINITION; diff --git a/tests/AgentAccountTest.php b/tests/AgentAccountTest.php index 15f7993..f863a73 100644 --- a/tests/AgentAccountTest.php +++ b/tests/AgentAccountTest.php @@ -17,10 +17,9 @@ namespace TinCanTest; -use PHPUnit\Framework\TestCase; use TinCan\AgentAccount; -class AgentAccountTest extends TestCase { +class AgentAccountTest extends \PHPUnit_Framework_TestCase { use TestCompareWithSignatureTrait; const HOMEPAGE = 'http://tincanapi.com'; diff --git a/tests/AgentProfileTest.php b/tests/AgentProfileTest.php index 4a63b7f..3881aee 100644 --- a/tests/AgentProfileTest.php +++ b/tests/AgentProfileTest.php @@ -17,12 +17,11 @@ namespace TinCanTest; -use PHPUnit\Framework\TestCase; use TinCan\AgentProfile; use TinCan\Agent; use TinCan\Group; -class AgentProfileTest extends TestCase { +class AgentProfileTest extends \PHPUnit_Framework_TestCase { public function testSetAgent() { $profile = new AgentProfile(); $profile->setAgent(['mbox' => COMMON_MBOX]); diff --git a/tests/AgentTest.php b/tests/AgentTest.php index 16a5433..a027de8 100644 --- a/tests/AgentTest.php +++ b/tests/AgentTest.php @@ -17,11 +17,10 @@ namespace TinCanTest; -use PHPUnit\Framework\TestCase; use TinCan\Agent; use TinCan\AgentAccount; -class AgentTest extends TestCase { +class AgentTest extends \PHPUnit_Framework_TestCase { use TestCompareWithSignatureTrait; public function testInstantiation() { diff --git a/tests/AsVersionTraitTest.php b/tests/AsVersionTraitTest.php index a73bde3..4c8b8d3 100644 --- a/tests/AsVersionTraitTest.php +++ b/tests/AsVersionTraitTest.php @@ -17,9 +17,7 @@ namespace TinCanTest; -use PHPUnit\Framework\TestCase; - -class AsVersionTraitTest extends TestCase +class AsVersionTraitTest extends \PHPUnit_Framework_TestCase { public function testTraitExists() { $this->assertTrue(trait_exists('TinCan\AsVersionTrait')); diff --git a/tests/AttachmentTest.php b/tests/AttachmentTest.php index 91fffd3..5ce76d8 100644 --- a/tests/AttachmentTest.php +++ b/tests/AttachmentTest.php @@ -17,11 +17,10 @@ namespace TinCanTest; -use PHPUnit\Framework\TestCase; use TinCan\Attachment; use TinCan\Version; -class AttachmentTest extends TestCase { +class AttachmentTest extends \PHPUnit_Framework_TestCase { use TestCompareWithSignatureTrait; const USAGE_TYPE = 'http://id.tincanapi.com/attachment/supporting_media'; diff --git a/tests/ContextActivitiesTest.php b/tests/ContextActivitiesTest.php index 82d64a0..f101205 100644 --- a/tests/ContextActivitiesTest.php +++ b/tests/ContextActivitiesTest.php @@ -17,11 +17,10 @@ namespace TinCanTest; -use PHPUnit\Framework\TestCase; use TinCan\Activity; use TinCan\ContextActivities; -class ContextActivitiesTest extends TestCase { +class ContextActivitiesTest extends \PHPUnit_Framework_TestCase { use TestCompareWithSignatureTrait; static private $listProps = ['category', 'parent', 'grouping', 'other']; diff --git a/tests/ContextTest.php b/tests/ContextTest.php index 20562d3..f2d5bec 100644 --- a/tests/ContextTest.php +++ b/tests/ContextTest.php @@ -17,7 +17,6 @@ namespace TinCanTest; -use PHPUnit\Framework\TestCase; use TinCan\Agent; use TinCan\Context; use TinCan\ContextActivities; @@ -26,7 +25,7 @@ use TinCan\StatementRef; use TinCan\Util; -class ContextTest extends TestCase { +class ContextTest extends \PHPUnit_Framework_TestCase { use TestCompareWithSignatureTrait; private $emptyProperties = array( diff --git a/tests/DocumentTest.php b/tests/DocumentTest.php index 8026630..0494cf4 100644 --- a/tests/DocumentTest.php +++ b/tests/DocumentTest.php @@ -17,12 +17,11 @@ namespace TinCanTest; -use PHPUnit\Framework\TestCase; use TinCan\Document; class StubDocument extends Document {} -class DocumentTest extends TestCase { +class DocumentTest extends \PHPUnit_Framework_TestCase { public function testExceptionOnInvalidDateTime() { $this->setExpectedException( "InvalidArgumentException", diff --git a/tests/ExtensionsTest.php b/tests/ExtensionsTest.php index 6c2cefa..6bfd2c3 100644 --- a/tests/ExtensionsTest.php +++ b/tests/ExtensionsTest.php @@ -17,10 +17,9 @@ namespace TinCanTest; -use PHPUnit\Framework\TestCase; use TinCan\Extensions; -class ExtensionsTest extends TestCase { +class ExtensionsTest extends \PHPUnit_Framework_TestCase { use TestCompareWithSignatureTrait; public function testInstantiation() { diff --git a/tests/GroupTest.php b/tests/GroupTest.php index 163d28e..1905d2e 100644 --- a/tests/GroupTest.php +++ b/tests/GroupTest.php @@ -17,12 +17,11 @@ namespace TinCanTest; -use PHPUnit\Framework\TestCase; use TinCan\Agent; use TinCan\AgentAccount; use TinCan\Group; -class GroupTest extends TestCase { +class GroupTest extends \PHPUnit_Framework_TestCase { use TestCompareWithSignatureTrait; public function testInstantiation() { diff --git a/tests/ISO8601Test.php b/tests/ISO8601Test.php index 836ca59..0ab3c94 100644 --- a/tests/ISO8601Test.php +++ b/tests/ISO8601Test.php @@ -19,11 +19,10 @@ use DateTime; use DateTimeZone; -use PHPUnit\Framework\TestCase; use TinCan\Statement; use TinCan\State; -class ISO8601Test extends TestCase { +class ISO8601Test extends \PHPUnit_Framework_TestCase { public function testProperties() { $str_datetime = '2014-12-15T19:16:05+00:00'; $str_datetime_tz = '2014-12-15T13:16:05-06:00'; diff --git a/tests/JSONParseErrorExceptionTest.php b/tests/JSONParseErrorExceptionTest.php index 4f8046a..a74b8ae 100644 --- a/tests/JSONParseErrorExceptionTest.php +++ b/tests/JSONParseErrorExceptionTest.php @@ -15,12 +15,9 @@ limitations under the License. */ -namespace TinCanTest; - -use PHPUnit\Framework\TestCase; use TinCan\JSONParseErrorException; -class JSONParseErrorExceptionTest extends TestCase +class JSONParseErrorExceptionTest extends PHPUnit_Framework_TestCase { private $exception; private $malformedValue = '.....'; diff --git a/tests/LRSResponseTest.php b/tests/LRSResponseTest.php index ed32754..9612497 100644 --- a/tests/LRSResponseTest.php +++ b/tests/LRSResponseTest.php @@ -17,10 +17,9 @@ namespace TinCanTest; -use PHPUnit\Framework\TestCase; use TinCan\LRSResponse; -class LRSResponseTest extends TestCase { +class LRSResponseTest extends \PHPUnit_Framework_TestCase { public function testInstantiation() { $obj = new LRSResponse(true, '', false); $this->assertTrue($obj->success); diff --git a/tests/LanguageMapTest.php b/tests/LanguageMapTest.php index c3607a6..56ab20b 100644 --- a/tests/LanguageMapTest.php +++ b/tests/LanguageMapTest.php @@ -17,10 +17,9 @@ namespace TinCanTest; -use PHPUnit\Framework\TestCase; use TinCan\LanguageMap; -class LanguageMapTest extends TestCase { +class LanguageMapTest extends \PHPUnit_Framework_TestCase { const NAME = 'testName'; public function testInstantiation() { diff --git a/tests/MapTest.php b/tests/MapTest.php index a774e97..484bfd9 100644 --- a/tests/MapTest.php +++ b/tests/MapTest.php @@ -17,12 +17,11 @@ namespace TinCanTest; -use PHPUnit\Framework\TestCase; use TinCan\Map; class StubMap extends Map {} -class MapTest extends TestCase { +class MapTest extends \PHPUnit_Framework_TestCase { public function testInstantiation() { $obj = new StubMap(); } diff --git a/tests/PersonTest.php b/tests/PersonTest.php index 64b7194..bceb7e8 100644 --- a/tests/PersonTest.php +++ b/tests/PersonTest.php @@ -17,10 +17,9 @@ namespace TinCanTest; -use PHPUnit\Framework\TestCase; use TinCan\Person; -class PersonTest extends TestCase { +class PersonTest extends \PHPUnit_Framework_TestCase { use TestCompareWithSignatureTrait; public function testInstantiation() { diff --git a/tests/RemoteLRSTest.php b/tests/RemoteLRSTest.php index 2954aca..c41f4cc 100644 --- a/tests/RemoteLRSTest.php +++ b/tests/RemoteLRSTest.php @@ -17,7 +17,6 @@ namespace TinCanTest; -use PHPUnit\Framework\TestCase; use TinCan\Activity; use TinCan\Agent; use TinCan\Attachment; @@ -29,7 +28,7 @@ use TinCan\Verb; use TinCan\Version; -class RemoteLRSTest extends TestCase { +class RemoteLRSTest extends \PHPUnit_Framework_TestCase { static private $endpoint; static private $version; static private $username; diff --git a/tests/ResultTest.php b/tests/ResultTest.php index b707e3f..a2f50bd 100644 --- a/tests/ResultTest.php +++ b/tests/ResultTest.php @@ -17,12 +17,11 @@ namespace TinCanTest; -use PHPUnit\Framework\TestCase; use TinCan\Extensions; use TinCan\Result; use TinCan\Score; -class ResultTest extends TestCase { +class ResultTest extends \PHPUnit_Framework_TestCase { use TestCompareWithSignatureTrait; private $emptyProperties = array( diff --git a/tests/ScoreTest.php b/tests/ScoreTest.php index f0ea788..f66623a 100644 --- a/tests/ScoreTest.php +++ b/tests/ScoreTest.php @@ -17,10 +17,9 @@ namespace TinCanTest; -use PHPUnit\Framework\TestCase; use TinCan\Score; -class ScoreTest extends TestCase { +class ScoreTest extends \PHPUnit_Framework_TestCase { use TestCompareWithSignatureTrait; private $emptyProperties = array( diff --git a/tests/SignatureComparisonTraitTest.php b/tests/SignatureComparisonTraitTest.php index ef2a580..6c217b4 100644 --- a/tests/SignatureComparisonTraitTest.php +++ b/tests/SignatureComparisonTraitTest.php @@ -17,8 +17,6 @@ namespace TinCanTest; -use PHPUnit\Framework\TestCase; - class SignatureComparisonStub { use \TinCan\SignatureComparisonTrait; @@ -27,7 +25,7 @@ public static function runDoMatch($a, $b, $description) { } } -class SignatureComparisonTraitTest extends TestCase { +class SignatureComparisonTraitTest extends \PHPUnit_Framework_TestCase { public function testDoMatch() { $description = "A test Description"; diff --git a/tests/StateTest.php b/tests/StateTest.php index d1e8524..afb4302 100644 --- a/tests/StateTest.php +++ b/tests/StateTest.php @@ -17,11 +17,10 @@ namespace TinCanTest; -use PHPUnit\Framework\TestCase; use TinCan\State; use TinCan\Group; -class StateTest extends TestCase { +class StateTest extends \PHPUnit_Framework_TestCase { public function testCanSetActivityWithArray() { $args = [ 'id' => COMMON_ACTIVITY_ID, diff --git a/tests/StatementBaseTest.php b/tests/StatementBaseTest.php index e6682fb..f32f4a0 100644 --- a/tests/StatementBaseTest.php +++ b/tests/StatementBaseTest.php @@ -17,7 +17,6 @@ namespace TinCanTest; -use PHPUnit\Framework\TestCase; use TinCan\StatementBase; use TinCan\SubStatement; use TinCan\Verb; @@ -27,7 +26,7 @@ class StubStatementBase extends StatementBase {} -class StatementBaseTest extends TestCase { +class StatementBaseTest extends \PHPUnit_Framework_TestCase { public function testInstantiation() { $obj = new StubStatementBase(); } diff --git a/tests/StatementRefTest.php b/tests/StatementRefTest.php index 6d117f2..3567d31 100644 --- a/tests/StatementRefTest.php +++ b/tests/StatementRefTest.php @@ -17,11 +17,10 @@ namespace TinCanTest; -use PHPUnit\Framework\TestCase; use TinCan\StatementRef; use TinCan\Util; -class StatementRefTest extends TestCase { +class StatementRefTest extends \PHPUnit_Framework_TestCase { public function testInstantiation() { $obj = new StatementRef(); $this->assertInstanceOf('TinCan\StatementRef', $obj); diff --git a/tests/StatementTest.php b/tests/StatementTest.php index f1d7c57..ba04c09 100644 --- a/tests/StatementTest.php +++ b/tests/StatementTest.php @@ -17,7 +17,6 @@ namespace TinCanTest; -use PHPUnit\Framework\TestCase; use TinCan\Activity; use TinCan\Agent; use TinCan\Attachment; @@ -29,7 +28,7 @@ use TinCan\Version; use Namshi\JOSE\JWS; -class StatementTest extends TestCase { +class StatementTest extends \PHPUnit_Framework_TestCase { use TestCompareWithSignatureTrait; public function testInstantiation() { @@ -602,38 +601,20 @@ public function testHasAttachmentWithContent() { public function testSignNoArgs() { $obj = new Statement(); - # PHP 7.1 promoted "too few arguments" warning to an error exception - if (version_compare(PHP_VERSION, '7.1') >= 0) { - $this->setExpectedExceptionRegExp( - 'ArgumentCountError', - '/Too few arguments to function ' . preg_quote(get_class($obj)) . '::sign\(\), 0 passed in ' - . preg_quote(__FILE__) . ' on line \d+ and at least 2 expected/' - ); - } else { - $this->setExpectedException( - 'PHPUnit_Framework_Error_Warning', - (getenv('TRAVIS_PHP_VERSION') == "hhvm" ? 'sign() expects at least 2 parameters, 0 given' : 'Missing argument 1') - ); - } + $this->setExpectedException( + 'PHPUnit_Framework_Error_Warning', + (getenv('TRAVIS_PHP_VERSION') == "hhvm" ? 'sign() expects at least 2 parameters, 0 given' : 'Missing argument 1') + ); $obj->sign(); } public function testSignOneArg() { $obj = new Statement(); - # PHP 7.1 promoted "too few arguments" warning to an error exception - if (version_compare(PHP_VERSION, '7.1') >= 0) { - $this->setExpectedExceptionRegExp( - 'ArgumentCountError', - '/Too few arguments to function ' . preg_quote(get_class($obj)) . '::sign\(\), 1 passed in ' - . preg_quote(__FILE__) . ' on line \d+ and at least 2 expected/' - ); - } else { - $this->setExpectedException( - 'PHPUnit_Framework_Error_Warning', - (getenv('TRAVIS_PHP_VERSION') == "hhvm" ? 'sign() expects at least 2 parameters, 1 given' : 'Missing argument 2') - ); - } + $this->setExpectedException( + 'PHPUnit_Framework_Error_Warning', + (getenv('TRAVIS_PHP_VERSION') == "hhvm" ? 'sign() expects at least 2 parameters, 1 given' : 'Missing argument 2') + ); $obj->sign('test'); } diff --git a/tests/StatementVariationsTest.php b/tests/StatementVariationsTest.php index 8bef35d..91c8772 100644 --- a/tests/StatementVariationsTest.php +++ b/tests/StatementVariationsTest.php @@ -17,13 +17,12 @@ namespace TinCanTest; -use PHPUnit\Framework\TestCase; use TinCan\Activity; use TinCan\RemoteLRS; use TinCan\Statement; use TinCan\Util; -class StatementVariationsTest extends TestCase { +class StatementVariationsTest extends \PHPUnit_Framework_TestCase { static protected $lrss; static public function setUpBeforeClass() { diff --git a/tests/SubStatementTest.php b/tests/SubStatementTest.php index 05dd279..9d3ab4f 100644 --- a/tests/SubStatementTest.php +++ b/tests/SubStatementTest.php @@ -17,7 +17,6 @@ namespace TinCanTest; -use PHPUnit\Framework\TestCase; use TinCan\Activity; use TinCan\Agent; use TinCan\Context; @@ -26,7 +25,7 @@ use TinCan\Util; use TinCan\Verb; -class SubStatementTest extends TestCase { +class SubStatementTest extends \PHPUnit_Framework_TestCase { use TestCompareWithSignatureTrait; public function testInstantiation() { diff --git a/tests/UtilTest.php b/tests/UtilTest.php index 6f4f21c..c3b8045 100644 --- a/tests/UtilTest.php +++ b/tests/UtilTest.php @@ -17,10 +17,9 @@ namespace TinCanTest; -use PHPUnit\Framework\TestCase; use TinCan\Util; -class UtilTest extends TestCase { +class UtilTest extends \PHPUnit_Framework_TestCase { public function testGetUUID() { $result = Util::getUUID(); diff --git a/tests/VerbTest.php b/tests/VerbTest.php index 6c233e9..e72a435 100644 --- a/tests/VerbTest.php +++ b/tests/VerbTest.php @@ -17,10 +17,9 @@ namespace TinCanTest; -use PHPUnit\Framework\TestCase; use TinCan\Verb; -class VerbTest extends TestCase { +class VerbTest extends \PHPUnit_Framework_TestCase { use TestCompareWithSignatureTrait; static private $DISPLAY; diff --git a/tests/VersionTest.php b/tests/VersionTest.php index 9792bc1..aacba71 100644 --- a/tests/VersionTest.php +++ b/tests/VersionTest.php @@ -17,10 +17,9 @@ namespace TinCanTest; -use PHPUnit\Framework\TestCase; use TinCan\Version; -class VersionTest extends TestCase { +class VersionTest extends \PHPUnit_Framework_TestCase { public function testStaticFactoryReturnsInstance() { $this->assertInstanceOf("TinCan\Version", Version::v101(), "factory returns instance"); }