-
-
Notifications
You must be signed in to change notification settings - Fork 102
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Avoid building a field multiple times if clause has synonyms.
- Loading branch information
Dan Ungureanu
committed
Oct 10, 2015
1 parent
cd62cf6
commit 42c34dd
Showing
2 changed files
with
49 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<?php | ||
|
||
namespace SqlParser\Tests\Builder; | ||
|
||
use SqlParser\Parser; | ||
|
||
use SqlParser\Tests\TestCase; | ||
|
||
class SelectStatementTest extends TestCase | ||
{ | ||
|
||
public function testBuilder() | ||
{ | ||
$query = 'SELECT * FROM t1 LEFT JOIN (t2, t3, t4) ' | ||
. 'ON (t2.a=t1.a AND t3.b=t1.b AND t4.c=t1.c)'; | ||
|
||
$parser = new Parser($query); | ||
$stmt = $parser->statements[0]; | ||
|
||
$this->assertEquals( | ||
'SELECT * FROM t1 LEFT JOIN (t2, t3, t4) ' | ||
. 'ON (t2.a=t1.a AND t3.b=t1.b AND t4.c=t1.c) ', | ||
$stmt->build() | ||
); | ||
} | ||
} |