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

[PhpUnitBridge] Fix some errors when using serialized deprecations#33820

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
nicolas-grekas merged 1 commit intosymfony:4.4fromgreg0ire:carry-31478
Feb 4, 2020

Conversation

@greg0ire
Copy link
Contributor

QA
Branch?4.3
Bug fix?yes
New feature?no
Deprecations?no
Ticketsn/a
LicenseMIT
Doc PRn/a

This PR attempts to fix conflicts that arose in#31478

Creating as a draft for now as I think having separate test methods no longer make sense (isSelf() andisIndirect() have been replaced withgetType()).@l-vo please review and confirm I did not loose anything valuable from your original contribution.

@nicolas-grekasnicolas-grekas added this to the4.3 milestoneOct 3, 2019
@greg0iregreg0ire marked this pull request as ready for reviewOctober 14, 2019 20:15
@greg0ire
Copy link
ContributorAuthor

I just renamed test methods that were tied to methods that no longer exists (isSelf(),isIndirect()). I think we'll have to do without a review from@l-vo

@l-vo
Copy link
Contributor

@greg0ire Excuse me, I'm currently running out of time and I have to get back into the context. But I'm going to look at this as soon as I can 😊

greg0ire reacted with heart emoji

@l-vo
Copy link
Contributor

I reviewed and tested the changes, it looks good to me. Although there is a problem, the tests don't pass. The changes on the type "self" determination makes the type "self" difficult to test.

publicfunctionproviderGetTypeDetectsSelf():array
{
return [
'not_from_vendors_file' => [Deprecation::TYPE_SELF,'','MyClass1',''],
Copy link
Contributor

@l-vol-voOct 20, 2019
edited
Loading

Choose a reason for hiding this comment

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

Don't pass anymore. A way to test it:

foreach (get_declared_classes()as$class) {if ('C' ===$class[0] &&0 ===strpos($class,'ComposerAutoloaderInit')) {$r =new \ReflectionClass($class);$v =\dirname(\dirname($r->getFileName()));if (file_exists($v.'/composer/installed.json')) {$loader =require$v.'/autoload.php';$reflection =new \ReflectionClass($loader);$prop =$reflection->getProperty('prefixDirsPsr4');$prop->setAccessible(true);$currentValue =$prop->getValue($loader);$currentValue['Symfony\\Bridge\\PhpUnit\\'] = [realpath(__DIR__.'/../..')];$prop->setValue($loader,$currentValue);                }            }        }return ['not_from_vendors_file' => [Deprecation::TYPE_SELF,'','MyClass1',__FILE__],//...];

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

Cannot say I understand but I applied this change 😅

Copy link
Contributor

Choose a reason for hiding this comment

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

It's just change composer loader psr4 paths which are used to determine "self" type :)

'',
],
'serialized_trace_with_not_from_vendors_triggering_file' => [
Deprecation::TYPE_SELF,
Copy link
Contributor

@l-vol-voOct 20, 2019
edited
Loading

Choose a reason for hiding this comment

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

Hum it will depend from where tests are launched. I think we can remove this data provided.

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

removed

'not_from_vendors_file' => [Deprecation::TYPE_SELF,'','MyClass1',''],
'nonexistent_file' => [Deprecation::TYPE_UNDETERMINED,'','MyClass1','dummy_vendor_path'],
'serialized_trace_without_triggering_file' => [
Deprecation::TYPE_SELF,
Copy link
Contributor

@l-vol-voOct 20, 2019
edited
Loading

Choose a reason for hiding this comment

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

it will depend from where tests are launched. I think we can remove this data provided.

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

removed

@greg0ire
Copy link
ContributorAuthor

greg0ire commentedOct 24, 2019
edited
Loading

@l-vo I applied your suggestions, please review again :)
Note that the patch from fabbot should not be applied as code in this particular component should still be compatible with php 5.5.9

Copy link
Contributor

@l-vol-vo left a comment

Choose a reason for hiding this comment

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

LGTM :)

greg0ire reacted with heart emoji
@nicolas-grekasnicolas-grekas modified the milestones:4.3,4.4Feb 1, 2020
@nicolas-grekasnicolas-grekas changed the title[PHPUnit Bridge] Carry #31478[PhpUnitBridge] Fix some errors when using serialized deprecationsFeb 4, 2020
@nicolas-grekas
Copy link
Member

Thank you@greg0ire.

nicolas-grekas added a commit that referenced this pull requestFeb 4, 2020
…ecations (l-vo)This PR was submitted for the 4.3 branch but it was squashed and merged into the 4.4 branch instead.Discussion----------[PhpUnitBridge] Fix some errors when using serialized deprecations| Q             | A| ------------- | ---| Branch?       | 4.3| Bug fix?      | yes| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->| Tickets       | n/a| License       | MIT| Doc PR        | n/aThis PR attempts to fix conflicts that arose in#31478Creating as a draft for now as I think having separate test methods no longer make sense (`isSelf()` and `isIndirect()` have been replaced with `getType()`).@l-vo please review and confirm I did not loose anything valuable from your original contribution.Commits-------056d598 [PhpUnitBridge] Fix some errors when using serialized deprecations
@nicolas-grekasnicolas-grekas merged commit056d598 intosymfony:4.4Feb 4, 2020
@greg0iregreg0ire deleted the carry-31478 branchFebruary 4, 2020 16:49
greg0ire added a commit to greg0ire/symfony that referenced this pull requestFeb 5, 2020
I failed to apply perfectly this comment:symfony#33820 (comment)It should fix one failing test in the bridge.
greg0ire added a commit to greg0ire/symfony that referenced this pull requestFeb 5, 2020
I failed to apply this comment perfectly:symfony#33820 (comment)It should fix one failing test in the bridge.
nicolas-grekas added a commit that referenced this pull requestFeb 5, 2020
This PR was merged into the 4.4 branch.Discussion----------[PHPunit bridge] Provide current file as file pathI failed to apply perfectly this comment:#33820 (comment)It should fix one failing test in the bridge.| Q             | A| ------------- | ---| Branch?       |4.4| Bug fix?      | not for the end user| New feature?  | no| Deprecations? | no| Tickets       | n/a| License       | MIT| Doc PR        | n/a<!--Replace this notice by a short README for your feature/bugfix. This will help peopleunderstand your PR and can be used as a start for the documentation.Additionally (seehttps://symfony.com/roadmap): - Always add tests and ensure they pass. - Never break backward compatibility (seehttps://symfony.com/bc). - Bug fixes must be submitted against the lowest maintained branch where they apply   (lowest branches are regularly merged to upper ones so they get the fixes too.) - Features and deprecations must be submitted against branch master.-->Commits-------d5302cb Provide current file as file path
@fabpotfabpot mentioned this pull requestFeb 29, 2020
@fabpotfabpot mentioned this pull requestFeb 29, 2020
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

1 more reviewer

@l-vol-vol-vo approved these changes

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Projects

None yet

Milestone

4.4

Development

Successfully merging this pull request may close these issues.

4 participants

@greg0ire@l-vo@nicolas-grekas@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp