AmqpExchangeMock.php 747B

123456789101112131415161718192021222324252627282930313233343536373839
  1. <?php
  2. /*
  3. * This file is part of the Monolog package.
  4. *
  5. * (c) Jordi Boggiano <j.boggiano@seld.be>
  6. *
  7. * For the full copyright and license information, please view the LICENSE
  8. * file that was distributed with this source code.
  9. */
  10. namespace Monolog\Handler;
  11. class AmqpExchangeMock extends \AMQPExchange
  12. {
  13. protected $messages = array();
  14. public function __construct()
  15. {
  16. }
  17. public function publish($message, $routing_key, $params = 0, $attributes = array())
  18. {
  19. $this->messages[] = array($message, $routing_key, $params, $attributes);
  20. return true;
  21. }
  22. public function getMessages()
  23. {
  24. return $this->messages;
  25. }
  26. public function setName($name)
  27. {
  28. return true;
  29. }
  30. }