@@ -47,9 +47,9 @@ public function testFind()
47
47
$ this ->setPath (dirname (PHP_BINARY ));
48
48
49
49
$ finder = new ExecutableFinder ;
50
- $ result = $ finder ->find (basename ( PHP_BINARY ));
50
+ $ result = $ finder ->find ($ this -> getPhpBinaryName ( ));
51
51
52
- $ this ->assertEquals ( $ result , PHP_BINARY );
52
+ $ this ->assertSamePath ( PHP_BINARY , $ result );
53
53
}
54
54
55
55
public function testFindWithDefault ()
@@ -83,9 +83,9 @@ public function testFindWithExtraDirs()
83
83
$ extraDirs = array (dirname (PHP_BINARY ));
84
84
85
85
$ finder = new ExecutableFinder ;
86
- $ result = $ finder ->find (basename ( PHP_BINARY ), null , $ extraDirs );
86
+ $ result = $ finder ->find ($ this -> getPhpBinaryName ( ), null , $ extraDirs );
87
87
88
- $ this ->assertEquals (PHP_BINARY , $ result );
88
+ $ this ->assertSamePath (PHP_BINARY , $ result );
89
89
}
90
90
91
91
public function testFindWithOpenBaseDir ()
@@ -105,8 +105,22 @@ public function testFindWithOpenBaseDir()
105
105
ini_set ('open_basedir ' , dirname (PHP_BINARY ).PATH_SEPARATOR .'/ ' );
106
106
107
107
$ finder = new ExecutableFinder ;
108
- $ result = $ finder ->find (basename ( PHP_BINARY ));
108
+ $ result = $ finder ->find ($ this -> getPhpBinaryName ( ));
109
109
110
- $ this ->assertEquals (PHP_BINARY , $ result );
110
+ $ this ->assertSamePath (PHP_BINARY , $ result );
111
+ }
112
+
113
+ private function assertSamePath ($ expected , $ tested )
114
+ {
115
+ if (defined ('PHP_WINDOWS_VERSION_BUILD ' )) {
116
+ $ this ->assertEquals (strtolower ($ expected ), strtolower ($ tested ));
117
+ } else {
118
+ $ this ->assertEquals ($ expected , $ tested );
119
+ }
120
+ }
121
+
122
+ private function getPhpBinaryName ()
123
+ {
124
+ return basename (PHP_BINARY , defined ('PHP_WINDOWS_VERSION_BUILD ' ) ? '.exe ' : '' );
111
125
}
112
126
}
0 commit comments