コード例 #1
0
ファイル: Drawer.php プロジェクト: spryker/Oms
 /**
  * @param \Spryker\Zed\Oms\Business\Process\TransitionInterface $transition
  * @param string $label
  *
  * @return array
  */
 protected function addEdgeEventText(TransitionInterface $transition, $label)
 {
     if ($transition->hasEvent()) {
         $event = $transition->getEvent();
         if ($event->isOnEnter()) {
             $label[] = '<b>' . $event->getName() . ' (on enter)</b>';
         } else {
             $label[] = '<b>' . $event->getName() . '</b>';
         }
         if ($event->hasTimeout()) {
             $label[] = 'timeout: ' . $event->getTimeout();
         }
         if ($event->hasCommand()) {
             $commandLabel = 'c:' . $event->getCommand();
             if ($this->commands->has($event->getCommand())) {
                 $commandModel = $this->commands->get($event->getCommand());
                 if ($commandModel instanceof CommandByOrderInterface) {
                     $commandLabel .= ' (by order)';
                 } else {
                     $commandLabel .= ' (by item)';
                 }
             } else {
                 $commandLabel .= ' ' . $this->notImplemented;
             }
             $label[] = $commandLabel;
         }
         if ($event->isManual()) {
             $label[] = 'manually executable';
         }
     } else {
         $label[] = '&infin;';
     }
     return $label;
 }
コード例 #2
0
ファイル: CommandCollectionTest.php プロジェクト: spryker/Oms
 /**
  * @return void
  */
 public function testGetShouldThrowException()
 {
     $commandCollection = new CommandCollection();
     $this->expectException(CommandNotFoundException::class);
     $commandCollection->get(self::COMMAND_NAME);
 }