66
77class CgiHttpKernelTest extends \PHPUnit_Framework_TestCase
88{
9+ private $ phpCgiBin ;
910 private $ kernel ;
1011
1112 public function __construct ()
1213 {
13- $ this ->kernel = new CgiHttpKernel (__DIR__ .'/Fixtures ' );
14+ $ this ->phpCgiBin = getenv ('CGI_HTTP_KERNEL_BIN ' );
15+ $ this ->kernel = new CgiHttpKernel (__DIR__ .'/Fixtures ' , null , $ this ->phpCgiBin );
1416 }
1517
1618 /** @test */
@@ -55,7 +57,7 @@ public function customErrorStatusCodeShouldBeSent()
5557 /** @test */
5658 public function frontControllerShouldLoadPathInfo ()
5759 {
58- $ this ->kernel = new CgiHttpKernel (__DIR__ .'/Fixtures ' , 'silex.php ' );
60+ $ this ->kernel = new CgiHttpKernel (__DIR__ .'/Fixtures ' , 'silex.php ' , $ this -> phpCgiBin );
5961
6062 $ request = Request::create ('/foo ' );
6163 $ response = $ this ->kernel ->handle ($ request );
@@ -66,7 +68,7 @@ public function frontControllerShouldLoadPathInfo()
6668 /** @test */
6769 public function frontControllerShouldConvertRequestMethod ()
6870 {
69- $ this ->kernel = new CgiHttpKernel (__DIR__ .'/Fixtures ' , 'silex.php ' );
71+ $ this ->kernel = new CgiHttpKernel (__DIR__ .'/Fixtures ' , 'silex.php ' , $ this -> phpCgiBin );
7072
7173 $ request = Request::create ('/baz ' , 'POST ' );
7274 $ response = $ this ->kernel ->handle ($ request );
@@ -77,7 +79,7 @@ public function frontControllerShouldConvertRequestMethod()
7779 /** @test */
7880 public function frontControllerShouldSupportPut ()
7981 {
80- $ this ->kernel = new CgiHttpKernel (__DIR__ .'/Fixtures ' , 'silex.php ' );
82+ $ this ->kernel = new CgiHttpKernel (__DIR__ .'/Fixtures ' , 'silex.php ' , $ this -> phpCgiBin );
8183
8284 $ request = Request::create ('/put-target ' , 'PUT ' );
8385 $ response = $ this ->kernel ->handle ($ request );
@@ -88,7 +90,7 @@ public function frontControllerShouldSupportPut()
8890 /** @test */
8991 public function frontControllerShouldSupportDelete ()
9092 {
91- $ this ->kernel = new CgiHttpKernel (__DIR__ .'/Fixtures ' , 'silex.php ' );
93+ $ this ->kernel = new CgiHttpKernel (__DIR__ .'/Fixtures ' , 'silex.php ' , $ this -> phpCgiBin );
9294
9395 $ request = Request::create ('/delete-target ' , 'DELETE ' );
9496 $ response = $ this ->kernel ->handle ($ request );
@@ -204,7 +206,7 @@ public function scriptNameShouldBeFrontController()
204206 /** @test */
205207 public function scriptNameShouldBeFrontControllerWithCustomFrontController ()
206208 {
207- $ this ->kernel = new CgiHttpKernel (__DIR__ .'/Fixtures ' , 'silex.php ' );
209+ $ this ->kernel = new CgiHttpKernel (__DIR__ .'/Fixtures ' , 'silex.php ' , $ this -> phpCgiBin );
208210
209211 $ request = Request::create ('/script-name ' );
210212 $ response = $ this ->kernel ->handle ($ request );
0 commit comments