diff --git a/Tests/Command/BaseCommandTest.php b/Tests/Command/BaseCommandTest.php index 24d79bde..86c7ea18 100644 --- a/Tests/Command/BaseCommandTest.php +++ b/Tests/Command/BaseCommandTest.php @@ -2,7 +2,9 @@ namespace OldSound\RabbitMqBundle\Tests\Command; -abstract class BaseCommandTest extends \PHPUnit_Framework_TestCase +use PHPUnit\Framework\TestCase; + +abstract class BaseCommandTest extends TestCase { protected $application; protected $definition; diff --git a/Tests/Command/ConsumerCommandTest.php b/Tests/Command/ConsumerCommandTest.php index c0b18289..f7392f93 100644 --- a/Tests/Command/ConsumerCommandTest.php +++ b/Tests/Command/ConsumerCommandTest.php @@ -3,7 +3,6 @@ namespace OldSound\RabbitMqBundle\Tests\Command; use OldSound\RabbitMqBundle\Command\ConsumerCommand; - use Symfony\Component\Console\Input\InputOption; class ConsumerCommandTest extends BaseCommandTest diff --git a/Tests/Command/DynamicConsumerCommandTest.php b/Tests/Command/DynamicConsumerCommandTest.php index 83f0d8cb..1951815e 100644 --- a/Tests/Command/DynamicConsumerCommandTest.php +++ b/Tests/Command/DynamicConsumerCommandTest.php @@ -3,11 +3,11 @@ namespace OldSound\RabbitMqBundle\Tests\Command; use OldSound\RabbitMqBundle\Command\DynamicConsumerCommand; - use Symfony\Component\Console\Input\InputOption; -class DynamicConsumerCommandTest extends BaseCommandTest{ - +class DynamicConsumerCommandTest extends BaseCommandTest +{ + protected function setUp() { parent::setUp(); @@ -25,7 +25,7 @@ protected function setUp() $this->command = new DynamicConsumerCommand(); $this->command->setApplication($this->application); } - + /** * testInputsDefinitionCommand */ @@ -35,7 +35,7 @@ public function testInputsDefinitionCommand() $definition = $this->command->getDefinition(); $this->assertTrue($definition->hasArgument('name')); $this->assertTrue($definition->getArgument('name')->isRequired()); // Name is required to find the service - + $this->assertTrue($definition->hasArgument('context')); $this->assertTrue($definition->getArgument('context')->isRequired()); // Context is required for the queue options provider diff --git a/Tests/Command/MultipleConsumerCommandTest.php b/Tests/Command/MultipleConsumerCommandTest.php index ee2e1fca..332007bc 100644 --- a/Tests/Command/MultipleConsumerCommandTest.php +++ b/Tests/Command/MultipleConsumerCommandTest.php @@ -3,11 +3,11 @@ namespace OldSound\RabbitMqBundle\Tests\Command; use OldSound\RabbitMqBundle\Command\MultipleConsumerCommand; - use Symfony\Component\Console\Input\InputOption; -class MultipleConsumerCommandTest extends BaseCommandTest{ - +class MultipleConsumerCommandTest extends BaseCommandTest +{ + protected function setUp() { parent::setUp(); @@ -25,7 +25,7 @@ protected function setUp() $this->command = new MultipleConsumerCommand(); $this->command->setApplication($this->application); } - + /** * testInputsDefinitionCommand */ @@ -35,7 +35,7 @@ public function testInputsDefinitionCommand() $definition = $this->command->getDefinition(); $this->assertTrue($definition->hasArgument('name')); $this->assertTrue($definition->getArgument('name')->isRequired()); // Name is required to find the service - + $this->assertTrue($definition->hasArgument('context')); $this->assertFalse($definition->getArgument('context')->isRequired()); // Context is required for the queue options provider diff --git a/Tests/DependencyInjection/OldSoundRabbitMqExtensionTest.php b/Tests/DependencyInjection/OldSoundRabbitMqExtensionTest.php index a563577b..a142864b 100644 --- a/Tests/DependencyInjection/OldSoundRabbitMqExtensionTest.php +++ b/Tests/DependencyInjection/OldSoundRabbitMqExtensionTest.php @@ -9,8 +9,9 @@ use Symfony\Component\DependencyInjection\Loader\YamlFileLoader; use OldSound\RabbitMqBundle\DependencyInjection\OldSoundRabbitMqExtension; use Symfony\Component\DependencyInjection\Reference; +use PHPUnit\Framework\TestCase; -class OldSoundRabbitMqExtensionTest extends \PHPUnit_Framework_TestCase +class OldSoundRabbitMqExtensionTest extends TestCase { public function testFooConnectionDefinition() { diff --git a/Tests/Event/AfterProcessingMessageEventTest.php b/Tests/Event/AfterProcessingMessageEventTest.php index 8e1ae903..63ca5dd6 100644 --- a/Tests/Event/AfterProcessingMessageEventTest.php +++ b/Tests/Event/AfterProcessingMessageEventTest.php @@ -5,13 +5,14 @@ use OldSound\RabbitMqBundle\Event\AfterProcessingMessageEvent; use OldSound\RabbitMqBundle\RabbitMq\Consumer; use PhpAmqpLib\Message\AMQPMessage; +use PHPUnit\Framework\TestCase; /** * Class AfterProcessingMessageEventTest * * @package OldSound\RabbitMqBundle\Tests\Event */ -class AfterProcessingMessageEventTest extends \PHPUnit_Framework_TestCase +class AfterProcessingMessageEventTest extends TestCase { protected function getConsumer() { @@ -33,4 +34,4 @@ public function testEvent() $this->assertSame($AMQPMessage, $event->getAMQPMessage()); $this->assertSame($consumer, $event->getConsumer()); } -} \ No newline at end of file +} diff --git a/Tests/Event/BeforeProcessingMessageEventTest.php b/Tests/Event/BeforeProcessingMessageEventTest.php index 74929f27..5fae76e7 100644 --- a/Tests/Event/BeforeProcessingMessageEventTest.php +++ b/Tests/Event/BeforeProcessingMessageEventTest.php @@ -5,13 +5,14 @@ use OldSound\RabbitMqBundle\Event\BeforeProcessingMessageEvent; use OldSound\RabbitMqBundle\RabbitMq\Consumer; use PhpAmqpLib\Message\AMQPMessage; +use PHPUnit\Framework\TestCase; /** * Class BeforeProcessingMessageEventTest * * @package OldSound\RabbitMqBundle\Tests\Event */ -class BeforeProcessingMessageEventTest extends \PHPUnit_Framework_TestCase +class BeforeProcessingMessageEventTest extends TestCase { protected function getConsumer() { diff --git a/Tests/Event/OnIdleEventTest.php b/Tests/Event/OnIdleEventTest.php index ca62e622..06e9e9a8 100644 --- a/Tests/Event/OnIdleEventTest.php +++ b/Tests/Event/OnIdleEventTest.php @@ -4,13 +4,14 @@ use OldSound\RabbitMqBundle\Event\OnIdleEvent; use OldSound\RabbitMqBundle\RabbitMq\Consumer; +use PHPUnit\Framework\TestCase; /** * Class OnIdleEventTest * * @package OldSound\RabbitMqBundle\Tests\Event */ -class OnIdleEventTest extends \PHPUnit_Framework_TestCase +class OnIdleEventTest extends TestCase { protected function getConsumer() { diff --git a/Tests/Manager/MemoryCheckerTest.php b/Tests/Manager/MemoryCheckerTest.php index be889b0f..8870c628 100644 --- a/Tests/Manager/MemoryCheckerTest.php +++ b/Tests/Manager/MemoryCheckerTest.php @@ -4,13 +4,14 @@ use OldSound\RabbitMqBundle\MemoryChecker\MemoryConsumptionChecker; use OldSound\RabbitMqBundle\MemoryChecker\NativeMemoryUsageProvider; +use PHPUnit\Framework\TestCase; /** * Class MemoryManagerTest * * @package OldSound\RabbitMqBundle\Tests\Manager */ -class MemoryConsumptionCheckerTest extends \PHPUnit_Framework_TestCase +class MemoryConsumptionCheckerTest extends TestCase { public function testMemoryIsNotAlmostOverloaded() { diff --git a/Tests/RabbitMq/AMQPConnectionFactoryTest.php b/Tests/RabbitMq/AMQPConnectionFactoryTest.php index 14cc49e4..cd4004c2 100644 --- a/Tests/RabbitMq/AMQPConnectionFactoryTest.php +++ b/Tests/RabbitMq/AMQPConnectionFactoryTest.php @@ -5,8 +5,9 @@ use OldSound\RabbitMqBundle\Provider\ConnectionParametersProviderInterface; use OldSound\RabbitMqBundle\RabbitMq\AMQPConnectionFactory; use OldSound\RabbitMqBundle\Tests\RabbitMq\Fixtures\AMQPConnection; +use PHPUnit\Framework\TestCase; -class AMQPConnectionFactoryTest extends \PHPUnit_Framework_TestCase +class AMQPConnectionFactoryTest extends TestCase { public function testDefaultValues() { diff --git a/Tests/RabbitMq/BaseAmqpTest.php b/Tests/RabbitMq/BaseAmqpTest.php index 21d5044b..a1f25a9d 100644 --- a/Tests/RabbitMq/BaseAmqpTest.php +++ b/Tests/RabbitMq/BaseAmqpTest.php @@ -5,8 +5,9 @@ use OldSound\RabbitMqBundle\Event\AMQPEvent; use OldSound\RabbitMqBundle\RabbitMq\BaseAmqp; use OldSound\RabbitMqBundle\RabbitMq\Consumer; +use PHPUnit\Framework\TestCase; -class BaseAmqpTest extends \PHPUnit_Framework_TestCase +class BaseAmqpTest extends TestCase { public function testLazyConnection() diff --git a/Tests/RabbitMq/BaseConsumerTest.php b/Tests/RabbitMq/BaseConsumerTest.php index d894df46..5d518c22 100644 --- a/Tests/RabbitMq/BaseConsumerTest.php +++ b/Tests/RabbitMq/BaseConsumerTest.php @@ -3,8 +3,9 @@ namespace OldSound\RabbitMqBundle\Tests\RabbitMq; use OldSound\RabbitMqBundle\RabbitMq\BaseConsumer; +use PHPUnit\Framework\TestCase; -class BaseConsumerTest extends \PHPUnit_Framework_TestCase +class BaseConsumerTest extends TestCase { /** @var BaseConsumer */ protected $consumer; diff --git a/Tests/RabbitMq/BindingTest.php b/Tests/RabbitMq/BindingTest.php index 47ae8e0b..20d44548 100644 --- a/Tests/RabbitMq/BindingTest.php +++ b/Tests/RabbitMq/BindingTest.php @@ -2,10 +2,10 @@ namespace OldSound\RabbitMqBundle\Tests\RabbitMq; - use OldSound\RabbitMqBundle\RabbitMq\Binding; +use PHPUnit\Framework\TestCase; -class BindingTest extends \PHPUnit_Framework_TestCase +class BindingTest extends TestCase { protected function getBinding($amqpConnection, $amqpChannel) diff --git a/Tests/RabbitMq/ConsumerTest.php b/Tests/RabbitMq/ConsumerTest.php index ff0bc491..ec74aa03 100644 --- a/Tests/RabbitMq/ConsumerTest.php +++ b/Tests/RabbitMq/ConsumerTest.php @@ -10,9 +10,10 @@ use PhpAmqpLib\Exception\AMQPTimeoutException; use PhpAmqpLib\Message\AMQPMessage; use OldSound\RabbitMqBundle\RabbitMq\ConsumerInterface; +use PHPUnit\Framework\TestCase; -class ConsumerTest extends \PHPUnit_Framework_TestCase -{ +class ConsumerTest extends TestCase +{ protected function getConsumer($amqpConnection, $amqpChannel) { return new Consumer($amqpConnection, $amqpChannel); diff --git a/Tests/RabbitMq/DynamicConsumerTest.php b/Tests/RabbitMq/DynamicConsumerTest.php index 1e6e02e0..233a5f9e 100644 --- a/Tests/RabbitMq/DynamicConsumerTest.php +++ b/Tests/RabbitMq/DynamicConsumerTest.php @@ -5,12 +5,12 @@ use OldSound\RabbitMqBundle\RabbitMq\DynamicConsumer; class DynamicConsumerTest extends ConsumerTest -{ +{ public function getConsumer($amqpConnection, $amqpChannel) { return new DynamicConsumer($amqpConnection, $amqpChannel); } - + /** * Preparing QueueOptionsProviderInterface instance * @@ -21,14 +21,14 @@ private function prepareQueueOptionsProvider() return $this->getMockBuilder('\OldSound\RabbitMqBundle\Provider\QueueOptionsProviderInterface') ->getMock(); } - + public function testQueueOptionsPrivider() { $amqpConnection = $this->prepareAMQPConnection(); $amqpChannel = $this->prepareAMQPChannel(); $consumer = $this->getConsumer($amqpConnection, $amqpChannel); $consumer->setContext('foo'); - + $queueOptionsProvider = $this->prepareQueueOptionsProvider(); $queueOptionsProvider->expects($this->once()) ->method('getQueueOptions') @@ -40,12 +40,12 @@ public function testQueueOptionsPrivider() ) ) )); - + $consumer->setQueueOptionsProvider($queueOptionsProvider); - + $reflectionClass = new \ReflectionClass(get_class($consumer)); $reflectionMethod = $reflectionClass->getMethod('mergeQueueOptions'); $reflectionMethod->setAccessible(true); - $reflectionMethod->invoke($consumer); + $reflectionMethod->invoke($consumer); } } diff --git a/Tests/RabbitMq/MultipleConsumerTest.php b/Tests/RabbitMq/MultipleConsumerTest.php index ce05fce5..f917949f 100644 --- a/Tests/RabbitMq/MultipleConsumerTest.php +++ b/Tests/RabbitMq/MultipleConsumerTest.php @@ -8,8 +8,9 @@ use PhpAmqpLib\Channel\AMQPChannel; use PhpAmqpLib\Connection\AMQPConnection; use PhpAmqpLib\Message\AMQPMessage; +use PHPUnit\Framework\TestCase; -class MultipleConsumerTest extends \PHPUnit_Framework_TestCase +class MultipleConsumerTest extends TestCase { /** * Multiple consumer @@ -111,13 +112,13 @@ public function testQueuesProvider($processFlag, $expectedMethod, $expectedReque $this->multipleConsumer->processQueueMessage('test-1', $amqpMessage); $this->multipleConsumer->processQueueMessage('test-2', $amqpMessage); } - + public function testQueuesPrivider() { $amqpConnection = $this->prepareAMQPConnection(); $amqpChannel = $this->prepareAMQPChannel(); $this->multipleConsumer->setContext('foo'); - + $queuesProvider = $this->prepareQueuesProvider(); $queuesProvider->expects($this->once()) ->method('getQueues') @@ -126,13 +127,13 @@ public function testQueuesPrivider() 'queue_foo' => array() ) )); - + $this->multipleConsumer->setQueuesProvider($queuesProvider); - + $reflectionClass = new \ReflectionClass(get_class($this->multipleConsumer)); $reflectionMethod = $reflectionClass->getMethod('mergeQueues'); $reflectionMethod->setAccessible(true); - $reflectionMethod->invoke($this->multipleConsumer); + $reflectionMethod->invoke($this->multipleConsumer); } /** @@ -268,4 +269,4 @@ private function prepareCallback($processFlag) return $processFlag; }; } -} \ No newline at end of file +} diff --git a/Tests/RabbitMq/RpcClientTest.php b/Tests/RabbitMq/RpcClientTest.php index d1102885..40b51eb4 100644 --- a/Tests/RabbitMq/RpcClientTest.php +++ b/Tests/RabbitMq/RpcClientTest.php @@ -4,8 +4,9 @@ use OldSound\RabbitMqBundle\RabbitMq\RpcClient; use PhpAmqpLib\Message\AMQPMessage; +use PHPUnit\Framework\TestCase; -class RpcClientTest extends \PHPUnit_Framework_TestCase +class RpcClientTest extends TestCase { public function testProcessMessageWithCustomUnserializer() { diff --git a/Tests/RabbitMq/RpcServerTest.php b/Tests/RabbitMq/RpcServerTest.php index 0155871b..76f09e19 100644 --- a/Tests/RabbitMq/RpcServerTest.php +++ b/Tests/RabbitMq/RpcServerTest.php @@ -4,8 +4,9 @@ use OldSound\RabbitMqBundle\RabbitMq\RpcServer; use PhpAmqpLib\Message\AMQPMessage; +use PHPUnit\Framework\TestCase; -class RpcServerTest extends \PHPUnit_Framework_TestCase +class RpcServerTest extends TestCase { public function testProcessMessageWithCustomSerializer() { @@ -38,4 +39,3 @@ public function testProcessMessageWithCustomSerializer() $server->processMessage($message); } } - diff --git a/composer.json b/composer.json index f6d1a20b..76bcf477 100644 --- a/composer.json +++ b/composer.json @@ -21,7 +21,7 @@ "require-dev": { "symfony/serializer": "^2.7|^3.0|^4.0", "symfony/debug": "^2.7|^3.0|^4.0", - "phpunit/phpunit": "^4.8|^5.0" + "phpunit/phpunit": "^4.8.35|^5.4.3" }, "replace": { "oldsound/rabbitmq-bundle": "self.version"