Exemple #1
0
 /**
  * @depends      testAddTransition
  * @dataProvider testCanDataProvider
  */
 public function testCan($transitions, $can, $cannot)
 {
     foreach ($transitions as $transition) {
         $this->object->addTransition($transition);
     }
     $this->assertTrue($this->object->can($can));
     $this->assertFalse($this->object->can($cannot));
 }
Exemple #2
0
 /**
  * {@inheritdoc}
  */
 public function addState($state)
 {
     if (!$state instanceof StateInterface) {
         $state = new State($state);
     }
     $this->states[$state->getName()] = $state;
 }