Skip to content

[FrameworkBundle] Add case in Kernel directory guess for PHPUnit #17272

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

Closed
wants to merge 1 commit into from

Conversation

tgalopin
Copy link
Contributor

@tgalopin tgalopin commented Jan 5, 2016

Q A
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets -
License MIT
Doc PR -

The current automatic guess of the Kernel directory in the context of PHPUnit does work properly using the following commands:

  • phpunit -c app
  • phpunit --configuration app
  • phpunit --configuration=app

But it fails with the synthax phpunit -capp, even if PHPUnit supports it. This PR fixes this.

@@ -83,6 +83,10 @@ private static function getPhpUnitCliConfigArgument()
$argPath = substr($testArg, strlen('--configuration='));
$dir = realpath($argPath);
break;
} elseif (strpos($testArg, '-c') === 0) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this case be handled by the first condition - preg_match('/^-[^ \-]*c$/', $testArg) ? Nope ;) -capp will be seen as a single argument.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

However, the condition should be reversed: 0 === strpos($testArg, '-c'). We use Yoda conditions in Symfony (the previous condition should be fixed as well).

@nicolas-grekas
Copy link
Member

wow, this PR is so old that it runs on a legacy travis configuration :)
Could you please rebase and re-open it on the 2.7 branch?

@stof
Copy link
Member

stof commented Jan 6, 2016

@nicolas-grekas it is not old. But it is based on an unmaintained codebase

@stof
Copy link
Member

stof commented Jan 6, 2016

actually, this should be sent to the 2.3 branch

@jakzal
Copy link
Contributor

jakzal commented Jan 6, 2016

@stof 2.7 actually. This class doesn't exist in 2.3.

@tgalopin
Copy link
Contributor Author

tgalopin commented Jan 6, 2016

I wasn't sure where to post it as it didn't exist in 2.3. I'm rebasing on 2.7.

@stof
Copy link
Member

stof commented Jan 6, 2016

Well, the same code exists in 2.3 in the WebTestCase (KernelTestCase was extracted from it in newer versions indeed).
So the bug should be fixed in 2.3 too.

@tgalopin
Copy link
Contributor Author

tgalopin commented Jan 6, 2016

I'll do both then.

@tgalopin tgalopin closed this Jan 6, 2016
@tgalopin tgalopin deleted the 2.5 branch January 6, 2016 10:02
fabpot added a commit that referenced this pull request Jan 7, 2016
…for PHPUnit (tgalopin)

This PR was merged into the 2.3 branch.

Discussion
----------

[2.3][FrameworkBundle] Add case in Kernel directory guess for PHPUnit

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT
| Doc PR        | -

The current automatic guess of the Kernel directory in the context of PHPUnit does work properly using the following commands:

- `phpunit -c app`
- `phpunit --configuration app`
- `phpunit --configuration=app`

But it fails with the synthax `phpunit -capp`, even if PHPUnit supports it. This PR fixes this.

See #17272.

Commits
-------

758fc1d [FrameworkBundle] Add case in Kernel directory guess for PHPUnit
fabpot added a commit that referenced this pull request Jan 7, 2016
…for PHPUnit (tgalopin)

This PR was merged into the 2.7 branch.

Discussion
----------

[2.7][FrameworkBundle] Add case in Kernel directory guess for PHPUnit

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT
| Doc PR        | -

The current automatic guess of the Kernel directory in the context of PHPUnit does work properly using the following commands:

- `phpunit -c app`
- `phpunit --configuration app`
- `phpunit --configuration=app`

But it fails with the synthax `phpunit -capp`, even if PHPUnit supports it. This PR fixes this.

See #17272.

Commits
-------

a7b7766 [FrameworkBundle] Add case in Kernel directory guess for PHPUnit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants