Skip to content

Commit 4e98a87

Browse files
ahmedash95nicolas-grekas
authored andcommitted
[Process] add tests for php executable finder if file does not exist
1 parent c19da50 commit 4e98a87

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

Tests/PhpExecutableFinderTest.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,4 +69,16 @@ public function testFindArguments()
6969
$this->assertEquals($f->findArguments(), [], '::findArguments() returns no arguments');
7070
}
7171
}
72+
73+
public function testNotExitsBinaryFile()
74+
{
75+
$f = new PhpExecutableFinder();
76+
$phpBinaryEnv = PHP_BINARY;
77+
putenv('PHP_BINARY=/usr/local/php/bin/php-invalid');
78+
79+
$this->assertFalse($f->find(), '::find() returns false because of not exist file');
80+
$this->assertFalse($f->find(false), '::find(false) returns false because of not exist file');
81+
82+
putenv('PHP_BINARY='.$phpBinaryEnv);
83+
}
7284
}

0 commit comments

Comments
 (0)