Ejemplo n.º 1
0
 /**
  * @dataProvider getCanonicalNameProviderException
  *
  * @param mixed  $class
  * @param string $parameterType
  */
 public function testGetCanonicalNameException($class, $parameterType)
 {
     try {
         ClassUtils::getCanonicalName($class);
         $this->assertFalse(true, 'An exception should have been thrown.');
     } catch (Exception $exception) {
         $this->assertEquals('The class parameter should be of type string or object, "' . $parameterType . '" given.', $exception->getMessage());
     }
 }
 /**
  * @param AbstractEvent $event
  * @param bool          $asynchronous
  *
  * @return AbstractEvent
  */
 public function publish(AbstractEvent $event, $asynchronous = false)
 {
     $eventName = ClassUtils::getCanonicalName($event);
     $this->doPublish($this->getListeners($event, $asynchronous), $eventName, $event);
     return $event;
 }