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] Added ClassExistsMock#28931

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:masterfromro0NL:symbol-mock
Dec 10, 2018
Merged

[PhpUnitBridge] Added ClassExistsMock#28931

fabpot merged 1 commit intosymfony:masterfromro0NL:symbol-mock
Dec 10, 2018

Conversation

@ro0NL
Copy link
Contributor

@ro0NLro0NL commentedOct 20, 2018
edited
Loading

QA
Branch?master
Bug fix?no
New feature?yes
BC breaks?no
Deprecations?no
Tests pass?yes
Fixed tickets#...
LicenseMIT
Doc PRsymfony/symfony-docs#10528

I've thought about this before, and bumped into it again when trying to test#28898

This PR allows to mockclass|interface|trait_exists to enable specific code path testing

@nicolas-grekas
Copy link
Member

Mocks don't work with root-namespaced functions, and it turns out that*_exists() are in the list of the calls we recommend root-aliasing... Which means this will have a very low reach. For this reason, I'm not sure we should maintain this...

sstok reacted with thumbs up emoji

@ro0NL
Copy link
ContributorAuthor

ro0NL commentedOct 20, 2018
edited
Loading

ouch :( i didnt saw any root namespaced variant in code base. Also CS does not propose these functions (yet) right?

@nicolas-grekas
Copy link
Member

Actually I was wrong sorry,*_exists() are not in the list!

ro0NL reacted with hooray emoji

@nicolas-grekasnicolas-grekas added this to thenext milestoneOct 20, 2018
@ro0NLro0NL mentioned this pull requestOct 20, 2018
@ro0NLro0NL changed the title[PhpUnitBridge] Added SymbolExistenceMock[PhpUnitBridge] Added ClassExistsMockOct 21, 2018
@javiereguiluz
Copy link
Member

@ro0NL thanks for creatingsymfony/symfony-docs#10528 to track this feature in Symfony Docs. Much appreciated!

Sadly, the docs issue is not very actionable because the description of this PR is a bit lacking. Please update it to explain which changes would this require for full Symfony apps and for apps that use this as a stand-alone component.

If no changes are needed, please add some before/after examples or show what can we do now that wasn't possible before. Thanks!

@ro0NL
Copy link
ContributorAuthor

ro0NL commentedDec 1, 2018
edited
Loading

should there be any annotation integration, ie.@class-exists Some\Class Some\Other\Class?

@nicolas-grekas
Copy link
Member

I'm not sure - not if we don't have a use case.

@ro0NL
Copy link
ContributorAuthor

#28898 could have one more test using@class-not-exists Symfony\Component\VarDumper\Dumper\CliDumper 👼

@fabpot
Copy link
Member

Thank you@ro0NL.

@fabpotfabpot merged commit62caec1 intosymfony:masterDec 10, 2018
fabpot added a commit that referenced this pull requestDec 10, 2018
This PR was squashed before being merged into the 4.3-dev branch (closes#28931).Discussion----------[PhpUnitBridge] Added ClassExistsMock| Q             | A| ------------- | ---| Branch?       | master| Bug fix?      | no| New feature?  | yes| BC breaks?    | no     <!-- seehttps://symfony.com/bc -->| Deprecations? | no| Tests pass?   | yes    <!-- please add some, will be required by reviewers -->| Fixed tickets | #...   <!-- #-prefixed issue number(s), if any -->| License       | MIT| Doc PR        |symfony/symfony-docs#10528I've thought about this before, and bumped into it again when trying to test#28898This PR allows to mock `class|interface|trait_exists` to enable specific code path testingCommits-------62caec1 [PhpUnitBridge] Added ClassExistsMock
@ro0NLro0NL deleted the symbol-mock branchDecember 10, 2018 08:12
@nicolas-grekasnicolas-grekas modified the milestones:next,4.3Apr 30, 2019
@fabpotfabpot mentioned this pull requestMay 9, 2019
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@fabpotfabpotfabpot approved these changes

@nicolas-grekasnicolas-grekasnicolas-grekas approved these changes

Assignees

No one assigned

Projects

None yet

Milestone

4.3

Development

Successfully merging this pull request may close these issues.

5 participants

@ro0NL@nicolas-grekas@javiereguiluz@fabpot@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp