示例#1
0
 /**
  * @dataProvider getArgvAndTargets
  */
 public function testRunALocalTask($argv, $target, $expected)
 {
     $_SERVER['argv'] = $argv;
     $output = fopen("php://memory", 'r+');
     $idx = new Idephix($target, new SSH\SshClient(new SSH\FakeSsh2Proxy($this)), new StreamOutput($output));
     $idx->getApplication()->setAutoExit(false);
     $idx->add('foo', function () use($idx) {
         $idx->local('echo "Hello World from ' . $idx->getCurrentTargetHost() . '"');
     });
     $idx->run();
     rewind($output);
     $this->assertEquals($expected, stream_get_contents($output));
 }