Fix: Method can also return null
This commit is contained in:
parent
3be0445596
commit
a7755f8663
@ -46,7 +46,7 @@ class ExecutableFinder
|
||||
* @param string $default The default to return if no executable is found
|
||||
* @param array $extraDirs Additional dirs to check into
|
||||
*
|
||||
* @return string The executable path or default value
|
||||
* @return string|null The executable path or default value
|
||||
*/
|
||||
public function find($name, $default = null, array $extraDirs = array())
|
||||
{
|
||||
|
@ -65,6 +65,21 @@ class ExecutableFinderTest extends TestCase
|
||||
$this->assertEquals($expected, $result);
|
||||
}
|
||||
|
||||
public function testFindWithNullAsDefault()
|
||||
{
|
||||
if (ini_get('open_basedir')) {
|
||||
$this->markTestSkipped('Cannot test when open_basedir is set');
|
||||
}
|
||||
|
||||
$this->setPath('');
|
||||
|
||||
$finder = new ExecutableFinder();
|
||||
|
||||
$result = $finder->find('foo');
|
||||
|
||||
$this->assertNull($result);
|
||||
}
|
||||
|
||||
public function testFindWithExtraDirs()
|
||||
{
|
||||
if (ini_get('open_basedir')) {
|
||||
|
Reference in New Issue
Block a user