[Process] add tests for php executable finder if file does not exist

This commit is contained in:
Ahmed 2019-11-25 19:09:41 +01:00 committed by Nicolas Grekas
parent f0a6de2736
commit 2b62dc3fc5

View File

@ -69,4 +69,16 @@ class PhpExecutableFinderTest extends TestCase
$this->assertEquals($f->findArguments(), [], '::findArguments() returns no arguments');
}
}
public function testNotExitsBinaryFile()
{
$f = new PhpExecutableFinder();
$phpBinaryEnv = PHP_BINARY;
putenv('PHP_BINARY=/usr/local/php/bin/php-invalid');
$this->assertFalse($f->find(), '::find() returns false because of not exist file');
$this->assertFalse($f->find(false), '::find(false) returns false because of not exist file');
putenv('PHP_BINARY='.$phpBinaryEnv);
}
}