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 — Add component build tests from CASE expressions with aliases · phpmyadmin/sql-parser@61343f6

File tree

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

‎tests/Components/CaseExpressionTest.php‎

Copy file name to clipboardExpand all lines: tests/Components/CaseExpressionTest.php
+28Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,4 +83,32 @@ public function testParseBuild6()
8383
'CASE WHEN 1=1 THEN "Some" WHEN 1=2 THEN "SomeOther" END'
8484
);
8585
}
86+
87+
public function testParseBuild7()
88+
{
89+
$caseExprQuery = 'case when 1=1 then "Some" '
90+
. 'when 1=2 then "SomeOther" end AS foo';
91+
$component = CaseExpression::parse(
92+
new Parser(),
93+
$this->getTokensList($caseExprQuery)
94+
);
95+
$this->assertEquals(
96+
CaseExpression::build($component),
97+
'CASE WHEN 1=1 THEN "Some" WHEN 1=2 THEN "SomeOther" END AS `foo`'
98+
);
99+
}
100+
101+
public function testParseBuild8()
102+
{
103+
$caseExprQuery = 'case when 1=1 then "Some" '
104+
. 'when 1=2 then "SomeOther" end foo';
105+
$component = CaseExpression::parse(
106+
new Parser(),
107+
$this->getTokensList($caseExprQuery)
108+
);
109+
$this->assertEquals(
110+
CaseExpression::build($component),
111+
'CASE WHEN 1=1 THEN "Some" WHEN 1=2 THEN "SomeOther" END AS `foo`'
112+
);
113+
}
86114
}

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.