File tree Expand file tree Collapse file tree 1 file changed +31
-0
lines changed
Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Original file line number Diff line number Diff line change 1414 */
1515class CliTest extends \PHPUnit_Framework_TestCase
1616{
17+ private static $ server ;
18+
19+ /**
20+ * Backup $_SERVER settings.
21+ */
22+ public function setUp ()
23+ {
24+ self ::$ server = $ _SERVER ;
25+ }
26+
27+ /**
28+ * Restore $_SERVER settings.
29+ */
30+ public function tearDown ()
31+ {
32+ $ _SERVER = self ::$ server ;
33+ }
34+
1735 /**
1836 * Test detectCmdLocation Exception
1937 *
@@ -86,6 +104,19 @@ public function testDetectCmdLocationWithOptionalLocation()
86104 $ this ->assertEquals ($ cmdPath , $ result , 'foo command should be found ' );
87105 }
88106
107+ /**
108+ * Tests Cli::getEnvPath
109+ *
110+ * @expectedException \RuntimeException
111+ */
112+ public function testGetEnvPathFail ()
113+ {
114+ unset($ _SERVER ['PATH ' ]);
115+ unset($ _SERVER ['Path ' ]);
116+ unset($ _SERVER ['path ' ]);
117+ $ path = Cli::getEnvPath ();
118+ }
119+
89120 /**
90121 * Tests Cli::isAbsolutePath
91122 */
You can’t perform that action at this time.
0 commit comments