26 if (!class_exists(
'AMQPConnection') || !class_exists(
'AMQPExchange')) {
27 $this->markTestSkipped(
"amqp-php not installed");
30 if (!class_exists(
'AMQPChannel')) {
31 $this->markTestSkipped(
"Please update AMQP to version >= 1.0");
36 $exchange = $this->getMock(
'AMQPExchange',
array(
'publish',
'setName'),
array(),
'',
false);
37 $exchange->expects($this->once())
41 $exchange->expects($this->any())
60 'level_name' =>
'WARNING',
68 'content_type' =>
'application/json',
77 $this->assertEquals($expected,
$messages[0]);
82 if (!class_exists(
'PhpAmqpLib\Connection\AMQPConnection')) {
83 $this->markTestSkipped(
"php-amqplib not installed");
88 $exchange = $this->getMock(
'PhpAmqpLib\Channel\AMQPChannel',
array(
'basic_publish',
'__destruct'),
array(),
'',
false);
90 $exchange->expects($this->any())
91 ->method(
'basic_publish')
92 ->will($this->returnCallback(
function (AMQPMessage $msg, $exchange =
"", $routing_key =
"", $mandatory =
false, $immediate =
false, $ticket = null) use (&
$messages) {
93 $messages[] =
array($msg, $exchange, $routing_key, $mandatory, $immediate, $ticket);
109 'level_name' =>
'WARNING',
119 'delivery_mode' => 2,
120 'content_type' =>
'application/json',
130 $messages[0][0] = json_decode($msg->body,
true);
134 $this->assertEquals($expected,
$messages[0]);
getRecord($level=Logger::WARNING, $message='test', $context=array())
catch(Exception $e) $message
const WARNING
Exceptional occurrences that are not errors.
Create styles array
The data for the language used.