assertEquals( $expectedCommand, $commandRenderer->render($actualCommand, $testArguments) ); } /** * @return array */ public function commandsDataProvider() { $testArgument = 'argument'; $testArgument2 = 'argument2'; $expectedCommand = "php -r %s 2>&1 | grep %s 2>&1"; $expectedCommandArgs = "php -r '" . $testArgument . "' 2>&1 | grep '" . $testArgument2 . "' 2>&1"; return [ [$expectedCommand, 'php -r %s | grep %s', []], [$expectedCommand, 'php -r %s 2>&1 | grep %s', []], [$expectedCommand, 'php -r %s 2>&1 2>&1 | grep %s', []], [$expectedCommandArgs, 'php -r %s | grep %s', [$testArgument, $testArgument2]], [$expectedCommandArgs, 'php -r %s 2>&1 | grep %s', [$testArgument, $testArgument2]], [$expectedCommandArgs, 'php -r %s 2>&1 2>&1 | grep %s', [$testArgument, $testArgument2]], ]; } }