コード例 #1
0
ファイル: Callback.php プロジェクト: blazarecki/state-machine
 /**
  * {@inheritDoc}
  */
 public function isSatisfiedBy(TransitionEvent $event)
 {
     $config = $event->getConfig();
     return $this->isSatisfiedByClause('on', $event->getTransition()) && $this->isSatisfiedByClause('from', $event->getState()) && $this->isSatisfiedByClause('to', $config['to']);
 }
コード例 #2
0
 function it_doesnt_satisfies_excluded_from(TransitionEvent $event)
 {
     $specs = array('to' => 'tested-state-to', 'excluded_from' => 'tested-state-from');
     $this->beConstructedWith($specs, $this->callable);
     $event->getConfig()->willReturn($this->getConfig(array('tested-state-from'), 'tested-state-to'));
     $event->getTransition()->willReturn('dummy');
     $event->getState()->willReturn('tested-state-from');
     $this->isSatisfiedBy($event)->shouldReturn(false);
 }