@@ -8,7 +8,7 @@ class CLITest extends TestCase
88{
99 private function getCLI ($ getopt )
1010 {
11- $ cli = $ this ->getMockBuilder ('PhpMyAdmin\SqlParser\Utils\CLI ' )->setMethods ([ 'getopt ' ] )->getMock ();
11+ $ cli = $ this ->getMockBuilder ('PhpMyAdmin\SqlParser\Utils\CLI ' )->setMethods (array ( 'getopt ' ) )->getMock ();
1212 $ cli ->method ('getopt ' )->willReturn ($ getopt );
1313
1414 return $ cli ;
@@ -48,28 +48,28 @@ public function highlightParams()
4848 array (
4949 array ('q ' => 'SELECT 1 ' ),
5050 "\x1b[35mSELECT \n \x1b[92m1 \x1b[0m \n" ,
51- 0 ,
51+ 0
5252 ),
5353 array (
5454 array ('query ' => 'SELECT 1 ' ),
5555 "\x1b[35mSELECT \n \x1b[92m1 \x1b[0m \n" ,
56- 0 ,
56+ 0
5757 ),
5858 array (
5959 array (
6060 'q ' => 'SELECT /* comment */ 1 /* other */ ' ,
6161 'f ' => 'text ' ,
6262 ),
6363 "SELECT \n /* comment */ 1 /* other */ \n" ,
64- 0 ,
64+ 0
6565 ),
6666 array (
6767 array (
6868 'q ' => 'SELECT 1 ' ,
6969 'f ' => 'foo ' ,
7070 ),
7171 "ERROR: Invalid value for format! \n" ,
72- 1 ,
72+ 1
7373 ),
7474 array (
7575 array (
@@ -78,13 +78,13 @@ public function highlightParams()
7878 ),
7979 '<span class="sql-reserved">SELECT</span> ' . '<br/> ' .
8080 ' <span class="sql-number">1</span> ' . "\n" ,
81- 0 ,
81+ 0
8282 ),
8383 array (
8484 array ('h ' => true ),
8585 'Usage: highlight-query --query SQL [--format html|cli|text] ' . "\n" .
8686 ' cat file.sql | highlight-query ' . "\n" ,
87- 0 ,
87+ 0
8888 ),
8989 array (
9090 array (),
@@ -96,7 +96,7 @@ public function highlightParams()
9696 array (
9797 false ,
9898 '' ,
99- 1 ,
99+ 1
100100 )
101101 );
102102 }
@@ -225,7 +225,11 @@ public function testStdinPipe($cmd, $result)
225225
226226 public function stdinParams ()
227227 {
228- $ binPath = PHP_BINARY .' ' . dirname (__DIR__ ,2 ). '/bin/ ' ;
228+ if (defined ('PHP_BINARY ' )) {
229+ $ binPath = PHP_BINARY . ' ' . dirname (__DIR__ , 2 ) . '/bin/ ' ;
230+ } else {
231+ $ binPath = 'php ' . ' ' . realpath (dirname (__DIR__ ) . '/../ ' ) . '/bin/ ' ;
232+ }
229233
230234 return array (
231235 array ('echo "SELECT 1" | ' . $ binPath .'highlight-query ' , 0 ),
0 commit comments