Metabor\Statemachine\StateCollection::getStates PHP Method

getStates() public method

public getStates ( )
    public function getStates()
    {
        return $this->states->getIterator();
    }

Usage Example

 /**
  *
  */
 public function testFiltersStatesThatHaveNoOutgoingTransitions()
 {
     $eventName = 'event';
     $stateCollection = new StateCollection();
     $helper = new SetupHelper($stateCollection);
     $helper->findOrCreateTransition('foo', 'bar', $eventName);
     $filter = new FilterStateByFinalState($stateCollection->getStates());
     $filteredStates = iterator_to_array($filter);
     $this->assertContains($stateCollection->getState('bar'), $filteredStates);
     $this->assertNotContains($stateCollection->getState('foo'), $filteredStates);
 }
All Usage Examples Of Metabor\Statemachine\StateCollection::getStates