mirror of
https://github.com/Seldaek/monolog.git
synced 2025-08-04 04:07:39 +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 = [];
|
$messages = [];
|
||||||
|
|
||||||
|
$methodsToMock = ['basic_publish'];
|
||||||
|
if (method_exists('PhpAmqpLib\Channel\AMQPChannel', '__destruct')) {
|
||||||
|
$methodsToMock[] = '__destruct';
|
||||||
|
}
|
||||||
|
|
||||||
$exchange = $this->getMockBuilder('PhpAmqpLib\Channel\AMQPChannel')
|
$exchange = $this->getMockBuilder('PhpAmqpLib\Channel\AMQPChannel')
|
||||||
->onlyMethods(['basic_publish', '__destruct'])
|
->onlyMethods($methodsToMock)
|
||||||
->disableOriginalConstructor()
|
->disableOriginalConstructor()
|
||||||
->getMock();
|
->getMock();
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user