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 @@ - - - - ./tests/ - - - - - src/ - - + + + + src/ + + + + + ./tests/ + + diff --git a/tests/AMQPBrokerTest.php b/tests/AMQPBrokerTest.php --- a/tests/AMQPBrokerTest.php +++ b/tests/AMQPBrokerTest.php @@ -1,4 +1,4 @@ -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 @@ -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 @@ -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 @@ -