Page MenuHomeDevCentral

D2710.id6880.diff
No OneTemporary

D2710.id6880.diff

diff --git a/composer.json b/composer.json
--- a/composer.json
+++ b/composer.json
@@ -21,15 +21,15 @@
"issues": "https://devcentral.nasqueron.org"
},
"require": {
- "php": ">=5.6.0",
- "guzzlehttp/psr7": "~1.3",
- "guzzlehttp/guzzle": "~6.0"
+ "php": ">=7.3",
+ "guzzlehttp/psr7": "^2.4.1",
+ "guzzlehttp/guzzle": "^7.5.0"
},
"require-dev": {
- "phpunit/phpunit": "5.0.*",
- "psy/psysh": "dev-master",
- "squizlabs/php_codesniffer": "*",
- "mockery/mockery": "^0.9.5"
+ "phpunit/phpunit": "^9.5.24",
+ "psy/psysh": "dev-main",
+ "squizlabs/php_codesniffer": "^3.7.1",
+ "mockery/mockery": "^1.5.1"
},
"autoload": {
"psr-4": {
diff --git a/phpunit.xml b/phpunit.xml
--- a/phpunit.xml
+++ b/phpunit.xml
@@ -1,13 +1,16 @@
-<?xml version="1.0" encoding="utf-8" ?>
-<phpunit bootstrap="./vendor/autoload.php">
- <testsuites>
- <testsuite name="Library test suite">
- <directory>./tests/</directory>
- </testsuite>
- </testsuites>
- <filter>
- <whitelist>
- <directory suffix=".php">src/</directory>
- </whitelist>
- </filter>
+<?xml version="1.0" encoding="utf-8"?>
+<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ bootstrap="./vendor/autoload.php"
+ xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd"
+ colors="true">
+ <coverage>
+ <include>
+ <directory suffix=".php">src/</directory>
+ </include>
+ </coverage>
+ <testsuites>
+ <testsuite name="Library test suite">
+ <directory>./tests/</directory>
+ </testsuite>
+ </testsuites>
</phpunit>
diff --git a/tests/MailgunMessageFactoryTest.php b/tests/MailgunMessageFactoryTest.php
--- a/tests/MailgunMessageFactoryTest.php
+++ b/tests/MailgunMessageFactoryTest.php
@@ -5,7 +5,7 @@
use Keruald\Mailgun\MailgunMessageFactory;
use Keruald\Mailgun\MailgunMessage;
-use PHPUnit_Framework_TestCase as TestCase;
+use PHPUnit\Framework\TestCase;
use stdClass;
@@ -18,7 +18,7 @@
*/
private $factory;
- public function setUp () {
+ public function setUp () : void {
$client = self::mockHttpClient();
$this->factory = new MailgunMessageFactory($client, "0000");
}
@@ -34,10 +34,9 @@
$this->assertInstanceOf(MailgunMessage::class, $message);
}
- /**
- * @expectedException \InvalidArgumentException
- */
+
public function testGetMessageFromPayloadThrowsExceptionWhenPayloadDoesNotContainUrlInformation () {
+ $this->expectException(\InvalidArgumentException::class);
$this->factory->getMessageFromPayload(new stdClass);
}
diff --git a/tests/MailgunMessageTest.php b/tests/MailgunMessageTest.php
--- a/tests/MailgunMessageTest.php
+++ b/tests/MailgunMessageTest.php
@@ -4,7 +4,7 @@
use Keruald\Mailgun\MailgunMessage;
-use PHPUnit_Framework_TestCase as TestCase;
+use PHPUnit\Framework\TestCase;
use stdClass;
class MailgunMessageTest extends TestCase {
@@ -16,7 +16,7 @@
*/
private $message;
- public function setUp() {
+ public function setUp() : void {
$client = self::mockHttpClient();
$this->message = new MailgunMessage($client, "https://api/msg", "0000");
}
@@ -36,10 +36,8 @@
);
}
- /**
- * @expectedException \RuntimeException
- */
public function testFetchThrowsExceptionWhenStatusCodeIsNot200 () {
+ $this->expectException(\RuntimeException::class);
$client = self::mockHttpClientWithCustomResponse(500, null);
$message = new MailgunMessage($client, "https://api/msg", "0000");
$message->get();
@@ -55,10 +53,8 @@
);
}
- /**
- * @expectedException \InvalidArgumentException
- */
public function testLoadFromEventPayloadWithWrongPayload () {
+ $this->expectException(\InvalidArgumentException::class);
$client = self::mockHttpClient();
$payload = new stdClass;
MailgunMessage::loadFromEventPayload($client, $payload, "0000");

File Metadata

Mime Type
text/plain
Expires
Sat, Nov 23, 11:54 (13 h, 36 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2257906
Default Alt Text
D2710.id6880.diff (3 KB)

Event Timeline