コード例 #1
0
 public function testNotHasState()
 {
     $stateMachine = new StateMachine();
     $stateMachine->setState('FOO', 'bar');
     $this->assertFalse($stateMachine->hasState('foo'));
     $this->assertTrue($stateMachine->hasState('FOO'));
 }
コード例 #2
0
 public function testHasStateWithValue()
 {
     $twigExtension = new StateMachineExtension();
     $stateMachine = new StateMachine();
     $stateMachine->setState('FOO', 'bar');
     $this->assertTrue($twigExtension->hasStateWithValue('FOO', 'bar'));
     $this->assertFalse($twigExtension->hasStateWithValue('NOT PRESENT', 'foobar'));
 }