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:
@@ -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();
|
||||
|
||||
|
Reference in New Issue
Block a user