コード例 #1
0
ファイル: FactoryTest.php プロジェクト: potfur/statemachine
 public function testResolveTimeoutsForAllMachines()
 {
     $factory = new Factory();
     $factory->register('testSchema', $this->definition);
     $factory->triggerEvent('testSchema', 'do', 1);
     usleep(2000000);
     // 2s
     $result = $factory->resolveTimeouts();
     $this->assertEquals(['testSchema' => [1 => ['new', 'pending', 'done']]], $result);
 }
コード例 #2
0
ファイル: FactoryTest.php プロジェクト: potfur/statemachine
 /**
  * @dataProvider schemaProvider
  */
 public function testResolveTimeoutsWithDifferentAttributeType($schema)
 {
     $this->machine->expects($this->exactly(1))->method('resolveTimeouts')->with();
     $factory = new Factory();
     $factory->register('foo', function () {
         return $this->machine;
     });
     $factory->resolveTimeouts($schema);
 }