Skip to content
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

Rewrite Mockery calls to Prophecy #2217

Open
mvriel opened this issue Jan 25, 2020 · 5 comments
Open

Rewrite Mockery calls to Prophecy #2217

mvriel opened this issue Jan 25, 2020 · 5 comments

Comments

@mvriel
Copy link
Member

mvriel commented Jan 25, 2020

Many phpDocumentor tests use Mockery as a mocking/stubbing library but with the advent of prophecy, we are now working to adopt that as our library or method of choice.

To reduce the number of dependencies that we have and simplify our tests, we need all mockery uses to be rewritten to use prophecy.

Any help here is much appreciated. Please issue a PR per test as that will help in reviewing and merging.

@simivar
Copy link
Contributor

simivar commented Oct 3, 2020

@mvriel As prophecy integration in PHPUnit is deprecated from version 9 and will be removed in version 10, do you still want to migrate to Prophecy or would it make sense to migrate to PHPUnit's built-in mocking library?

See sebastianbergmann/phpunit#4141

@jaapio
Copy link
Member

jaapio commented Oct 3, 2020

However prophecy is removed from the phpunit core I think it is still superior to the phpunit mocks. I tried recently to improve the phpunit mocks and I was a bit disappointed about the internals. There are much edge cases which are not nicely covered.

So yes I do still prefer to migrate to prophecy.

@simivar
Copy link
Contributor

simivar commented Oct 3, 2020

To reduce the number of dependencies that we have and simplify our tests

As I see in the issue description the point of this task was as well to simplify dependencies of phpDocumentator. If we got with prophecy we will just change dependency from Mockery to Prophecy. Isn't that right?

@jaapio
Copy link
Member

jaapio commented Oct 3, 2020

Since phpdocumentor libraries are used by phpunit, mockery and prophecy it is always a pain to install more dependencies via composer.

We will need to find a way to install prophecy via phar like we do with phpunit right now. Removing mockery is a step forward. Phars can be scoped which prevents issues.

@simivar
Copy link
Contributor

simivar commented Oct 4, 2020

I've opened two more PRs and if those get merged what will be left to do is:

  • Migrate phpDocumentor\Descriptor from Mockery to Prophecy (11 classes)
  • Migrate phpDocumentor\Descriptor\Builder\Reflector from Mockery to Prophecy (7 classes)
  • Migrate phpDocumentor\Descriptor\Builder\Reflector\Tags to Prophecy (9 classes)
  • Migrate phpDocumentor\Descriptor\Filter to Prophecy (4 classes)
  • Migrate/refactor phpDocumentor\Faker\Provider class from Mockery

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

No branches or pull requests

3 participants