-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Add tests for parameters and types case to ResultCacheTest #4014
Add tests for parameters and types case to ResultCacheTest #4014
Conversation
TODO: I'll switch to 2.11 as base branch and rebase to get the changes of #4048. |
* | ||
* @dataProvider provideParamsAndTypes | ||
*/ | ||
public function testCacheFetchWithParamsAndTypes(array $params, array $types) : 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.
Does this require functional testing? The caching layer doesn't interact with any driver- or platform-specific APIs.
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.
Not necessarily. I've added them to already existing functional test about executed queries and cache that didn't cover the used parameters yet.
public static function provideParamsAndTypes() : iterable | ||
{ | ||
yield [['number' => 300], []]; | ||
yield [['number' => 300], ['number' => PDO::PARAM_INT]]; |
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.
This test may fail on 3.0.x
due to the usage of PDO::PARAM_INT
. Does it have to be a deprecated type?
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.
No, any type will do here because it is just used to test if it will be used for caching. I'll change it.
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.
Does PDO string 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.
Does it have to be PDO? ParameterType::STRING
is the recommended analog.
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.
ParameterType::STRING
is now in use.
abde411
to
e058f17
Compare
e058f17
to
aa32cfc
Compare
Summary
This PR is an addendum after #3997 gets merged. It contains tests for covering caching using parameters and types.