Page MenuHomeDevCentral

D2890.id7370.diff
No OneTemporary

D2890.id7370.diff

diff --git a/.gitignore b/.gitignore
--- a/.gitignore
+++ b/.gitignore
@@ -1,2 +1,3 @@
/vendor/
composer.lock
+.phpunit.cache/
diff --git a/composer.json b/composer.json
--- a/composer.json
+++ b/composer.json
@@ -25,11 +25,11 @@
"issues": "http://devcentral.nasqueron.org"
},
"require": {
- "php": ">=5.6.0",
+ "php": ">=8.1.0",
"php-amqplib/php-amqplib": "2.5.*"
},
"require-dev": {
- "phpunit/phpunit": "5.0.*",
+ "phpunit/phpunit": "10.0.*",
"squizlabs/php_codesniffer": "*"
},
"autoload": {
diff --git a/phpunit.xml b/phpunit.xml
--- a/phpunit.xml
+++ b/phpunit.xml
@@ -1,21 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
-<phpunit backupGlobals="false"
- backupStaticAttributes="false"
- bootstrap="vendor/autoload.php"
- colors="true"
- convertErrorsToExceptions="true"
- convertNoticesToExceptions="true"
- convertWarningsToExceptions="true"
- processIsolation="false"
- stopOnFailure="false">
- <testsuites>
- <testsuite name="Application Test Suite">
- <directory>./tests/</directory>
- </testsuite>
- </testsuites>
- <filter>
- <whitelist>
- <directory suffix=".php">src/</directory>
- </whitelist>
- </filter>
+<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ backupGlobals="false" bootstrap="vendor/autoload.php"
+ colors="true" processIsolation="false" stopOnFailure="false"
+ xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.0/phpunit.xsd"
+ cacheDirectory=".phpunit.cache" backupStaticProperties="false">
+ <coverage>
+ <include>
+ <directory suffix=".php">src/</directory>
+ </include>
+ </coverage>
+ <testsuites>
+ <testsuite name="Application Test Suite">
+ <directory>./tests/</directory>
+ </testsuite>
+ </testsuites>
</phpunit>
diff --git a/tests/AMQPBrokerTest.php b/tests/AMQPBrokerTest.php
--- a/tests/AMQPBrokerTest.php
+++ b/tests/AMQPBrokerTest.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace Keruald\Broker\Tests;
@@ -10,7 +10,7 @@
*/
protected $instance;
- protected function setUp() {
+ protected function setUp() : void {
$this->instance = new AMQPBroker();
}
diff --git a/tests/BlackholeBrokerTest.php b/tests/BlackholeBrokerTest.php
--- a/tests/BlackholeBrokerTest.php
+++ b/tests/BlackholeBrokerTest.php
@@ -1,7 +1,8 @@
-<?php
+<?php declare(strict_types=1);
namespace Keruald\Broker\Tests;
+use BadFunctionCallException;
use Keruald\Broker\BlackholeBroker;
class BlackholeBrokerTest extends TestCase {
@@ -10,15 +11,14 @@
*/
protected $instance;
- protected function setUp() {
+ protected function setUp() : void {
$this->instance = new BlackholeBroker();
}
- /**
- * @expectedException \BadFunctionCallException
- */
public function testNonDefaultOmnipotence () {
// By default, our blackhole broker shouldn't accept any method.
+ $this->expectException(BadFunctionCallException::class);
+
$this->instance->spreadLove();
}
diff --git a/tests/BrokerFactoryTest.php b/tests/BrokerFactoryTest.php
--- a/tests/BrokerFactoryTest.php
+++ b/tests/BrokerFactoryTest.php
@@ -1,7 +1,7 @@
-<?php
-
+<?php declare(strict_types=1);
namespace Keruald\Broker\Tests;
+use InvalidArgumentException;
use Keruald\Broker\BrokerFactory;
class BrokerFactoryTest extends TestCase {
@@ -19,6 +19,8 @@
}
public function testOmnipotenceBlackhole () {
+ $this->expectNotToPerformAssertions();
+
$broker = BrokerFactory::make([
'driver' => 'blackhole',
'omnipotence' => true,
@@ -26,17 +28,15 @@
$broker->spreadLove(); // a method not in Broker abstract class
}
- /**
- * @expectedException InvalidArgumentException
- */
public function testEmptyParameters () {
+ $this->expectException(InvalidArgumentException::class);
+
BrokerFactory::make([]);
}
- /**
- * @expectedException InvalidArgumentException
- */
public function testInvalidParameters () {
+ $this->expectException(InvalidArgumentException::class);
+
BrokerFactory::make([
'foo' => 'bar'
]);
diff --git a/tests/TestCase.php b/tests/TestCase.php
--- a/tests/TestCase.php
+++ b/tests/TestCase.php
@@ -1,8 +1,10 @@
-<?php
+<?php declare(strict_types=1);
namespace Keruald\Broker\Tests;
-class TestCase extends \PHPUnit_Framework_TestCase {
+use PHPUnit\Framework\TestCase as BaseTestCase;
+
+class TestCase extends BaseTestCase {
/**
* Asserts the specified object follows a method cascading pattern
*
@@ -15,7 +17,7 @@
// to our test, then we call one par one each method,
// each time verifying the returned type is still the same.
- $type = get_class($instance);
+ $type = $instance::class;
foreach ($methodsCascade as $method) {
$methodName = array_shift($method);

File Metadata

Mime Type
text/plain
Expires
Tue, Dec 24, 05:51 (11 h, 17 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2313626
Default Alt Text
D2890.id7370.diff (4 KB)

Event Timeline