Beispiel #1
0
 public function exec($closure, $options = array())
 {
     $executor = new Executor($this, $closure, $options);
     $executor->execute();
 }
Beispiel #2
0
 public function testExecuteInSerial()
 {
     // nodes array
     $this->bufOutput->setVerbosity(3);
     $executedNodes = array();
     $executor = new Executor($this->runtimeTask, function ($process) use(&$executedNodes) {
         $executedNodes[] = $process->getNodeName();
     }, array("nodes" => array("127.0.0.1", "localhost")));
     $executor->setIsParallel(false);
     $this->assertEquals(false, $executor->getIsParallel());
     $executor->execute();
     // nodes string
     $output = $this->bufOutput->fetch();
     $this->assertRegExp("/Running serial mode/", $output);
     $this->assertCount(2, $executedNodes);
     $this->assertContains("127.0.0.1", $executedNodes);
     $this->assertContains("localhost", $executedNodes);
 }