Skip to content

Conversation

@stof
Copy link
Member

@stof stof commented Jun 13, 2023

This extracts the complex logic out of Element::findAll. The logic is better encapsulated and this keeps the collaborators of the element to a sane number.
This makes testing of Element classes a lot easier as we don't need to configure mocks in a way covering the named special selector (as this happens inside the ElementFinder now).
The testsuite is also more reliable by using the proper types for return values (instead of using strings in places expecting to return an array of NodeElement) and using willReturnValueMap instead of relying on the order of invocations (which is deprecated in phpunit)

In Mink 2.0, when the driver find method will return an array of Xpath strings instead of NodeElement (so that it does not need to depend on the Session or on other higher-level parts of the API), the ElementFinder will be the place where the instantiation takes place.

refs #542 and #415

This extracts the complex logic out of Element::findAll. The logic is
better encapsulated and this keeps the collaborators of the element to a
sane number.
@stof stof merged commit 4070be1 into minkphp:master Jun 13, 2023
@stof stof deleted the element_finder branch June 13, 2023 12:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant