Quote backslashes

(At least in MySQL and PostgreSQL) It is possible to do a SQL injection by passing `\'` in a string. It gets quoted as `\''`, but backslash escapes first quote and second one ends a string in SQL.

I tried to write test for that running `SELECT {$quoted_string}` query on database, but it returns empty array, even though it works fine, when I run the same code outside Doctrine unit tests, in my application. Help with that would be appreciated.