-
Notifications
You must be signed in to change notification settings - Fork 11
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
WIP : PHP8 #381
WIP : PHP8 #381
Conversation
* Update composer dependencies * Update phpcs config * Remove unused ignored error * Fix deprecation notice Depth parameter shouldn't be set to 0. * Fix the tests failures because of inability to check the list of items vs source items * Remove extra space from init blocks command * Update readme * Fix phpcs violation * Fix deprecations with using traits directly Added anonymous classes instead. * Add mocks for the failing tests * Fix test deprecations * Update the gh action workflow * Workflow fix * Workflow update 8.3 allow failure for non-released version of PHP. * Minor formatting fix on helpers * Replace assertions with expectations API Should prevent failures on PHPUnit <9 where assertObjectHasProperty isn't defined. * Prevent the dynamic properties deprecation notices in tests This will still be an issue on composer installs with lowest dependencies where dynamic properties isn't allowed/fixed in mockery. * Minor grammar typo fix in a test * Update workflow to allow failures on lowest composer dependencies * Update moveItem method * Improve type description in moveItem method * Improve the moveItems method In real life cases, the sourceItem array will contain list of items in the folder, and the folder as a value, so we need to check that as well. This should probably come up in tests, unless the dataset is not correctly set to mimick how the real life projects are behaving. This needs investigation.
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.
Left some minor comments.
The thing I'm more worried about is the change in the component rendering.
Several tests are failing (some of which are easy to fix), but for some, I'm not sure the behavior is correct, or at least this new feature has kinda complicated testing.
Because inside the tests you don't have WordPress, the test for the feature could be actually correct, but this new exception would make it seem like it's not correct.
For instance, the following test:
test('Asserts that rendering a component works', function () {
$results = Components::render('button', []);
expect($results)
->not->toBeEmpty()
->toContain('Hello!');
});
This should be correct (confirming that rendering actually works), but this will now throw an exception: You are not allowed to access paths outside of themes or plugins folder!
So I think that either this should be fixed in test setup, to somehow 'trick' the code to think that during tests we are inside WordPress theme/plugin, or at the code level with a flag 🤷🏼♂️
Co-authored-by: Denis Žoljom <[email protected]>
I have fixed all the tests |
Codecov Report
@@ Coverage Diff @@
## develop #381 +/- ##
=============================================
- Coverage 84.41% 81.60% -2.82%
- Complexity 1273 1357 +84
=============================================
Files 135 138 +3
Lines 6088 6359 +271
=============================================
+ Hits 5139 5189 +50
- Misses 949 1170 +221
Flags with carried forward coverage won't be shown. Click here to find out more.
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
I can't any errors in the tests, linters or stan. Also There are no issues in the debug log. Npx is working as expected :D I thing this setup is ready for PHP8.2. WooCommerce is also working :D |
Co-authored-by: Ivan Ramljak <[email protected]>
Description
is<>Used
method that is by default true.Note
To install and test the latest version, use this command:
Connected PRs
infinum/eightshift-boilerplate#273
infinum/eightshift-frontend-libs#761
#381