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

Remove part about prophecy #1369

Merged
merged 1 commit into from
Jan 27, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 1 addition & 16 deletions templates/project/CONTRIBUTING.md.twig
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ If your PR contains an addition, a new feature, this one has to be fully covered

Some rules have to be respected about the test:

* Prefer [the built-in test doubles implementation](https://phpunit.de/manual/current/en/test-doubles.html) over prophecy.
* Annotations about coverage are prohibited. This concerns:
* `@covers`
* `@coversDefaultClass`
Expand All @@ -161,22 +162,6 @@ Some rules have to be respected about the test:
* Most of the time, the test class SHOULD have the same name as the targeted class, suffixed by `Test`.
* The `@expectedException*` annotations are prohibited. Use `PHPUnit_Framework_TestCase::setExpectedException()`.

##### Using test doubles

Historically, Sonata has been using [the built-in test doubles implementation](https://phpunit.de/manual/current/en/test-doubles.html),
but [started to use Prophecy](https://github.com/sonata-project/dev-kit/issues/89).
This means the current Sonata codebase currently uses both implementations.

If you want to contribute a test that uses test doubles, please follow these rules :

1. All new test classes MUST use built-in test double implementation.
2. If you are changing an existing test method, you MUST use the same implementation it already uses,
and focus on the goal of your PR and only on that.
3. If you are changing an existing test class, you MUST use the same implementation it already uses,
to be more consistent.
4. You MAY submit a PR that migrates a test class from Prophecy to the built-in test double implementation,
but it MUST migrate it entirely. The PR SHOULD only be about the migration.

### Writing a Pull Request

#### Subject
Expand Down