Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[FrameworkBundle] KernelTestCase: deprecate not using KERNEL_CLASS#22675

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
fabpot merged 1 commit intosymfony:3.4fromogizanagi:deprec/3.4/kernel_test_case_kernel_dir
Jun 9, 2017
Merged

[FrameworkBundle] KernelTestCase: deprecate not using KERNEL_CLASS#22675

fabpot merged 1 commit intosymfony:3.4fromogizanagi:deprec/3.4/kernel_test_case_kernel_dir
Jun 9, 2017

Conversation

@ogizanagi
Copy link
Contributor

@ogizanagiogizanagi commentedMay 9, 2017
edited
Loading

QA
Branch?3.4
Bug fix?no
New feature?no
BC breaks?no
Deprecations?yes
Tests pass?yes
Fixed tickets#22668 (comment)
LicenseMIT
Doc PRN/A

// Can't continue
if (null ===$dir) {
thrownew \RuntimeException('Unable to guess theKernel directory.');
thrownew \RuntimeException('Unable to guess thePHPUnit xml directory.');
Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

I guess this method could be kept for BC and might somehow be useful. So I just update the exceptions messages rather than deprecating it too (same forgetPhpUnitCliConfigArgument).
But what would be a proper exception message for:

if (!isset($_SERVER['argv']) ||false ===strpos($_SERVER['argv'][0],'phpunit')) {thrownew \RuntimeException('You must override the KernelTestCase::createKernel() method.');}

some lines above (L.45) ?

Copy link
Member

Choose a reason for hiding this comment

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

XML instead of xml


* Using`KERNEL_DIR` or the automatic guessing based on the`phpunit.xml` file
location is deprecated since 3.4. Either set`KERNEL_CLASS` in your`phpunit.xml`
to he fully-qualified class name of your Kernel or override the`KernelTestCase::createKernel()`
Copy link
Contributor

Choose a reason for hiding this comment

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

Typo:he =>the.

ogizanagi reacted with thumbs up emoji
3.4.0
-----

* Deprecated not using the new`KERNEL_CLASS` server var with`KernelTestCase`.
Copy link
Contributor

Choose a reason for hiding this comment

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

Deprecated ``KERNEL_DIR`` ... ?

julienfalque and chalasr reacted with thumbs up emoji
Copy link
ContributorAuthor

@ogizanagiogizanagiMay 9, 2017
edited
Loading

Choose a reason for hiding this comment

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

Not only. What is deprecated is the whole current method implementation, i.eKERNEL_DIR and the auto-detection based onphpunit.xml dir location. <=> Not usingKERNEL_CLASS (it's better explained in theUPGRADE-3.4.md file. I believe it should stay short here)

Copy link
Contributor

Choose a reason for hiding this comment

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

If you overrideKernelTestCase::createKernel(), you (probably) don't useKERNEL_CLASS but you don't get a deprecation notice, this should be mentioned here as well. As this would make the sentence longer, I think@ro0NL's suggestions makes even more sense.

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

Fair enough. 😃

* Using`KERNEL_DIR` or the automatic guessing based on the`phpunit.xml` file
location is deprecated since 3.4. Either set`KERNEL_CLASS` in your`phpunit.xml`
to the fully-qualified class name of your Kernel or override the`KernelTestCase::createKernel()`
method. Not setting`KERNEL_CLASS` will throw an exception on 4.0.
Copy link
Member

Choose a reason for hiding this comment

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

can't we also overwritegetKernelClass() only ?

Copy link
ContributorAuthor

@ogizanagiogizanagiMay 9, 2017
edited
Loading

Choose a reason for hiding this comment

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

Yes indeed. I mean not settingKERNEL_CLASS when using theKernelTestCase::createKernel() base implementation. Of course if you overwrite it your on your own (and it's already suggested).
I don't know how to rephrase it better if the current version is not enough. I'll take any other suggestion.

EDIT: Sorry I misred your comment.

Copy link
Contributor

Choose a reason for hiding this comment

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

What about:

Using`KERNEL_DIR` or the automatic guessing based on the`phpunit.xml` filelocation is deprecated since 3.4. Set`KERNEL_CLASS` to the fully-qualifiedclass name of your Kernel instead. Not setting`KERNEL_CLASS` will throw anexception on 4.0 unless you override`KernelTestCase::createKernel()` or`KernelTestCase::getKernelClass()` method.

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

I'll take this. Thank you@julienfalque

@ogizanagi
Copy link
ContributorAuthor

I changed my mind aboutKernelTestCase::getPhpUnitXmlDir() andKernelTestCase::getPhpUnitCliConfigArgument() and I deprecated it as well (to be removed in 4.0). It's unlikely someone is using it for another reason (if it is, it's probably fragile) and has nothing to do inKernelTestCase once the current implementation ofKernelTestCase::getKernelClass() is removed.

class instead.

* The usage of`KERNEL_DIR` and the automatic guessing based on the`phpunit.xml`
file location has been removed from`KernelTestCase::getKernelClass()` implementation.
Copy link
Contributor

Choose a reason for hiding this comment

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

have been?

ogizanagi reacted with thumbs up emoji
@javiereguiluzjaviereguiluz added this to the3.4 milestoneMay 11, 2017
FrameworkBundle
---------------

* Using`KERNEL_DIR` or the automatic guessing based on the`phpunit.xml` file
Copy link
Member

Choose a reason for hiding this comment

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

phpunit.xml/phpunit.xml.dist?

exception on 4.0 unless you override`KernelTestCase::createKernel()` or
`KernelTestCase::getKernelClass()` method.

* Methods`KernelTestCase::getPhpUnitXmlDir()` and`KernelTestCase::getPhpUnitCliConfigArgument()`
Copy link
Member

Choose a reason for hiding this comment

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

The methods [...]

sstok reacted with thumbs up emoji
*/
privatestaticfunctiongetPhpUnitCliConfigArgument()
{
@trigger_error(sprintf('Method %s() is deprecated since 3.4 and will be removed in 4.0.',__METHOD__),E_USER_DEPRECATED);
Copy link
Member

Choose a reason for hiding this comment

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

The %s() method [...]


return$class;
}else {
@trigger_error(sprintf('Using KERNEL_DIR or the automatic guessing based on the phpunit.xml file location is deprecated since 3.4. Set KERNEL_CLASS to the fully-qualified class name of your Kernel instead. Not setting KERNEL_CLASS will throw an exception on 4.0 unless you override %1$::createKernel() or %1$::getKernelClass() method.',static::class),E_USER_DEPRECATED);
Copy link
Member

Choose a reason for hiding this comment

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

Using the KERNEL_DIR environment variable [...]

Copy link
Member

Choose a reason for hiding this comment

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

Set the KERNEL_CLASS environment variable [...]

*/
protectedstaticfunctiongetPhpUnitXmlDir()
{
@trigger_error(sprintf('Method %s() is deprecated since 3.4 and will be removed in 4.0.',__METHOD__),E_USER_DEPRECATED);
Copy link
Member

Choose a reason for hiding this comment

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

The %s() method [...]

3.4.0
-----

* Deprecated using`KERNEL_DIR` server var with`KernelTestCase::getKernelClass()`.
Copy link
Member

Choose a reason for hiding this comment

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

Deprecated using theKERNEL_DIR environment variable [...]

-----

* Deprecated using`KERNEL_DIR` server var with`KernelTestCase::getKernelClass()`.
* Deprecated`KernelTestCase::getPhpUnitXmlDir()` and`KernelTestCase::getPhpUnitCliConfigArgument()` methods.
Copy link
Member

Choose a reason for hiding this comment

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

Deprecated the [...]

override`KernelTestCase::createKernel()` or`KernelTestCase::getKernelClass()`
method instead.

* Methods`KernelTestCase::getPhpUnitXmlDir()` and`KernelTestCase::getPhpUnitCliConfigArgument()`
Copy link
Member

Choose a reason for hiding this comment

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

The methods [...]

@ogizanagi
Copy link
ContributorAuthor

Thanks for all the suggested improvements@xabbuh!

@ogizanagiogizanagi changed the base branch frommaster to3.4May 17, 2017 18:31
@fabpot
Copy link
Member

Thank you@ogizanagi.

@fabpotfabpot merged commitd102fc0 intosymfony:3.4Jun 9, 2017
fabpot added a commit that referenced this pull requestJun 9, 2017
…KERNEL_CLASS (ogizanagi)This PR was merged into the 3.4 branch.Discussion----------[FrameworkBundle] KernelTestCase: deprecate not using KERNEL_CLASS| Q             | A| ------------- | ---| Branch?       | 3.4| Bug fix?      | no| New feature?  | no| BC breaks?    | no| Deprecations? | yes| Tests pass?   | yes| Fixed tickets |#22668 (comment)| License       | MIT| Doc PR        | N/ACommits-------d102fc0 [FrameworkBundle] KernelTestCase: deprecate not using KERNEL_CLASS
@ogizanagiogizanagi deleted the deprec/3.4/kernel_test_case_kernel_dir branchJune 9, 2017 06:10
fabpot added a commit that referenced this pull requestJun 14, 2017
…e (ogizanagi)This PR was merged into the 4.0-dev branch.Discussion----------[FrameworkBundle] Remove KernelTestCase deprecated code| Q             | A| ------------- | ---| Branch?       | master <!-- see comment below -->| Bug fix?      | no| New feature?  | no <!-- don't forget updating src/**/CHANGELOG.md files -->| BC breaks?    | yes| Deprecations? | no <!-- don't forget updating UPGRADE-*.md files -->| Tests pass?   | yes| Fixed tickets |#22675| License       | MIT| Doc PR        | N/A(failures unrelated)Commits-------6d28c43 [FrameworkBundle] Remove KernelTestCase deprecated code
@fabpotfabpot mentioned this pull requestOct 18, 2017
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@stofstofstof left review comments

@xabbuhxabbuhxabbuh left review comments

@fabpotfabpotfabpot approved these changes

+2 more reviewers

@ro0NLro0NLro0NL left review comments

@julienfalquejulienfalquejulienfalque requested changes

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Projects

None yet

Milestone

3.4

Development

Successfully merging this pull request may close these issues.

8 participants

@ogizanagi@fabpot@stof@ro0NL@julienfalque@xabbuh@javiereguiluz@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp