Skip to content

Commit

Permalink
AMQP mock object
Browse files Browse the repository at this point in the history
  • Loading branch information
pomaxa committed Jun 15, 2012
1 parent 0932fd3 commit 7926343
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 17 deletions.
28 changes: 28 additions & 0 deletions tests/Monolog/Handler/AmqpExchangeMock.php
@@ -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;
}
}
18 changes: 1 addition & 17 deletions tests/Monolog/Handler/AmqpHandlerTest.php
Expand Up @@ -13,6 +13,7 @@

use Monolog\TestCase;
use Monolog\Logger;
use Monolog\Handler\MockAMQPExchange;

/**
* @covers Monolog\Handler\RotatingFileHandler
Expand Down Expand Up @@ -57,21 +58,4 @@ protected function getExchange()
*/
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;
}
}

0 comments on commit 7926343

Please sign in to comment.