2 namespace Drush\Preflight;
4 use PHPUnit\Framework\TestCase;
6 class ArgsPreprocessorTest extends TestCase
9 use \Drush\FixtureFactory;
12 * @dataProvider argTestValues
14 public function testArgPreprocessor(
25 $argProcessor = new ArgsPreprocessor();
26 $preflightArgs = new PreflightArgs();
27 $preflightArgs->setHomeDir($this->environment()->homeDir());
28 $argProcessor->parse($argv, $preflightArgs);
30 $this->assertEquals($unprocessedArgs, implode(',', $preflightArgs->args()));
31 $this->assertEquals($alias, $preflightArgs->alias());
32 $this->assertEquals($selectedSite, $preflightArgs->selectedSite());
33 $this->assertEquals($configPath, $preflightArgs->configPaths());
34 $this->assertEquals($aliasPath, $preflightArgs->aliasPaths());
37 public static function argTestValues()
54 'drush,status,version',
71 'drush,status,version',
88 'drush,status,version',
106 'drush,rsync,@from,@to,--delete',
124 'drush,status,--verbose',
130 '--root=/path/to/drupal',
141 'drush,status,--verbose',
159 'drush,status,--verbose',
167 '--config=/path/to/config',
176 'drush,status,--verbose',
184 '--config=/path/to/config',
185 '--config=/other/path/to/config',
190 ['/path/to/config','/other/path/to/config'],
194 'drush,status,--verbose',
209 ['/path/to/aliases'],
212 'drush,status,--verbose',
220 '--alias-path=/path/to/aliases',
226 ['/path/to/aliases'],
229 'drush,status,--verbose',
237 '--alias-path=/path/to/aliases',
238 '--alias-path=/other/path/to/aliases',
244 ['/path/to/aliases','/other/path/to/aliases'],
247 'drush,status,--verbose',
263 ['path/to/commands'],
265 'drush,status,--verbose',
273 '--include=/path/to/commands',
280 ['path/to/commands'],
282 'drush,status,--verbose',
290 '--include=/path/to/commands',
297 ['path/to/commands'],
299 'drush,status,--verbose',
307 '--include=/path/to/commands',
308 '--include=/other/path/to/commands',
315 ['path/to/commands','/other/path/to/commands'],
317 'drush,status,--verbose',
334 'drush,status,--verbose',
344 '--alias-path=/path/to/aliases',
345 '--config=/path/to/config',
346 '--root=/path/to/drupal',
347 '--include=/path/to/commands',
353 ['/path/to/aliases'],
354 ['path/to/commands'],
356 'drush,status,--verbose',