Skip to content

Sensitive to case and doesn't ignore irrelevant backticks #1

Description

@skaramicke

These two SQL statements are equal, as far as tokenization can be expected to work.

Lowercase without backticks:

select 1 + 1 as two

Uppercase with backticks:

SELECT 1 + 1 as `two`

Sample output from phpunit run:

Summary of non-successful tests:

Database Migrator
 ✘ Executes migration to version 1 when version is 0
   ┐
   ├ Failed asserting that two SQL query sequences are equal (whitespace ignored).
   ├ Failed asserting that two arrays are equal.                                  
   ┊ ---·Expected
   ┊ +++·Actual
   ┊ @@ @@
   ┊  Array &0 (
   ┊ -····0·=>·'select·1·+·1·as·two'
   ┊ +····0·=>·'SELECT·1·+·1·as·`two`'
   ┊  )
   │
   ╵ /project/vendor/czukowski/phpunit-sql/classes/EqualsSQLQueriesConstraint.php:65
   ╵ /project/vendor/czukowski/phpunit-sql/classes/AssertTrait.php:51
   ╵ /project/tests/TestDatabaseMigrations.php:10
   ┴

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions