コード例 #1
0
 /**
  * @expectedException \Sonata\NotificationBundle\Exception\InvalidParameterException
  */
 public function testInvalidType()
 {
     $logger = $this->getMock('Symfony\\Component\\HttpKernel\\Log\\LoggerInterface');
     $message = new Message();
     $message->setBody(array('level' => 'ERROR', 'message' => 'Alert - Area 52 get compromised!!'));
     $event = new ConsumerEvent($message);
     $consumer = new LoggerConsumer($logger);
     $consumer->process($event);
 }
コード例 #2
0
 /**
  * @dataProvider getBodyValues
  */
 public function testGetValue($body, $names, $expected, $default)
 {
     $message = new Message();
     $message->setBody($body);
     $this->assertEquals($expected, $message->getValue($names, $default));
 }