20 $this->assertInstanceOf(
'Symfony\Component\Finder\Shell\Command',
Command::create());
26 $this->assertSame(
'--force', $cmd->join());
34 $this->assertSame(
'-F --force', $cmd->join());
42 $this->assertSame(
'--force -F', $cmd->join());
51 $this->assertSame(
'-F -X --force', $cmd->join());
57 $this->assertSame(0, $cmd->length());
60 $this->assertSame(1, $cmd->length());
63 $this->assertSame(2, $cmd->length());
71 $this->assertSame(
'--run --force', $cmd->join());
79 $cmd->ins(
'--something');
80 $cmd->top(
'--something');
81 $this->assertSame(
'--something --run --force ', $cmd->join());
89 $this->assertSame(
'--force '.escapeshellarg(
'--run'), $cmd->join());
97 $this->assertSame(
'--force run', $cmd->join());
105 $this->setExpectedException(
'RuntimeException');
114 $this->assertSame($parent, $cmd->end());
121 $this->setExpectedException(
'RuntimeException');
129 $this->setExpectedException(
'RuntimeException');
130 $cmd->get(
'invalid');
136 $handler =
function () {
return 'error-handler'; };
137 $cmd->setErrorHandler($handler);
139 $this->assertSame($handler, $cmd->getErrorHandler());
146 $cmd->add(
'--version');
147 $result = $cmd->execute();
149 $this->assertTrue(is_array($result));
150 $this->assertNotEmpty($result);
151 $this->assertRegexp(
'/PHP|HipHop/', $result[0]);
157 $cmd->add(
'--force');
160 $this->assertSame(
'--force --run', (
string) $cmd);