diff options
author | William Desportes <williamdes@wdes.fr> | 2019-12-31 16:47:13 +0100 |
---|---|---|
committer | William Desportes <williamdes@wdes.fr> | 2019-12-31 16:51:13 +0100 |
commit | 38afaeaa9b29a7a359b61f1212f3812662fd43d7 (patch) | |
tree | 83b37aa990a649516a2417d8f047b0226730b06f | |
parent | 8a9b8fcd3357fbf42756519bcea7ef3ca668aaf5 (diff) | |
download | sql-parser-38afaeaa9b29a7a359b61f1212f3812662fd43d7.zip sql-parser-38afaeaa9b29a7a359b61f1212f3812662fd43d7.tar.gz sql-parser-38afaeaa9b29a7a359b61f1212f3812662fd43d7.tar.bz2 |
Add test case for #249
Signed-off-by: William Desportes <williamdes@wdes.fr>
-rw-r--r-- | tests/Utils/QueryTest.php | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/Utils/QueryTest.php b/tests/Utils/QueryTest.php index 3bc1783..f4676ec 100644 --- a/tests/Utils/QueryTest.php +++ b/tests/Utils/QueryTest.php @@ -598,6 +598,20 @@ class QueryTest extends TestCase ); } + public function testReplaceNonExistingPart() + { + $parser = new Parser('ALTER TABLE `sale_mast` OPTIMIZE PARTITION p3'); + $this->assertEquals( + ' ALTER TABLE `sale_mast` OPTIMIZE PARTITION p3', + Query::replaceClause( + $parser->statements[0], + $parser->list, + 'ORDER BY', + '' + ) + ); + } + public function testReplaceClauses() { $this->assertEquals('', Query::replaceClauses(null, null, array())); |