-
-
Notifications
You must be signed in to change notification settings - Fork 20
Fixed case where operators containing question mark were erroneously substituted by the parameter parser #40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…substituted by the parameter parser.
'Bare' => ['SELECT ?', 'SELECT $1'], | ||
'Parenthesized' => ['SELECT (?)', 'SELECT ($1)'], | ||
'Row constructor' => ['SELECT (?, ?)', 'SELECT ($1, $2)'], | ||
]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hint: Yield could be used here, but I think there's no need yet for readability.
*/ | ||
public function testParseJsonbOperator(): void | ||
public function testParseProblematicOperators(string $sql): void |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the test cases can be merged into one test method, as the problematic ones shouldn't be problematic after the fix.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For what benefit? Two distinct sets is clearer.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Better overview, after all it's one test-set that needs to work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I cannot see the benefit of combining test cases that perform substitutions with test cases that do not. They are complete opposites. As such it would be unconscionable for me to make such a change, but obviously you can still make whatever changes you want after merging since it is your project.
@Bilge I get several tests failing due to the regex not providing the matches expected. |
Restored capturing groups in parameter parser regex.
Fixes #39.