Skip to content

Commit 1bf33b4

Browse files
committed
Removed 2.2 hack
1 parent a381137 commit 1bf33b4

File tree

1 file changed

+1
-50
lines changed

1 file changed

+1
-50
lines changed

src/Symfony/Cmf/Component/Testing/Phpunit/DatabaseTestListener.php

Lines changed: 1 addition & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class DatabaseTestListener implements \PHPUnit_Framework_TestListener
2626
public function __construct($processBuilder = null)
2727
{
2828
if (null === $processBuilder) {
29-
$this->processBuilder = new PrefixedProcessBuilder();
29+
$this->processBuilder = new ProcessBuilder();
3030
$phpExecutableFinder = new PhpExecutableFinder();
3131
$phpExecutable = $phpExecutableFinder->find();
3232
if (false !== $phpExecutable) {
@@ -219,52 +219,3 @@ public function endTestSuite(\PHPUnit_Framework_TestSuite $suite)
219219
}
220220
}
221221
}
222-
223-
class PrefixedProcessBuilder extends ProcessBuilder
224-
{
225-
private $prefixes = array();
226-
private $activated = true;
227-
228-
public function __construct(array $arguments = array())
229-
{
230-
parent::__construct($arguments);
231-
232-
if (class_exists('Symfony\Component\HttpKernel\Kernel')) {
233-
$this->activated = Kernel::VERSION_ID <= 20400;
234-
} else {
235-
$ref = new \ReflectionMethod(get_parent_class($this), 'setPrefix');
236-
$doc = $ref->getDocComment();
237-
238-
$this->activated = false === strpos('array', $doc);
239-
}
240-
}
241-
242-
public function setPrefix($prefix)
243-
{
244-
$prefixes = is_array($prefix) ? $prefix : array($prefix);
245-
246-
if (!$this->activated) {
247-
return parent::setPrefix($prefix);
248-
}
249-
250-
foreach ($prefixes as $prefix) {
251-
$this->prefixes[] = $prefix;
252-
}
253-
254-
return $this;
255-
}
256-
257-
public function getProcess()
258-
{
259-
if (!$this->activated || 0 === count($this->prefixes)) {
260-
return parent::getProcess();
261-
}
262-
263-
$process = parent::getProcess();
264-
$command = implode(' ', array_map('escapeshellarg', $this->prefixes)).' '.$process->getCommandLine();
265-
266-
$process->setCommandLine($command);
267-
268-
return $process;
269-
}
270-
}

0 commit comments

Comments
 (0)