-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[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
Conversation
@@ -83,6 +83,10 @@ private static function getPhpUnitCliConfigArgument() | |||
$argPath = substr($testArg, strlen('--configuration=')); | |||
$dir = realpath($argPath); | |||
break; | |||
} elseif (strpos($testArg, '-c') === 0) { |
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.
Shouldn't this case be handled by the first condition - Nope ;) preg_match('/^-[^ \-]*c$/', $testArg)
?-capp
will be seen as a single argument.
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.
However, the condition should be reversed: 0 === strpos($testArg, '-c')
. We use Yoda conditions in Symfony (the previous condition should be fixed as well).
wow, this PR is so old that it runs on a legacy travis configuration :) |
@nicolas-grekas it is not old. But it is based on an unmaintained codebase |
actually, this should be sent to the 2.3 branch |
@stof 2.7 actually. This class doesn't exist in 2.3. |
I wasn't sure where to post it as it didn't exist in 2.3. I'm rebasing on 2.7. |
Well, the same code exists in 2.3 in the WebTestCase (KernelTestCase was extracted from it in newer versions indeed). |
I'll do both then. |
…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
…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
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.