/** * @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)); }
/** * {@inheritdoc} */ public function addState($state) { if (!$state instanceof StateInterface) { $state = new State($state); } $this->states[$state->getName()] = $state; }