-
Notifications
You must be signed in to change notification settings - Fork 168
Expand file tree
/
Copy pathissue368Test.php
More file actions
30 lines (24 loc) · 763 Bytes
/
issue368Test.php
File metadata and controls
30 lines (24 loc) · 763 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<?php
/**
* issue368.php
*
* Test case for PHPSQLCreator.
*/
namespace PHPSQLParser\Test\Creator;
use PHPSQLParser\PHPSQLParser;
use PHPSQLParser\PHPSQLCreator;
class Issue368Test extends \PHPUnit\Framework\TestCase
{
/*
* https://github.com/greenlion/PHP-SQL-Parser/issues/368
* CURRENT_TIMESTAMP is detected as a reserved word an generate errors when used in JOIN clause
*/
public function testIssue368()
{
$sql = "SELECT foo FROM barTable LEFT JOIN bazTable ON barTable.a = bazTable.a AND bazTable.d <= CURRENT_TIMESTAMP"; // KO
$parser = new PHPSQLParser();
$creator = new PHPSQLCreator();
$parser->parse($sql);
$this->assertEquals($sql, $creator->create($parser->parsed));
}
}