Example #1
0
 public function testExecutionPlanSerialization()
 {
     $loader = new TestClassLoader();
     $plan = $loader->loadFile(__DIR__ . '/fixtures/ASimpleTest.php');
     $executionPlans = $plan->getExecutionPlans();
     $this->assertEquals(1, count($executionPlans));
     $executionPlan = $executionPlans[0];
     $json = ExecutionPlanHelper::serialize($executionPlan);
     $unserialized = ExecutionPlanHelper::unSerialize($json);
     $this->assertEquals($executionPlan->toArray(), $unserialized->toArray());
 }
Example #2
0
File: Runner.php Project: djfm/ftr
 public function dispatchPlan()
 {
     if (empty($this->executionPlans)) {
         return [];
     }
     $data = [];
     $plan = array_shift($this->executionPlans);
     $this->dispatchedCount++;
     $planToken = count($this->executionPlans);
     $this->dispatchedPlans[$planToken] = ['dispatchedAt' => time(), 'plan' => $plan];
     $this->log('<comment>>>> Dispatching plan ' . $planToken . '</comment>');
     $data['planToken'] = $planToken;
     $data['plan'] = ExecutionPlanHelper::serialize($plan);
     return $data;
 }