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

[TwigBridge] Fix workflow test with deps=low#25458

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

Conversation

@Simperfit
Copy link
Contributor

@SimperfitSimperfit commentedDec 12, 2017
edited
Loading

QA
Branch?master
Bug fix?no
New feature?no
BC breaks?no
Deprecations?no
Tests pass?yes
Fixed ticketsnone
LicenseMIT
Doc PRnone

In the original PR the tests were not failling but we should not use the new feature with deps=low until it fetch the branch with the new feature. So this fix the test for the WorkflowExtension in TwigBridge.

@nicolas-grekas
Copy link
Member

nicolas-grekas commentedDec 12, 2017
edited
Loading

Should we plan to remove all the new@legacy method? Won't that reduce the test coverage?
Shouldn't we instead upgrade the test suite to use the not-deprecated API (and keep a few legacy calls just to ensure the legacy way keeps working)?
Feels like so to me.

@nicolas-grekasnicolas-grekas added this to the4.1 milestoneDec 12, 2017
@Simperfit
Copy link
ContributorAuthor

Simperfit commentedDec 12, 2017 via email
edited
Loading

we do not plan to remove but to update when we will update the Bridge touse the new features. but yeah I agree if we can update now let’s do it :)

@chalasr
Copy link
Member

Keeping these legacy tests do not make sense to me either.setUp() should just use the right api based on method existence (the actual code does not even use this part of the api, only the test does).

@Simperfit
Copy link
ContributorAuthor

Simperfit commentedDec 12, 2017 via email
edited
Loading

Oh, maybe we should add a condition like you said and instead of using theannotation use the method from phpunit ?

@chalasr
Copy link
Member

chalasr commentedDec 12, 2017
edited
Loading

IMO there is no deprecation to assert here.
We want to keep 3.x compatibility, the test should just use the right api i.e.$registry->{method_exists($registry, $_ = 'addWorkflow') ? $_ : 'add'}($workflow, ...);, no possible deprecation as the new api is used if it exists.

Simperfit reacted with thumbs up emoji

@SimperfitSimperfitforce-pushed thebugfix/fix-workflow-test-with-low-deps branch fromdf5c849 to323168eCompareDecember 12, 2017 10:36
@Simperfit
Copy link
ContributorAuthor

We can remove the deprecation tag ;)

$registry =newRegistry();
$registry->add($workflow,newInstanceOfSupportStrategy(\stdClass::class));

$registry->{method_exists($registry,$_ ='addWorkflow') ?$_ :'add'}($workflow,newInstanceOfSupportStrategy(\stdClass::class));

Choose a reason for hiding this comment

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

$addWorkflow = method_exists($registry, 'addWorkflow') ? 'addWorkflow' : 'add';
$registry->$addWorkflow($workflow, new InstanceOfSupportStrategy(\stdClass::class));

@SimperfitSimperfitforce-pushed thebugfix/fix-workflow-test-with-low-deps branch 2 times, most recently from1cd637b to1586984CompareDecember 12, 2017 10:51
$addWorkflow =method_exists($registry,'addWorkflow') ?'addWorkflow' :'add';
$supportStrategy =class_exists('Symfony\Component\Workflow\SupportStrategy\InstanceOfSupportStrategy')
?new \Symfony\Component\Workflow\SupportStrategy\InstanceOfSupportStrategy(\stdClass::class)
:new \Symfony\Component\Workflow\SupportStrategy\ClassInstanceSupportStrategy(\stdClass::class);
Copy link
Member

Choose a reason for hiding this comment

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

please keep using use statements :)

@SimperfitSimperfitforce-pushed thebugfix/fix-workflow-test-with-low-deps branch from1586984 toe5c6b92CompareDecember 12, 2017 10:54
@Simperfit
Copy link
ContributorAuthor

🍾 it's green !

@nicolas-grekas
Copy link
Member

Thank you@Simperfit.

@nicolas-grekasnicolas-grekas merged commite5c6b92 intosymfony:masterDec 12, 2017
nicolas-grekas added a commit that referenced this pull requestDec 12, 2017
This PR was merged into the 4.1-dev branch.Discussion----------[TwigBridge] Fix workflow test with deps=low| Q             | A| ------------- | ---| Branch?       | master| Bug fix?      | no| New feature?  | no <!-- don't forget to update src/**/CHANGELOG.md files -->| BC breaks?    | no| Deprecations? | no <!-- don't forget to update UPGRADE-*.md files -->| Tests pass?   | yes| Fixed tickets | none| License       | MIT| Doc PR        | noneIn the original PR the tests were not failling but we should not use the new feature with deps=low until it fetch the branch with the new feature. So this fix the test for the WorkflowExtension in TwigBridge.Commits-------e5c6b92 [TwigBridge] Fix workflow test with deps=low
@SimperfitSimperfit deleted the bugfix/fix-workflow-test-with-low-deps branchDecember 12, 2017 11:08
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@nicolas-grekasnicolas-grekasnicolas-grekas left review comments

@chalasrchalasrchalasr left review comments

Assignees

No one assigned

Projects

None yet

Milestone

4.1

Development

Successfully merging this pull request may close these issues.

5 participants

@Simperfit@nicolas-grekas@chalasr@lyrixx@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp