Skip to content
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

Conversation

SenseException
Copy link
Member

Q A
Type improvement
BC Break no
Fixed issues

Summary

This PR is an addendum after #3997 gets merged. It contains tests for covering caching using parameters and types.

@SenseException
Copy link
Member Author

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
Copy link
Member

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.

Copy link
Member Author

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]];
Copy link
Member

@morozov morozov Jun 15, 2020

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?

Copy link
Member Author

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.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does PDO string work?

Copy link
Member

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.

Copy link
Member Author

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.

@SenseException SenseException changed the base branch from 2.10.x to 2.11.x June 29, 2020 21:14
@SenseException SenseException force-pushed the extend-resultcache-tests branch 3 times, most recently from abde411 to e058f17 Compare June 29, 2020 21:48
@morozov morozov changed the base branch from 2.11.x to 2.12.x November 29, 2020 21:37
@morozov morozov closed this Apr 21, 2021
@morozov morozov deleted the branch doctrine:2.12.x April 21, 2021 16:26
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 22, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants