/** * @dataProvider splitDataProvider */ function testSplit($input, $expected) { $actual = Shellwords::split($input); $this->assertEquals($expected, $actual); }
protected function getDirectives() { if (null === $this->parsedDirectives) { $this->parsedDirectives = array(); foreach (explode("\n", $this->header) as $i => $line) { if (preg_match(static::DIRECTIVE_PATTERN, $line, $matches)) { $argv = Shellwords::split($matches[1]); $name = array_shift($argv); $this->parsedDirectives[$i] = array($i, $name, $argv); } } } return $this->parsedDirectives; }