From e06b6fcf039e401009e25e4e229e44bc6c4b47c1 Mon Sep 17 00:00:00 2001 From: Robbie <13571547+robbielove@users.noreply.github.com> Date: Wed, 13 May 2020 16:57:24 +1000 Subject: [PATCH 1/8] Update composer.json --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 3bdbb3d..df7136b 100644 --- a/composer.json +++ b/composer.json @@ -22,7 +22,7 @@ "minimum-stability": "stable", "require": { "php": "^5.4|^7.0", - "monolog/monolog": "^1.11" + "monolog/monolog": "^1.11 || ^2.0" }, "require-dev": { "phpunit/phpunit": "^4.0|^5.0" From c14fdf36002fb960663f275e3046a4266478a31f Mon Sep 17 00:00:00 2001 From: Robbie <13571547+robbielove@users.noreply.github.com> Date: Thu, 14 May 2020 22:32:07 +1000 Subject: [PATCH 2/8] Update composer.json --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index df7136b..c5d9bdf 100644 --- a/composer.json +++ b/composer.json @@ -22,7 +22,7 @@ "minimum-stability": "stable", "require": { "php": "^5.4|^7.0", - "monolog/monolog": "^1.11 || ^2.0" + "monolog/monolog": "^1.11|^2.0" }, "require-dev": { "phpunit/phpunit": "^4.0|^5.0" From e1096f14ac44c6a46c7fe5030f84acb599717abc Mon Sep 17 00:00:00 2001 From: Tortue Torche Date: Fri, 27 Nov 2020 12:21:06 +0100 Subject: [PATCH 3/8] Update MailgunHandler to be compatible with Monolog 2 --- src/Handler/MailgunHandler.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Handler/MailgunHandler.php b/src/Handler/MailgunHandler.php index 3672b6b..21f82d5 100644 --- a/src/Handler/MailgunHandler.php +++ b/src/Handler/MailgunHandler.php @@ -36,7 +36,7 @@ public function __construct($to, $subject, $from, $token, $domain, $level = Logg /** * {@inheritdoc} */ - protected function send($content, array $records) + protected function send(string $content, array $records): void { $auth = base64_encode("api:".$this->token); From e73ae046a0bc06b57ee96de79a34c42955bc7e41 Mon Sep 17 00:00:00 2001 From: Tortue Torche Date: Fri, 27 Nov 2020 12:21:34 +0100 Subject: [PATCH 4/8] Update Travis CI and composer config to use PHP >= 7.2 --- .travis.yml | 8 +++----- composer.json | 6 +++--- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/.travis.yml b/.travis.yml index 928b259..5340286 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,11 +1,9 @@ language: php php: - - 5.5.9 - - 5.5 - - 5.6 - - 7.0 - - hhvm + - 7.2 + - 7.3 + - 7.4 env: matrix: diff --git a/composer.json b/composer.json index c5d9bdf..7be1ee0 100644 --- a/composer.json +++ b/composer.json @@ -21,11 +21,11 @@ }, "minimum-stability": "stable", "require": { - "php": "^5.4|^7.0", - "monolog/monolog": "^1.11|^2.0" + "php": "^7.2", + "monolog/monolog": "^2.0" }, "require-dev": { - "phpunit/phpunit": "^4.0|^5.0" + "phpunit/phpunit": "^5.0" }, "authors": [ { From e5547679a53a6566c92963e49ee8472470a4f3ea Mon Sep 17 00:00:00 2001 From: Tortue Torche Date: Fri, 27 Nov 2020 12:24:48 +0100 Subject: [PATCH 5/8] Fix tests with PHPUnit --- tests/MailgunHandlerTest.php | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/tests/MailgunHandlerTest.php b/tests/MailgunHandlerTest.php index 8185b6f..9f4daeb 100644 --- a/tests/MailgunHandlerTest.php +++ b/tests/MailgunHandlerTest.php @@ -22,10 +22,7 @@ public function testItThrowsExceptionWithUnsupportedVersion() private function createHandler($to = "to@test.com",$subject = "Test subject",$from = "from@test.com",$token = "Token",$domain = "test.com", $level = Logger::CRITICAL, $bubble = true, $host = 'api.mailgun.net', $version = 'v3') { $constructorArgs = array($to, $subject, $from, $token, $domain, $level, $bubble, $host, $version); - $this->handler = $this->getMock( - '\Tylercd100\Monolog\Handler\MailgunHandler', - array(), - $constructorArgs - ); + $this->handler = $this->getMockBuilder(MailgunHandler::class) + ->setConstructorArgs($constructorArgs)->getMock(); } } From 8a5870f0a1d672639520d81f410630aa91ceddab Mon Sep 17 00:00:00 2001 From: Tortue Torche Date: Fri, 27 Nov 2020 12:28:03 +0100 Subject: [PATCH 6/8] Clean Travis CI config --- .travis.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index 5340286..f54f092 100644 --- a/.travis.yml +++ b/.travis.yml @@ -16,8 +16,3 @@ before_script: script: - vendor/bin/phpunit - - if [ "$TRAVIS_PHP_VERSION" == "5.5.9" ] || [ "$TRAVIS_PHP_VERSION" == "5.5" ] || [ "$TRAVIS_PHP_VERSION" == "5.6" ]; then vendor/bin/phpunit --coverage-clover build/logs/clover.xml; fi - -after_script: - - if [ "$TRAVIS_PHP_VERSION" == "5.5.9" ] || [ "$TRAVIS_PHP_VERSION" == "5.5" ] || [ "$TRAVIS_PHP_VERSION" == "5.6" ]; then wget https://scrutinizer-ci.com/ocular.phar; fi - - if [ "$TRAVIS_PHP_VERSION" == "5.5.9" ] || [ "$TRAVIS_PHP_VERSION" == "5.5" ] || [ "$TRAVIS_PHP_VERSION" == "5.6" ]; then php ocular.phar code-coverage:upload --format=php-clover build/logs/clover.xml; fi From be6a37c55d6c13d80ed3035b55868c1fd08c00f9 Mon Sep 17 00:00:00 2001 From: Tortue Torche Date: Mon, 30 Nov 2020 10:32:25 +0100 Subject: [PATCH 7/8] Add PHP 8.0 support --- .travis.yml | 1 + composer.json | 7 ++++--- tests/MailgunHandlerTest.php | 9 ++++++--- tests/TestCase.php | 3 ++- 4 files changed, 13 insertions(+), 7 deletions(-) diff --git a/.travis.yml b/.travis.yml index f54f092..a58d062 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,6 +4,7 @@ php: - 7.2 - 7.3 - 7.4 + - 8.0snapshot env: matrix: diff --git a/composer.json b/composer.json index 7be1ee0..2c5ecc8 100644 --- a/composer.json +++ b/composer.json @@ -19,13 +19,14 @@ "Tylercd100\\Monolog\\Tests\\": "tests/" } }, - "minimum-stability": "stable", + "minimum-stability": "dev", + "prefer-stable": true, "require": { - "php": "^7.2", + "php": "^7.2|^8.0", "monolog/monolog": "^2.0" }, "require-dev": { - "phpunit/phpunit": "^5.0" + "phpunit/phpunit": "^8.0|^9.0" }, "authors": [ { diff --git a/tests/MailgunHandlerTest.php b/tests/MailgunHandlerTest.php index 9f4daeb..975998a 100644 --- a/tests/MailgunHandlerTest.php +++ b/tests/MailgunHandlerTest.php @@ -11,18 +11,21 @@ class MailgunHandlerTest extends TestCase public function testItCanBeInstantiated() { $handler = $this->createHandler("to@test.com", "Test subject", "from@test.com", "Token", "test.com"); + $this->assertTrue(true); // Previous line doesn't thrown an exception } public function testItThrowsExceptionWithUnsupportedVersion() { - $this->setExpectedException(Exception::class); - $handler = $this->createHandler("to@test.com", "Test subject", "from@test.com", "Token", "test.com", 100, true, 'api.mailgun.net', 'v0'); + $this->expectException(Exception::class); + $handler = $this->createHandler("to@test.com", "Test subject", "from@test.com", "Token", "test.com", 100, true, 'api.mailgun.net', 'v0'); } private function createHandler($to = "to@test.com",$subject = "Test subject",$from = "from@test.com",$token = "Token",$domain = "test.com", $level = Logger::CRITICAL, $bubble = true, $host = 'api.mailgun.net', $version = 'v3') { $constructorArgs = array($to, $subject, $from, $token, $domain, $level, $bubble, $host, $version); $this->handler = $this->getMockBuilder(MailgunHandler::class) - ->setConstructorArgs($constructorArgs)->getMock(); + ->setMethods([]) + ->setConstructorArgs($constructorArgs) + ->getMock(); } } diff --git a/tests/TestCase.php b/tests/TestCase.php index b0cff75..8cc5db4 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -12,8 +12,9 @@ namespace Tylercd100\Monolog\Tests; use Monolog\Logger; +use PHPUnit\Framework\TestCase as PHPUnitTestCase; -class TestCase extends \PHPUnit_Framework_TestCase +class TestCase extends PHPUnitTestCase { /** * @return array Record From 9de0576e1cb2e06504c9d68172dc5290d0221152 Mon Sep 17 00:00:00 2001 From: Tortue Torche Date: Mon, 30 Nov 2020 10:49:16 +0100 Subject: [PATCH 8/8] Fix PHPUnit dependency for PHP 7.4 See: https://github.com/sebastianbergmann/phpunit/issues/3728#issuecomment-504287305 --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 2c5ecc8..7c66226 100644 --- a/composer.json +++ b/composer.json @@ -26,7 +26,7 @@ "monolog/monolog": "^2.0" }, "require-dev": { - "phpunit/phpunit": "^8.0|^9.0" + "phpunit/phpunit": "^8.2.3|^9.0" }, "authors": [ {