From 95a2558cea1046c164fde41c78e36e6a187f9dde Mon Sep 17 00:00:00 2001 From: Antonio Ribeiro Date: Sun, 17 May 2020 13:40:15 +0200 Subject: [PATCH 1/5] Update testing framework to allow PHPUnit v5..v9 --- Tests/Current_Session_Test.php | 4 +-- Tests/Current_User_Test.php | 4 +-- Tests/Telemetry_Client_Test.php | 2 +- composer.json | 2 +- phpunit.xml | 48 ++++++++++++++++----------------- 5 files changed, 30 insertions(+), 30 deletions(-) diff --git a/Tests/Current_Session_Test.php b/Tests/Current_Session_Test.php index 2cd3cfe..4e39990 100644 --- a/Tests/Current_Session_Test.php +++ b/Tests/Current_Session_Test.php @@ -12,7 +12,7 @@ class Current_Session_Test extends TestCase private $sessionCreatedTime; private $sessionLastRenewedTime; - protected function setUp() + protected function setUp(): void { $this->sessionId = \ApplicationInsights\Channel\Contracts\Utils::returnGuid(); $this->sessionCreatedTime = time(); @@ -20,7 +20,7 @@ protected function setUp() Utils::setSessionCookie($this->sessionId, $this->sessionCreatedTime, $this->sessionLastRenewedTime); } - protected function tearDown() + protected function tearDown(): void { Utils::clearSessionCookie(); } diff --git a/Tests/Current_User_Test.php b/Tests/Current_User_Test.php index d7c7468..d71d47c 100644 --- a/Tests/Current_User_Test.php +++ b/Tests/Current_User_Test.php @@ -10,13 +10,13 @@ class Current_User_Test extends TestCase { private $userId; - protected function setUp() + protected function setUp(): void { $this->userId = \ApplicationInsights\Channel\Contracts\Utils::returnGuid(); Utils::setUserCookie($this->userId); } - protected function tearDown() + protected function tearDown(): void { Utils::clearUserCookie(); } diff --git a/Tests/Telemetry_Client_Test.php b/Tests/Telemetry_Client_Test.php index 1cef3ba..d5cdf7f 100644 --- a/Tests/Telemetry_Client_Test.php +++ b/Tests/Telemetry_Client_Test.php @@ -10,7 +10,7 @@ class Telemetry_Client_Test extends TestCase { private $_telemetryClient; - protected function setUp() + protected function setUp(): void { $this->_telemetryClient = new \ApplicationInsights\Telemetry_Client(); diff --git a/composer.json b/composer.json index 23e26be..3e5bd67 100644 --- a/composer.json +++ b/composer.json @@ -10,7 +10,7 @@ "guzzlehttp/guzzle": ">=5.0 <=6.3.3" }, "require-dev": { - "phpunit/phpunit": "~4.8.36", + "phpunit/phpunit": "~5|~6|~7|~8|~9", "evert/phpdoc-md" : "~0.0.7" }, "autoload": { diff --git a/phpunit.xml b/phpunit.xml index 04d9caa..c49646e 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -1,24 +1,24 @@ - - bootstrap="/Tests/Bootstrap.php" - cacheTokens="false" - colors="false" - convertErrorsToExceptions="true" - convertNoticesToExceptions="true" - convertWarningsToExceptions="true" - forceCoversAnnotation="false" - mapTestClassNameToCoveredClassName="false" - printerClass="PHPUnit_TextUI_ResultPrinter" - - processIsolation="false" - stopOnError="false" - stopOnFailure="false" - stopOnIncomplete="false" - stopOnSkipped="false" - testSuiteLoaderClass="PHPUnit_Runner_StandardTestSuiteLoader" - - timeoutForSmallTests="1" - timeoutForMediumTests="10" - timeoutForLargeTests="60" - strict="false" - verbose="true" - \ No newline at end of file + + + From 10e5d1e1d962c7a861739a92903f12442c1de20d Mon Sep 17 00:00:00 2001 From: Antonio Ribeiro Date: Sun, 17 May 2020 13:42:04 +0200 Subject: [PATCH 2/5] Bump Guzzle version --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 3e5bd67..fb2921f 100644 --- a/composer.json +++ b/composer.json @@ -7,7 +7,7 @@ "license": "MIT", "require": { "php": ">=5.4.0", - "guzzlehttp/guzzle": ">=5.0 <=6.3.3" + "guzzlehttp/guzzle": "~5|~6" }, "require-dev": { "phpunit/phpunit": "~5|~6|~7|~8|~9", From c8a9b1d13aba44be64e77d4e4a291a1a772a791d Mon Sep 17 00:00:00 2001 From: Antonio Ribeiro Date: Sun, 17 May 2020 13:46:52 +0200 Subject: [PATCH 3/5] Bump PHP versions --- .travis.yml | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index c49bc1b..5d8e336 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,10 +1,15 @@ language: php install: composer install php: - - "5.4" - - "5.5" - - "5.6" - - "7.0" + - "7.1" + - "7.2" + - "7.3" + - "7.4" - nightly + +matrix: + allow_failures: + - php: nightly + script: - - phpunit -c phpunit.xml Tests/ \ No newline at end of file + - phpunit -c phpunit.xml Tests/ From 3ccc5d4663cb346b6e66b087365165646b8500ee Mon Sep 17 00:00:00 2001 From: Antonio Ribeiro Date: Sun, 17 May 2020 13:50:11 +0200 Subject: [PATCH 4/5] Run PHPUnit installed on vendor folder --- .travis.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index 5d8e336..60d1d8f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,15 +1,15 @@ language: php install: composer install php: + - "5.4" + - "5.5" + - "5.6" + - "7.0" - "7.1" - "7.2" - "7.3" - "7.4" - nightly -matrix: - allow_failures: - - php: nightly - script: - - phpunit -c phpunit.xml Tests/ + - vendor/bin/phpunit -c phpunit.xml Tests/ From 753ac447470a938dede1c5a34436262a9667a8c2 Mon Sep 17 00:00:00 2001 From: Antonio Ribeiro Date: Sun, 17 May 2020 13:54:29 +0200 Subject: [PATCH 5/5] Allow old PHP and nigthly to fail --- .travis.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.travis.yml b/.travis.yml index 60d1d8f..5624edb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,5 +11,13 @@ php: - "7.4" - nightly +matrix: + allow_failures: + - php: 5.4 + - php: 5.5 + - php: 5.6 + - php: 7.0 + - php: nightly + script: - vendor/bin/phpunit -c phpunit.xml Tests/