liip / liip/LiipFunctionalTestBundle
Refactor the bundle to be more stable and faster
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 648
- Forks
- 179
- PR merge metrics
- No merged PRs in 30d
Description
Hi @alexislefebvre and @lsmith77 , how are you?
Excuse me for my long absence, but I were in the process of closing the first version of my app and I had to concentrate on it.
But now that it is online, I'd like to start again contributing here.
We leave ourselves speaking about the fastness of this bundle (#218).
Then the the discourse was left to itself.
I'm opening this issue to try to make a recap of what we said and to draft a first (small) plan (so I can afford it given the time I have to dedicate to LiipFunctionTestBundle).
So, here are the things I think are priorities to create a better and faster bundle:
- Fix #323: Move library files to
srcand tests files totests; - Ordering methods following this order:
public,protectedandprivate(this will make for developer easier to understand the API (s)he can use; - Split the big
WebTestCase.phpin smaller files:AbstractTestCasefrom which inheritWebTestCaseandCommandTestCase. This will make us able to move to dedicated files methods that are relevant only for one kind of test (for example,getVerbosityLevel()that is relevant only for commands or see also #329 ) - Fix #218: Start using properties (also not
privateto not BC) to store objects created by the bundle: this makes us able to do the next task... - Start using
setUp()andtearDown()methods to unset properties to free up memory during execution and make tests faster - Start using getters and setter, deprecating the usage of direct access to properties (that should be private: extending classes should use getters and setters)
- Improve
fetchContent()andfetchCrawler(): they MUST set (or use the already created - for this reason is useful using getters and setters: we can check if aclientalready exists and avoid creating a new one) the$clientproperty, and not creating each time the client. There are use cases (mostly after a form is submitted) where it is required to reuse the same exact client created to load some subsequent pages: in those cases it is impossible to use the same$clientand the only option is to create it directly in the test method usingmakeClient(), forcing the developer to write more code. - Maybe also using
PHPCSFixeris a good thing...
All this will be a good preparation also for the #6 , making easier the transition process.
This is a first list: what do you think about it?
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading WebTestCase.php and the discussions in #218 and #329, then review the unchecked refactoring items in this issue. The work is only done once a specific scope is agreed and the selected changes—such as splitting test cases, reusing the client, or adding lifecycle cleanup—are completed.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php, symfony
- Domain
- testing
- Issue type
- Refactor
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100