-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Remove prophecy usage #6421
Remove prophecy usage #6421
Conversation
return ( | ||
method_exists($fieldDescription, 'getTargetModel') && $class === $fieldDescription->getTargetModel() | ||
) || $class === $fieldDescription->getTargetEntity(); | ||
return method_exists($fieldDescription, 'getTargetModel') ? |
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.
I found this while changing all the tests, this can be done on a separate PR if you want.
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.
This PR could take some times before being merged. So maybe it's indeed a good idea to create a separate PR
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.
Let's see how this goes, if we see a lot of review process I will revert it from this PR and open a new one. If not, I will change it to patch and add a changelog
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.
Yes, but at least a separate commit seems needed.
I spent a lot of time trying to fix the
@greg0ire maybe you can help me? I need to see what I broke with the change from prophecy to phpunit mocks. |
I leave it as a draft, but the only thing missing before reviews is fixing that one test. The rest should be okay. |
Not sure what you broke, but when I wrote this test, I wasn't yet aware that mocking what you don't own is bad it seems. I pushed a new commit that greatly simplifies this test by relying on real classes instead of stubs. |
My commit removed many expectations though, I will force push equivalent assertions soon. |
I pushed two more commits to fix builds and the var thing |
1dada05
to
c1cd54b
Compare
I just force pushed (with lease) |
Aaaand the php8 is green again! Thank you @greg0ire . Please review, @sonata-project/contributors |
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.
Maybe some clean up is necessary in the commits ?
For instance the fix of src/Form/DataTransformerResolver.php
should be in a separate commit.
This will allow us to use `assertMatchesRegularExpression` on the lowest dependencies build
The previous check will call it anyway since the second part of the comparison can return false, and that would lead to calling deprecated code.
c1cd54b
to
7e578d1
Compare
I squashed some commits, separate the code changed on |
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.
I would replace:
- $this->container = $this->createStub(ContainerInterface::class);
+ $this->container = new Container();
But we could do that in another PR.
Edit: Another PR is fine 🤣
Oh sorry @franmomu I merged right when you published your review 😅 |
No worries, that can be change with the Container mock in another one. |
@jordisala1991 Big thanks for this PR. |
Yes, I will do it. I expect big conflict fight |
Can you make another PR to fix those things? I wont have time today to do it Edit: wait, I have time to fix them now |
Subject
I am targeting this branch, because this is a changes on tests plus a patch on src
Changelog
This will allow us to have the php 8 build running without errors. Also it will allow to remove prophecy usage and to upgrade all builds to use phpunit 9 (Except php 7.2)
This is the first step, there are other changes needed on dev-kit and on other repositories