summaryrefslogtreecommitdiffstats
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
...
* | Add tests for ALTER DATABASE and ALTER VIEWDeven Bansod2016-10-255-0/+6
|/ | | | Signed-off-by: Deven Bansod <devenbansod.bits@gmail.com>
* Fix parsing of variables being assigned value of CASE expr within SELECT ↵Deven Bansod2016-10-143-0/+7
| | | | | | | | | | statements For example, $query = "SELECT 1+ 2 AS `c2`, sum(c2), sum(c3) AS `sum_c3`, 'Status'= CASE WHEN quantity > 0 THEN 'in stock' ELSE 'out of stock' END FROM test_table" Signed-off-by: Deven Bansod <devenbansod.bits@gmail.com>
* Add builder's test for #92Deven Bansod2016-10-101-0/+11
| | | | Signed-off-by: Deven Bansod <devenbansod.bits@gmail.com>
* Fix parsing of ON UPDATE option in TIMESTAMP field with precisionDeven Bansod2016-10-103-0/+19
| | | | | | Fix #92 Signed-off-by: Deven Bansod <devenbansod.bits@gmail.com>
* Merge pull request #90 from devenbansod/subquery_in_fromMichal Čihař2016-10-0312-5/+53
|\ | | | | Fix parsing of subquery in FROM clause
| * Fix parsing and building of SELECT ... INTO @var1 [,@var2...]Deven Bansod2016-09-281-0/+6
| | | | | | | | Signed-off-by: Deven Bansod <devenbansod.bits@gmail.com>
| * Fix some errors with INTO keyword more to followDeven Bansod2016-09-282-5/+9
| | | | | | | | | | | | Add more test cases Signed-off-by: Deven Bansod <devenbansod.bits@gmail.com>
| * Fix parsing of subquery in FROM clauseDeven Bansod2016-09-279-0/+38
| | | | | | | | | | | | Fix #52 Signed-off-by: Deven Bansod <devenbansod.bits@gmail.com>
* | Merge pull request #87 from devenbansod/delete_statementMichal Čihař2016-10-0350-13/+177
|\ \ | | | | | | Implement parsing and building for Delete Statement
| * | Fixed some errors and add new testsDeven Bansod2016-09-2731-11/+66
| | | | | | | | | | | | Signed-off-by: Deven Bansod <devenbansod.bits@gmail.com>
| * | Added test cases for Building DELETE StatementsDeven Bansod2016-09-241-0/+82
| | | | | | | | | | | | Signed-off-by: Deven Bansod <devenbansod.bits@gmail.com>
| * | Added test cases for parsing DELETE statementsDeven Bansod2016-09-2421-2/+29
| | | | | | | | | | | | Signed-off-by: Deven Bansod <devenbansod.bits@gmail.com>
* | | Merge pull request #88 from devenbansod/fix_pma_12100Michal Čihař2016-10-0320-0/+147
|\ \ \ | |_|/ |/| | Add parsing of CASE Expressions
| * | Add more testsDeven Bansod2016-09-2612-9/+82
| | | | | | | | | | | | Signed-off-by: Deven Bansod <devenbansod.bits@gmail.com>
| * | Fix some issue with error reports and added testcasesDeven Bansod2016-09-2614-0/+74
| |/ | | | | | | Signed-off-by: Deven Bansod <devenbansod.bits@gmail.com>
* | Clarify licenseMichal Čihař2016-09-261-1/+1
| | | | | | | | | | | | | | | | | | - Add link to official license text - Use SPDX identifier for license - Clarify that the code is GPL or later - See issue #89 Signed-off-by: Michal Čihař <michal@cihar.com>
* | Remove @author from comment metadataMichal Čihař2016-09-261-1/+0
| | | | | | | | | | | | | | | | - We're doing this for ages in phpmyadmin repo - The comments get outdated over time - See issue #89 Signed-off-by: Michal Čihař <michal@cihar.com>
* | Add tests for #83 and #84Michal Čihař2016-09-201-0/+10
| | | | | | | | Signed-off-by: Michal Čihař <michal@cihar.com>
* | Fix parsing of user@host without backquotesDeven Bansod2016-09-2013-8/+38
|/ | | | | | | | | | Introduce an option to parse 'expr=' (like var, var=, expr) Fix tests Fix phpmyadmin/phpmyadmin#12298 Signed-off-by: Deven Bansod <devenbansod.bits@gmail.com>
* fix default options in Formater constructorRemi Collet2016-09-132-35/+35
|
* Test error handling in INSERT and REPLACE statementsMichal Čihař2016-09-1314-0/+52
| | | | Signed-off-by: Michal Čihař <michal@cihar.com>
* Add alias extraction test for query with no tableMichal Čihař2016-09-131-0/+5
| | | | Signed-off-by: Michal Čihař <michal@cihar.com>
* Test for invalid output formatMichal Čihař2016-09-131-0/+5
| | | | Signed-off-by: Michal Čihař <michal@cihar.com>
* Test handling of long optionsMichal Čihař2016-09-131-0/+10
| | | | Signed-off-by: Michal Čihař <michal@cihar.com>
* Correctly handle getopt failuresMichal Čihař2016-09-131-0/+10
| | | | Signed-off-by: Michal Čihař <michal@cihar.com>
* Add tests for CLI interfaceMichal Čihař2016-09-131-0/+92
| | | | Signed-off-by: Michal Čihař <michal@cihar.com>
* Add test for formatting with indentationMichal Čihař2016-09-131-0/+17
| | | | Signed-off-by: Michal Čihař <michal@cihar.com>
* Add test for comments removalMichal Čihař2016-09-131-0/+6
| | | | Signed-off-by: Michal Čihař <michal@cihar.com>
* Allow to specify all options in testsMichal Čihař2016-09-131-12/+12
| | | | Signed-off-by: Michal Čihař <michal@cihar.com>
* Add test for comment highlightingMichal Čihař2016-09-131-0/+7
| | | | Signed-off-by: Michal Čihař <michal@cihar.com>
* Test escaping without quotesMichal Čihař2016-09-131-0/+3
| | | | Signed-off-by: Michal Čihař <michal@cihar.com>
* Test console highligting of more complex queriesMichal Čihař2016-09-131-0/+5
| | | | Signed-off-by: Michal Čihař <michal@cihar.com>
* Do not use \e as it's not supported on PHP 5.3Michal Čihař2016-09-131-1/+1
| | | | Signed-off-by: Michal Čihař <michal@cihar.com>
* Merge pull request #77 from devenbansod/fix_48Michal Čihař2016-09-1310-0/+67
|\ | | | | Fix parsing of REPLACE INTO ... Statements
| * Fixed tests and rebase over latest masterDeven Bansod2016-09-131-3/+3
| | | | | | | | Signed-off-by: Deven Bansod <devenbansod.bits@gmail.com>
| * Add tests for build and errorDeven Bansod2016-09-134-0/+58
| | | | | | | | Signed-off-by: Deven Bansod <devenbansod.bits@gmail.com>
| * Fix parsing of REPLACE INTO ... StatementsDeven Bansod2016-09-137-0/+9
| | | | | | | | | | | | | | | | Now supports all three variations with REPLACE INTO .. VALUES, REPLACE INTO .. SET, REPLACE INTO .. SELECT. Fix #48 Signed-off-by: Deven Bansod <devenbansod.bits@gmail.com>
* | Stop SelectStatement parsing and revert back in case of ON DUPLICATE KEYDeven Bansod2016-09-134-0/+14
|/ | | | | | | | Fix parsing of INSERT INTO ... SELECT .... ON DUPLICATE KEY Fix #78 Signed-off-by: Deven Bansod <devenbansod.bits@gmail.com>
* Add test for building INSERT ... SELECT ...v3.4.5Michal Čihař2016-09-131-0/+11
| | | | | | Issue #76 Signed-off-by: Michal Čihař <michal@cihar.com>
* Add test for building INSERT ... SET.Michal Čihař2016-09-131-2/+3
| | | | | | Issue #76 Signed-off-by: Michal Čihař <michal@cihar.com>
* Add test for non-reserved keyword as column nameMichal Čihař2016-09-133-0/+6
| | | | | | Issue #59 Signed-off-by: Michal Čihař <michal@cihar.com>
* Merge remote-tracking branch 'origin/pull/70'Michal Čihař2016-09-137-4/+32
|\
| * Add test case for no column name specifiedDeven Bansod2016-09-101-1/+10
| | | | | | | | Signed-off-by: Deven Bansod <devenbansod.bits@gmail.com>
| * Fix test failures, add test case assertionsDeven Bansod2016-09-102-4/+17
| | | | | | | | Signed-off-by: Deven Bansod <devenbansod.bits@gmail.com>
| * Fix #59: Non-reserved keywords should be allowed as a field nameDeven Bansod2016-09-075-0/+6
| | | | | | | | | | | | | | | | | | While trying to parse a fieldname, disallow only if it is a reserved keywords. Reserved keywords are still allowed if backquotes are used. Added testcases to cover both with and w/o backquotes scenarios. Signed-off-by: Deven Bansod <devenbansod.bits@gmail.com>
* | Merge pull request #76 from devenbansod/fix_50Michal Čihař2016-09-1311-0/+22
|\ \ | | | | | | Fix parsing of INSERT...SELECT and INSERT...SET syntax
| * | Fix parsing of INSERT...SELECT and INSERT...SET syntaxDeven Bansod2016-09-1211-0/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Implement separate parse function for InsertStatement Fix #50 Fix #73 Fix phpmyadmin/phpmyadmin#11628 Signed-off-by: Deven Bansod <devenbansod.bits@gmail.com>
* | | Merge pull request #75 from devenbansod/fix_51_74Michal Čihař2016-09-1316-0/+91
|\ \ \ | | | | | | | | Add correct parsing of SET CHARACTER SET, CHARSET , NAMES statements
| * | | Add testcase for Building of SET statementDeven Bansod2016-09-101-0/+47
| | | | | | | | | | | | | | | | Signed-off-by: Deven Bansod <devenbansod.bits@gmail.com>
| * | | Add testcases for SET CHARACTER SET, CHARSET, NAMES and errorsDeven Bansod2016-09-1015-0/+44
| |/ / | | | | | | | | | Signed-off-by: Deven Bansod <devenbansod.bits@gmail.com>
* | | Fix #55 : Add support for spatial datatypesDeven Bansod2016-09-083-0/+3
|/ / | | | | | | Signed-off-by: Deven Bansod <devenbansod.bits@gmail.com>
* | Fix unnecesary and incorrect assigning of table nameDeven Bansod2016-09-071-1/+1
|/ | | | Signed-off-by: Deven Bansod <devenbansod.bits@gmail.com>
* Merge pull request #68 from devenbansod/fix_49Michal Čihař2016-09-076-0/+14
|\ | | | | Fix #49: Add Support for 'CREATE TABLE `table_copy` LIKE `table`;'
| * Added test case for missing LIKE expr and building of queryDeven Bansod2016-09-074-0/+11
| | | | | | | | Signed-off-by: Deven Bansod <devenbansod.bits@gmail.com>
| * Added a testcase for CREATE TABLE .. LIKE 'old_table'Deven Bansod2016-09-073-0/+3
| | | | | | | | Signed-off-by: Deven Bansod <devenbansod.bits@gmail.com>
* | Merge remote-tracking branch 'origin/pull/67'Michal Čihař2016-09-073-0/+3
|\ \
| * | Added a test for 'ALTER TABLE .. COMMENT abc'Deven Bansod2016-09-073-0/+3
| |/ | | | | | | Signed-off-by: Deven Bansod <devenbansod.bits@gmail.com>
* | Merge pull request #69 from devenbansod/fix_pma_12545Michal Čihař2016-09-071-3/+22
|\ \ | | | | | | Fix spaces after expression in PartitionDefinition's build
| * | Added a new assertion to Create stmt's Builder testDeven Bansod2016-09-071-0/+19
| | | | | | | | | | | | Signed-off-by: Deven Bansod <devenbansod.bits@gmail.com>
| * | Fix spaces after expression in PartitionDefinition's buildDeven Bansod2016-09-071-3/+3
| |/ | | | | | | | | | | Fixes phpmyadmin/phpmyadmin#12545 Signed-off-by: Deven Bansod <devenbansod.bits@gmail.com>
* | Add a new test case for statements with missing delimiterDeven Bansod2016-09-074-1/+12
| | | | | | | | Signed-off-by: Deven Bansod <devenbansod.bits@gmail.com>
* | Fix test failureDeven Bansod2016-09-071-1/+1
|/ | | | Signed-off-by: Deven Bansod <devenbansod.bits@gmail.com>
* Allow to use function name in ASv3.4.4Michal Čihař2016-04-262-1/+24
| | | | | | Fixes https://github.com/phpmyadmin/phpmyadmin/issues/12144 Signed-off-by: Michal Čihař <michal@cihar.com>
* Fix parsing of query with \v3.4.3Michal Čihař2016-04-191-0/+22
| | | | | | | | The previous fix was wrong, it didn't properly handle double escaping. Fixes https://github.com/phpmyadmin/phpmyadmin/issues/12197 Signed-off-by: Michal Čihař <michal@cihar.com>
* Improve formatting of non indented groupsv3.4.2Michal Čihař2016-04-071-0/+13
| | | | | | | | We don't want to insert newlines insite non indented groups. Fixes #20 Signed-off-by: Michal Čihař <michal@cihar.com>
* Fix order of parameters to avoid confusing error messagesMichal Čihař2016-04-061-2/+2
| | | | Signed-off-by: Michal Čihař <michal@cihar.com>
* Add testcase for alias in JOINMichal Čihař2016-03-211-0/+19
| | | | | | See https://github.com/phpmyadmin/phpmyadmin/issues/11604 Signed-off-by: Michal Čihař <michal@cihar.com>
* Move test to better placeMichal Čihař2016-03-212-11/+11
| | | | Signed-off-by: Michal Čihař <michal@cihar.com>
* Properly parse CREATE TABLE [AS] SELECTMichal Čihař2016-03-196-0/+23
| | | | | | Fixes https://github.com/phpmyadmin/phpmyadmin/issues/12109 Signed-off-by: Michal Čihař <michal@cihar.com>
* Add test for union with bracketsMichal Čihař2016-03-182-0/+5
| | | | | | See https://github.com/phpmyadmin/phpmyadmin/issues/12026 Signed-off-by: Michal Čihař <michal@cihar.com>
* Reset console formatting at the end of queryMichal Čihař2016-03-181-1/+1
| | | | Signed-off-by: Michal Čihař <michal@cihar.com>
* Add testcaseMichal Čihař2016-03-071-0/+17
| | | | | | See https://github.com/phpmyadmin/phpmyadmin/issues/12065 Signed-off-by: Michal Čihař <michal@cihar.com>
* Fixed parsing of table with DEFAULT and COMMENT.Michal Čihař2016-03-021-0/+19
| | | | | | Fixes #39 Signed-off-by: Michal Čihař <michal@cihar.com>
* Fix splitting query when escaped quotes are involvedMichal Čihař2016-03-021-0/+13
| | | | | | Fixes https://github.com/phpmyadmin/phpmyadmin/issues/12054 Signed-off-by: Michal Čihař <michal@cihar.com>
* Misc: Fixed coding style issues.Dan Ungureanu2016-02-211-0/+0
| | | | Signed-off-by: Dan Ungureanu <udan1107@gmail.com>
* JoinKeyword: Added tests.Dan Ungureanu2016-02-211-0/+10
| | | | Signed-off-by: Dan Ungureanu <udan1107@gmail.com>
* Expression: Improved error messages related to aliases.Dan Ungureanu2016-02-211-2/+2
| | | | Signed-off-by: Dan Ungureanu <udan1107@gmail.com>
* Misc: Fix failing tests.Dan Ungureanu2016-02-214-11/+6
| | | | Signed-off-by: Dan Ungureanu <udan1107@gmail.com>
* Test formatting for INSERTMichal Čihař2016-02-191-0/+10
| | | | Signed-off-by: Michal Čihař <michal@cihar.com>
* Test cli formatting as wellMichal Čihař2016-02-191-0/+5
| | | | Signed-off-by: Michal Čihař <michal@cihar.com>
* Allow to specify output type to format testMichal Čihař2016-02-191-7/+12
| | | | Signed-off-by: Michal Čihař <michal@cihar.com>
* Add formatter test for procedureMichal Čihař2016-02-191-0/+11
| | | | Signed-off-by: Michal Čihař <michal@cihar.com>
* Test formatting of comments in SQLMichal Čihař2016-02-191-0/+6
| | | | Signed-off-by: Michal Čihař <michal@cihar.com>
* Add more formatter testsMichal Čihař2016-02-191-0/+14
| | | | Signed-off-by: Michal Čihař <michal@cihar.com>
* Add very basic test for FormatterMichal Čihař2016-02-191-0/+32
| | | | | | There was none so far. Signed-off-by: Michal Čihař <michal@cihar.com>
* Do not fail on function which is reserved in a WHERE conditionMichal Čihař2016-02-173-0/+14
| | | | | | Fixes https://github.com/phpmyadmin/phpmyadmin/issues/11975 Signed-off-by: Michal Čihař <michal@cihar.com>
* Change return value from getAll in case of not parsed queryMichal Čihař2016-02-171-1/+32
| | | | | | Fixes https://github.com/phpmyadmin/phpmyadmin/issues/11609 Signed-off-by: Michal Čihař <michal@cihar.com>
* Expression: Refactored parsing options.v3.3.0Dan Ungureanu2016-02-123-4/+4
|
* Misc: Add test cases for fixed bugs.v3.1.0Dan Ungureanu2016-02-1011-0/+39
|
* Misc: Fixed tests failing tests.Dan Ungureanu2016-02-103-3/+4
|
* ArrayObj: Handle more complex expressions in arrays.Dan Ungureanu2016-02-023-3/+0
|
* Misc: Fixed tests.Dan Ungureanu2016-01-134-4/+4
|
* Updated PHPUnit to 5.1 and fixed some of the tests.Dan Ungureanu2015-12-181-0/+10
|
* Improved test coverage.Dan Ungureanu2015-11-087-4/+42
|
* Avoid building a field multiple times if clause has synonyms.v3.0.3Dan Ungureanu2015-10-101-0/+26
|
* Handle backslashes separately for BufferedQuery.v3.0.1Dan Ungureanu2015-10-061-0/+14
|
* Support for references from different tables.v3.0.0Dan Ungureanu2015-10-033-3/+8
|
* Added utilities for handling tokens and tokens list.v2.1.0Dan Ungureanu2015-09-301-0/+106
|
* Updated coding style to follow PSR-2 coding standards.Dan Ungureanu2015-09-254-4/+10
|
* Better parsing for CREATE TABLE statements.v2.0.0Dan Ungureanu2015-09-256-3/+61
| | | | Fixes #16.