Metabor\Statemachine\StateCollection::hasState PHP Method

hasState() public method

public hasState ( $name )
    public function hasState($name)
    {
        return $this->states->has($name);
    }

Usage Example

 public function testCreatesAllStatesFromSourceAtTargetColletions()
 {
     $targetCollection = new StateCollection();
     $merger = new StateCollectionMerger($targetCollection);
     $sourceCollection = $this->createSourceCollection();
     $this->assertFalse($targetCollection->hasState('new'));
     $this->assertFalse($targetCollection->hasState('in progress'));
     $this->assertFalse($targetCollection->hasState('done'));
     $merger->merge($sourceCollection);
     $this->assertTrue($targetCollection->hasState('new'));
     $this->assertTrue($targetCollection->hasState('in progress'));
     $this->assertTrue($targetCollection->hasState('done'));
 }
All Usage Examples Of Metabor\Statemachine\StateCollection::hasState