Exemplo n.º 1
0
 public function parseShortcut($shortcut)
 {
     /* @throws \InvalidArgumentException if shortcut is not valid */
     $entityShortcut = new EntityShortcut($shortcut);
     /* @throws \InvalidArgumentException if bundle can not be found */
     $bundle = $this->findBundle($entityShortcut->getBundle());
     /* @throws \Exception if bundle alias is not known */
     $entityClass = $this->factory->getFqcnFromAlias($entityShortcut->getBundle(), $entityShortcut->getEntity());
     return [$bundle, $entityClass];
 }
Exemplo n.º 2
0
 /**
  * @dataProvider getShortcutsWithEntities
  *
  * @param string $shortcutNotation
  * @param string $entity
  */
 public function testGetEntity($shortcutNotation, $entity)
 {
     $shortcut = new EntityShortcut($shortcutNotation);
     $this->assertEquals($entity, $shortcut->getEntity());
 }