public function testAccessors()
 {
     $event = new InvalidItemEvent('Foo\\Bar\\Baz', 'No special reason.', array('%param%' => 'Item1'), array('foo' => 'baz'));
     $this->assertEquals('Foo\\Bar\\Baz', $event->getClass());
     $this->assertEquals('No special reason.', $event->getReason());
     $this->assertEquals(array('%param%' => 'Item1'), $event->getReasonParameters());
     $this->assertEquals(array('foo' => 'baz'), $event->getItem());
 }
Пример #2
0
 /**
  * Log invalid item event
  *
  * @param InvalidItemEvent $event
  */
 public function invalidItem(InvalidItemEvent $event)
 {
     $this->logger->warning(sprintf('The %s was unable to handle the following item: %s (REASON: %s)', $event->getClass(), $this->formatAsString($event->getItem()), $this->translator->trans($event->getReason(), $event->getReasonParameters(), $this->translationDomain, $this->translationLocale)));
 }