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

@test annotation gets accepted no matter what #2902

Closed
BackEndTea opened this issue Dec 7, 2017 · 4 comments
Closed

@test annotation gets accepted no matter what #2902

BackEndTea opened this issue Dec 7, 2017 · 4 comments
Labels
type/bug Something is broken
Milestone

Comments

@BackEndTea
Copy link
Contributor

Q A
PHPUnit version 6.5.1
PHP version 7.1.12
Installation Method Composer

A function is considered a test, as long as the doc block contains @test, even if it is something like this:

/**
 * @author [email protected]
 */
 public function itDoesSomething() {}

I propose to change this to only detect a function as a test if @test there is surrounded by whitespace. So the following examples should still be accepted as tests

/**
 * @test
 *@test
 * @test Makes sure our code works
 */

But this would not

/**
 * My email is [email protected]
 */

This breaks backwards compatibility, so, if implemented, has to wait for a major version up.

@sebastianbergmann sebastianbergmann added the type/bug Something is broken label Dec 7, 2017
@sebastianbergmann sebastianbergmann added this to the PHPUnit 7.0 milestone Dec 7, 2017
@sebastianbergmann
Copy link
Owner

@sebastianbergmann
Copy link
Owner

While we're at it, the (now) undocumented @scenario which was used by the unsupported phpunit-story extension should be removed.

@BackEndTea
Copy link
Contributor Author

If i make a PR for this, should i send it to master?

@sebastianbergmann
Copy link
Owner

Yes, master is PHPUnit 7.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/bug Something is broken
Projects
None yet
Development

No branches or pull requests

2 participants