GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — added stdin testcoverage · phpmyadmin/sql-parser@67ca444

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • tests/Utils
    • CLITest.php
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎tests/Utils/CLITest.php‎

Copy file name to clipboardExpand all lines: tests/Utils/CLITest.php
+26Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,4 +205,30 @@ public function tokenizeParams()
205205
],
206206
];
207207
}
208+
209+
/**
210+
* @dataProvider stdinParams
211+
*
212+
* @param string $cmd
213+
* @param int $result
214+
*/
215+
public function testStdinPipe($cmd, $result)
216+
{
217+
exec ($cmd, $out, $ret);
218+
$this->assertSame($result, $ret);
219+
}
220+
221+
public function stdinParams()
222+
{
223+
$binPath = PHP_BINARY .' '. dirname(__DIR__,2 ). '/bin/';
224+
225+
return [
226+
['echo "SELECT 1" | '. $binPath .'highlight-query', 0],
227+
['echo "invalid query" | '. $binPath .'highlight-query', 0],
228+
['echo "SELECT 1" | '. $binPath .'lint-query', 0],
229+
['echo "invalid query" | '. $binPath .'lint-query', 10],
230+
['echo "SELECT 1" | '. $binPath .'tokenize-query', 0],
231+
['echo "invalid query" | '. $binPath .'tokenize-query', 0],
232+
];
233+
}
208234
}

0 commit comments

Comments
0 (0)
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.