Skip to content

Commit

Permalink
[5.6] Keep same string format and avoid potential test failure (#23056)
Browse files Browse the repository at this point in the history
* Keep same style and avoid potential test failure

`ProcessUtils::escapeArgument` will return a string wrapped by single quote `'string'`, but `artisan` is not wrapped.
This PR make them in a same style. 
Previous code could lead some potential test issue when running the test specifically in phpstorm targeting on one function `testMakeProcessCorrectlyFormatsCommandLine` in `tests/Queue/QueuePoolTest.php`.

Attached output dump
```
/usr/local/Cellar/php71/7.1.8_20/bin/php /Users/project/path/framework/vendor/bin/phpunit --configuration /Users/project/path/framework/phpunit.xml.dist --filter "/::testMakeProcessCorrectlyFormatsCommandLine( .*)?$/" Illuminate\Tests\Queue\QueueListenerTest /Users/project/path/framework/tests/Queue/QueueListenerTest.php --teamcity
PHPUnit 6.5.5 by Sebastian Bergmann and contributors.

Runtime:       PHP 7.1.8 with Xdebug 2.5.5
Configuration: /Users/project/path/framework/phpunit.xml.dist


Failed asserting that two strings are equal.
Expected :''/usr/local/Cellar/php71/7.1.8_20/bin/php' 'artisan' queue:work 'connection' --once --queue='queue' --delay=1 --memory=2 --sleep=3 --tries=0'
Actual   :''/usr/local/Cellar/php71/7.1.8_20/bin/php' artisan queue:work 'connection' --once --queue='queue' --delay=1 --memory=2 --sleep=3 --tries=0'
 <Click to see difference>

 /Users/project/path/framework/tests/Queue/QueueListenerTest.php:49
 


Time: 211 ms, Memory: 6.00MB

```

* Update to use utility to avoid different OS issue
  • Loading branch information
wanghanlin authored and taylorotwell committed Feb 7, 2018
1 parent 0892733 commit 04977e2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Illuminate/Queue/Listener.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ protected function artisanBinary()
{
return defined('ARTISAN_BINARY')
? ProcessUtils::escapeArgument(ARTISAN_BINARY)
: 'artisan';
: ProcessUtils::escapeArgument('artisan');
}

/**
Expand Down

0 comments on commit 04977e2

Please sign in to comment.