Example #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];
 }
 /**
  * @dataProvider getShortcutsWithFormattedShortcuts
  *
  * @param string $shortcutNotation
  * @param string $formattedShortcut
  */
 public function testGetShortcutNotation($shortcutNotation, $formattedShortcut)
 {
     $shortcut = new EntityShortcut($shortcutNotation);
     $this->assertEquals($formattedShortcut, $shortcut->getShortcutNotation());
 }