mirror of
https://github.com/Seldaek/monolog.git
synced 2025-08-04 20:27:31 +02:00
AMQP mock object
This commit is contained in:
28
tests/Monolog/Handler/AmqpExchangeMock.php
Normal file
28
tests/Monolog/Handler/AmqpExchangeMock.php
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
/*
|
||||||
|
* This file is part of the Monolog package.
|
||||||
|
*
|
||||||
|
* (c) Jordi Boggiano <j.boggiano@seld.be>
|
||||||
|
*
|
||||||
|
* For the full copyright and license information, please view the LICENSE
|
||||||
|
* file that was distributed with this source code.
|
||||||
|
*/
|
||||||
|
namespace Monolog\Handler;
|
||||||
|
|
||||||
|
class MockAMQPExchange extends \AMQPExchange
|
||||||
|
{
|
||||||
|
public function __construct()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public function publish($message, $routing_key, $params = 0, $attributes = array())
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setName($name)
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
@@ -13,6 +13,7 @@ namespace Monolog\Handler;
|
|||||||
|
|
||||||
use Monolog\TestCase;
|
use Monolog\TestCase;
|
||||||
use Monolog\Logger;
|
use Monolog\Logger;
|
||||||
|
use Monolog\Handler\MockAMQPExchange;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @covers Monolog\Handler\RotatingFileHandler
|
* @covers Monolog\Handler\RotatingFileHandler
|
||||||
@@ -58,20 +59,3 @@ class AmqpHandlerTest extends TestCase
|
|||||||
return new MockAMQPExchange();
|
return new MockAMQPExchange();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class MockAMQPExchange extends \AMQPExchange
|
|
||||||
{
|
|
||||||
public function __construct()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
public function publish($message, $routing_key, $params = 0, $attributes = array())
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function setName($name)
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
Reference in New Issue
Block a user