diff options
author | Jeremy Dorn <jeremy@jeremydorn.com> | 2013-03-07 18:26:59 -0800 |
---|---|---|
committer | Jeremy Dorn <jeremy@jeremydorn.com> | 2013-03-07 18:26:59 -0800 |
commit | 2724ddb7fb79851a557d868a688fc269960bff87 (patch) | |
tree | 40e791d5e1d485392ec095f51fdd0ce4acc82814 /tests/SqlFormatterTest.php | |
parent | 17fdbb8bd358d226dc1a9691c2245f041d72e3d3 (diff) | |
download | sql-formatter-2724ddb7fb79851a557d868a688fc269960bff87.zip sql-formatter-2724ddb7fb79851a557d868a688fc269960bff87.tar.gz sql-formatter-2724ddb7fb79851a557d868a688fc269960bff87.tar.bz2 |
Fixed formatting bug with multiple boundary characters (e.g. ">=", "<>", etc.). Fixes #29
Improved code coverage in unit tests. Now everything is covered except the infinite loop catching code which I don't know how to test.
Diffstat (limited to 'tests/SqlFormatterTest.php')
-rw-r--r-- | tests/SqlFormatterTest.php | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/SqlFormatterTest.php b/tests/SqlFormatterTest.php index 5cf65ad..2bd8f7f 100644 --- a/tests/SqlFormatterTest.php +++ b/tests/SqlFormatterTest.php @@ -23,6 +23,18 @@ class SqlFormatterTest extends PHPUnit_Framework_TestCase { $this->assertEquals(trim($html), trim(SqlFormatter::highlight($sql))); } + function testUsePre() { + SqlFormatter::$use_pre = false; + $actual = SqlFormatter::highlight("test"); + $expected = '<span style="color: #333;">test</span>'; + $this->assertEquals($actual,$expected); + + SqlFormatter::$use_pre = true; + $actual = SqlFormatter::highlight("test"); + $expected = '<pre style="color: black; background-color: white;"><span style="color: #333;">test</span></pre>'; + $this->assertEquals($actual,$expected); + } + function testSplitQuery() { $expected = array( "SELECT 'test' FROM MyTable;", |