1
0
mirror of https://github.com/Seldaek/monolog.git synced 2025-07-31 18:30:15 +02:00

Fix of PhpAmqpLib\Channel\AMQPChannel mock creation

__destruct was removed in v2.5.0, but version check is impossible
(\PhpAmqpLib\Package::VERSION was introduced in v2.11.1)
This commit is contained in:
Victor Pryazhnikov
2021-02-27 15:36:32 +03:00
parent 67294a3a5f
commit 240a159d44

View File

@@ -84,8 +84,13 @@ class AmqpHandlerTest extends TestCase
$messages = [];
$methodsToMock = ['basic_publish'];
if (method_exists('PhpAmqpLib\Channel\AMQPChannel', '__destruct')) {
$methodsToMock[] = '__destruct';
}
$exchange = $this->getMockBuilder('PhpAmqpLib\Channel\AMQPChannel')
->onlyMethods(['basic_publish', '__destruct'])
->onlyMethods($methodsToMock)
->disableOriginalConstructor()
->getMock();