summaryrefslogtreecommitdiffstats
path: root/tests/parser
diff options
context:
space:
mode:
Diffstat (limited to 'tests/parser')
-rw-r--r--tests/parser/ArrayFragmentTest.php26
-rw-r--r--tests/parser/CallStatementTest.php26
-rw-r--r--tests/parser/CreateStatementTest.php32
-rw-r--r--tests/parser/DeleteStatementTest.php24
-rw-r--r--tests/parser/FragmentTest.php18
-rw-r--r--tests/parser/InsertStatementTest.php24
-rw-r--r--tests/parser/LimitKeywordTest.php25
-rw-r--r--tests/parser/ParserTest.php66
-rw-r--r--tests/parser/RenameStatementTest.php25
-rw-r--r--tests/parser/ReplaceStatementTest.php25
-rw-r--r--tests/parser/RestoreStatementTest.php24
-rw-r--r--tests/parser/SelectStatementTest.php33
-rw-r--r--tests/parser/UpdateStatementTest.php25
13 files changed, 0 insertions, 373 deletions
diff --git a/tests/parser/ArrayFragmentTest.php b/tests/parser/ArrayFragmentTest.php
deleted file mode 100644
index a31bf2a..0000000
--- a/tests/parser/ArrayFragmentTest.php
+++ /dev/null
@@ -1,26 +0,0 @@
-<?php
-
-namespace SqlParser\Tests\Parser;
-
-use SqlParser\Tests\TestCase;
-
-class ArrayFragmentTest extends TestCase
-{
-
- /**
- * @dataProvider testArrayProvider
- */
- public function testArray($test)
- {
- $this->runParserTest($test);
- }
-
- public function testArrayProvider()
- {
- return array(
- array('parseArrayErr1'),
- array('parseArrayErr2'),
- array('parseArrayErr3'),
- );
- }
-}
diff --git a/tests/parser/CallStatementTest.php b/tests/parser/CallStatementTest.php
deleted file mode 100644
index 3eec381..0000000
--- a/tests/parser/CallStatementTest.php
+++ /dev/null
@@ -1,26 +0,0 @@
-<?php
-
-namespace SqlParser\Tests\Parser;
-
-use SqlParser\Tests\TestCase;
-
-class CallStatementTest extends TestCase
-{
-
- /**
- * @dataProvider testCallProvider
- */
- public function testCall($test)
- {
- $this->runParserTest($test);
- }
-
- public function testCallProvider()
- {
- return array(
- array('parseCall'),
- array('parseCall2'),
- array('parseCall3'),
- );
- }
-}
diff --git a/tests/parser/CreateStatementTest.php b/tests/parser/CreateStatementTest.php
deleted file mode 100644
index 8f8c43a..0000000
--- a/tests/parser/CreateStatementTest.php
+++ /dev/null
@@ -1,32 +0,0 @@
-<?php
-
-namespace SqlParser\Tests\Parser;
-
-use SqlParser\Tests\TestCase;
-
-class CreateStatementTest extends TestCase
-{
-
- /**
- * @dataProvider testCreateProvider
- */
- public function testCreate($test)
- {
- $this->runParserTest($test);
- }
-
- public function testCreateProvider()
- {
- return array(
- array('parseCreateTable'),
- array('parseCreateTable2'),
- array('parseCreateTableErr1'),
- array('parseCreateProcedure'),
- array('parseCreateProcedure2'),
- array('parseCreateFunction'),
- array('parseCreateFunctionErr1'),
- array('parseCreateFunctionErr2'),
- array('parseCreateUser'),
- );
- }
-}
diff --git a/tests/parser/DeleteStatementTest.php b/tests/parser/DeleteStatementTest.php
deleted file mode 100644
index d6180e7..0000000
--- a/tests/parser/DeleteStatementTest.php
+++ /dev/null
@@ -1,24 +0,0 @@
-<?php
-
-namespace SqlParser\Tests\Parser;
-
-use SqlParser\Tests\TestCase;
-
-class DeleteStatementTest extends TestCase
-{
-
- /**
- * @dataProvider testDeleteProvider
- */
- public function testDelete($test)
- {
- $this->runParserTest($test);
- }
-
- public function testDeleteProvider()
- {
- return array(
- array('parseDelete'),
- );
- }
-}
diff --git a/tests/parser/FragmentTest.php b/tests/parser/FragmentTest.php
deleted file mode 100644
index d91ccb5..0000000
--- a/tests/parser/FragmentTest.php
+++ /dev/null
@@ -1,18 +0,0 @@
-<?php
-
-namespace SqlParser\Tests\Parser;
-
-use SqlParser\Fragment;
-use SqlParser\Parser;
-use SqlParser\TokensList;
-
-use SqlParser\Tests\TestCase;
-
-class FragmentTest extends TestCase
-{
-
- public function testFragment()
- {
- $this->assertEquals(null, Fragment::parse(new Parser(), new TokensList()));
- }
-}
diff --git a/tests/parser/InsertStatementTest.php b/tests/parser/InsertStatementTest.php
deleted file mode 100644
index d63054c..0000000
--- a/tests/parser/InsertStatementTest.php
+++ /dev/null
@@ -1,24 +0,0 @@
-<?php
-
-namespace SqlParser\Tests\Parser;
-
-use SqlParser\Tests\TestCase;
-
-class InsertStatementTest extends TestCase
-{
-
- /**
- * @dataProvider testInsertProvider
- */
- public function testInsert($test)
- {
- $this->runParserTest($test);
- }
-
- public function testInsertProvider()
- {
- return array(
- array('parseInsert'),
- );
- }
-}
diff --git a/tests/parser/LimitKeywordTest.php b/tests/parser/LimitKeywordTest.php
deleted file mode 100644
index 2e7831d..0000000
--- a/tests/parser/LimitKeywordTest.php
+++ /dev/null
@@ -1,25 +0,0 @@
-<?php
-
-namespace SqlParser\Tests\Parser;
-
-use SqlParser\Tests\TestCase;
-
-class LimitKeywordTest extends TestCase
-{
-
- /**
- * @dataProvider testCallProvider
- */
- public function testCall($test)
- {
- $this->runParserTest($test);
- }
-
- public function testCallProvider()
- {
- return array(
- array('parseLimitErr1'),
- array('parseLimitErr2'),
- );
- }
-}
diff --git a/tests/parser/ParserTest.php b/tests/parser/ParserTest.php
deleted file mode 100644
index 8636edd..0000000
--- a/tests/parser/ParserTest.php
+++ /dev/null
@@ -1,66 +0,0 @@
-<?php
-
-namespace SqlParser\Tests\Parser;
-
-use SqlParser\Exceptions\ParserException;
-use SqlParser\Lexer;
-use SqlParser\Parser;
-use SqlParser\Token;
-use SqlParser\TokensList;
-
-use SqlParser\Tests\TestCase;
-
-class ParserTest extends TestCase
-{
-
- public function testParse()
- {
- $this->runParserTest('parse');
- }
-
- public function testUnrecognizedStatement()
- {
- $parser = new Parser('SELECT 1; FROM');
- $this->assertEquals(
- $parser->errors[0]->getMessage(),
- 'Unrecognized statement type "FROM".'
- );
- }
-
- public function testUnrecognizedKeyword()
- {
- $parser = new Parser('SELECT 1 FROM foo PARTITION(bar, baz) AS');
- $this->assertEquals(
- $parser->errors[0]->getMessage(),
- 'Unrecognized keyword "AS".'
- );
- }
-
- public function testError()
- {
- $parser = new Parser(new TokensList());
-
- $parser->error('error #1', new Token('foo'), 1);
- $parser->error('error #2', new Token('bar'), 2);
-
- $this->assertEquals(
- $parser->errors, array(
- new ParserException('error #1', new Token('foo'), 1),
- new ParserException('error #2', new Token('bar'), 2),
- )
- );
- }
-
- /**
- * @expectedException SqlParser\Exceptions\ParserException
- * @expectedExceptionMessage strict error
- * @expectedExceptionCode 3
- */
- public function testErrorStrict()
- {
- $parser = new Parser(new TokensList());
- $parser->strict = true;
-
- $parser->error('strict error', new Token('foo'), 3);
- }
-}
diff --git a/tests/parser/RenameStatementTest.php b/tests/parser/RenameStatementTest.php
deleted file mode 100644
index 62ed19d..0000000
--- a/tests/parser/RenameStatementTest.php
+++ /dev/null
@@ -1,25 +0,0 @@
-<?php
-
-namespace SqlParser\Tests\Parser;
-
-use SqlParser\Tests\TestCase;
-
-class RenameStatementTest extends TestCase
-{
-
- /**
- * @dataProvider testRenameProvider
- */
- public function testRename($test)
- {
- $this->runParserTest($test);
- }
-
- public function testRenameProvider()
- {
- return array(
- array('parseRename'),
- array('parseRename2'),
- );
- }
-}
diff --git a/tests/parser/ReplaceStatementTest.php b/tests/parser/ReplaceStatementTest.php
deleted file mode 100644
index 8044a8f..0000000
--- a/tests/parser/ReplaceStatementTest.php
+++ /dev/null
@@ -1,25 +0,0 @@
-<?php
-
-namespace SqlParser\Tests\Parser;
-
-use SqlParser\Tests\TestCase;
-
-class ReplaceStatementTest extends TestCase
-{
-
- /**
- * @dataProvider testReplaceProvider
- */
- public function testReplace($test)
- {
- $this->runParserTest($test);
- }
-
- public function testReplaceProvider()
- {
- return array(
- array('parseReplace'),
- array('parseReplace2'),
- );
- }
-}
diff --git a/tests/parser/RestoreStatementTest.php b/tests/parser/RestoreStatementTest.php
deleted file mode 100644
index 28db6fe..0000000
--- a/tests/parser/RestoreStatementTest.php
+++ /dev/null
@@ -1,24 +0,0 @@
-<?php
-
-namespace SqlParser\Tests\Parser;
-
-use SqlParser\Tests\TestCase;
-
-class RestoreStatementTest extends TestCase
-{
-
- /**
- * @dataProvider testRestoreProvider
- */
- public function testRestore($test)
- {
- $this->runParserTest($test);
- }
-
- public function testRestoreProvider()
- {
- return array(
- array('parseRestore'),
- );
- }
-}
diff --git a/tests/parser/SelectStatementTest.php b/tests/parser/SelectStatementTest.php
deleted file mode 100644
index 943ceb7..0000000
--- a/tests/parser/SelectStatementTest.php
+++ /dev/null
@@ -1,33 +0,0 @@
-<?php
-
-namespace SqlParser\Tests\Parser;
-
-use SqlParser\Tests\TestCase;
-
-class SelectStatementTest extends TestCase
-{
-
- public function testSelectOptions()
- {
- $parser = $this->runParserTest('parseSelect');
- $stmt = $parser->statements[0];
- $this->assertEquals(10, $stmt->options->has('MAX_STATEMENT_TIME'));
- }
-
- /**
- * @dataProvider testSelectProvider
- */
- public function testSelect($test)
- {
- $this->runParserTest($test);
- }
-
- public function testSelectProvider()
- {
- return array(
- array('parseSelect2'),
- array('parseSelectErr1'),
- array('parseSelectNested'),
- );
- }
-}
diff --git a/tests/parser/UpdateStatementTest.php b/tests/parser/UpdateStatementTest.php
deleted file mode 100644
index 0bb4df0..0000000
--- a/tests/parser/UpdateStatementTest.php
+++ /dev/null
@@ -1,25 +0,0 @@
-<?php
-
-namespace SqlParser\Tests\Parser;
-
-use SqlParser\Tests\TestCase;
-
-class UpdateStatementTest extends TestCase
-{
-
- /**
- * @dataProvider testUpdateProvider
- */
- public function testUpdate($test)
- {
- $this->runParserTest($test);
- }
-
- public function testUpdateProvider()
- {
- return array(
- array('parseUpdate'),
- array('parseUpdate2'),
- );
- }
-}