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

Make filtering of LazyArrays return a new instance #12010

Merged
merged 3 commits into from Jan 4, 2019

Conversation

Projects
None yet
5 participants
@eternoendless
Copy link
Member

eternoendless commented Jan 3, 2019

Questions Answers
Branch? develop
Description? Make filtering of LazyArrays return a new instance of said object. This prevents an unexpected modification of a deeply nested LazyArray.
Type? bug fix
Category? CO
BC breaks? no
Deprecations? no
Fixed ticket? n/a
How to test? No regressions tests in the FO: Search a product, create an order.

This change is Reviewable

@eternoendless eternoendless added this to the 1.7.6.0 milestone Jan 3, 2019

$filteredSubject = $filter->filter($subject);
$this->assertNotSame($subject, $filteredSubject);

This comment has been minimized.

@PierreRambaud

PierreRambaud Jan 3, 2019

Contributor

add assertInstanceOf to make sure even if it is not the same object, it is the same instance :)

This comment has been minimized.

@eternoendless

eternoendless Jan 3, 2019

Author Member

You mean to check that it's still an instance of TestLazyArray? It may be overkill for the purpose of the test, since later I test that it still has the filtered out property.

@marionf marionf added QA ✔️ and removed waiting for QA labels Jan 4, 2019

@Quetzacoalt91 Quetzacoalt91 merged commit b4f6c6a into PrestaShop:develop Jan 4, 2019

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@eternoendless eternoendless deleted the eternoendless:lazyarray-clone branch Jan 4, 2019

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