summaryrefslogtreecommitdiffstats
path: root/tests/Utils/FormatterTest.php
diff options
context:
space:
mode:
authorMichal Čihař <michal@cihar.com>2016-02-19 13:27:23 +0100
committerMichal Čihař <michal@cihar.com>2016-02-19 13:27:23 +0100
commitddd5461a11f9beef3786652c54b3eeda6067402e (patch)
treedefc0d3f7aa1698f67450fb4d703d5471ac3136a /tests/Utils/FormatterTest.php
parent24ea547ebb91f40029241fb9bd1ed6858e3dfa20 (diff)
downloadsql-parser-ddd5461a11f9beef3786652c54b3eeda6067402e.zip
sql-parser-ddd5461a11f9beef3786652c54b3eeda6067402e.tar.gz
sql-parser-ddd5461a11f9beef3786652c54b3eeda6067402e.tar.bz2
Add more formatter tests
Signed-off-by: Michal Čihař <michal@cihar.com>
Diffstat (limited to 'tests/Utils/FormatterTest.php')
-rw-r--r--tests/Utils/FormatterTest.php14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/Utils/FormatterTest.php b/tests/Utils/FormatterTest.php
index 9e82015..80c22bc 100644
--- a/tests/Utils/FormatterTest.php
+++ b/tests/Utils/FormatterTest.php
@@ -27,6 +27,20 @@ class FormatTest extends TestCase
'<span class="sql-reserved">SELECT</span>' . "\n" .
' <span class="sql-number">1</span>'
),
+ array(
+ 'SELECT HEX("1")',
+ '<span class="sql-reserved">SELECT</span>' . "\n" .
+ ' <span class="sql-keyword">HEX</span>(<span class="sql-string">"1"</span>)'
+ ),
+ array(
+ 'SELECT * FROM foo WHERE bar=1',
+ '<span class="sql-reserved">SELECT</span>' . "\n" .
+ ' *' . "\n" .
+ '<span class="sql-reserved">FROM</span>' . "\n" .
+ ' foo' . "\n" .
+ '<span class="sql-reserved">WHERE</span>' . "\n" .
+ ' bar = <span class="sql-number">1</span>'
+ ),
);
}
}