Skip to content
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

Fix for #2922 - incorrect "No tests found in class PHPUnit\Framework\*" which happens when there is a test class with @group and provider throwing exception in it, plus tests are ran with --exclude-group for that group, plus there is another class called later (after handing the class from above), and finally when the name of that another class does not match it's file name #2924

Merged
merged 2 commits into from Dec 17, 2017

Conversation

kubawerlos
Copy link
Contributor

@kubawerlos kubawerlos commented Dec 16, 2017

Fixes #2922

I have replaced the silly if in TestSuite.php with more general approach - checking if the class belongs to PHPUnit\Framework.

@codecov-io
Copy link

codecov-io commented Dec 16, 2017

Codecov Report

Merging #2924 into 5.7 will decrease coverage by 0.02%.
The diff coverage is 100%.

Impacted file tree graph

@@             Coverage Diff              @@
##                5.7    #2924      +/-   ##
============================================
- Coverage     52.38%   52.35%   -0.03%     
  Complexity     2912     2912              
============================================
  Files           110      110              
  Lines          7953     7953              
============================================
- Hits           4166     4164       -2     
- Misses         3787     3789       +2
Impacted Files Coverage Δ Complexity Δ
src/Framework/TestSuite.php 71.61% <100%> (ø) 150 <0> (ø) ⬇️
src/Framework/Constraint/ArraySubset.php 86.95% <0%> (-8.7%) 9% <0%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f43b6f4...c906d78. Read the comment docs.

@kubawerlos kubawerlos changed the title Test case for #2922 Fix for #2922 - incorrect "No tests found in class PHPUnit\Framework\*" which happens when there is a test class with @group and provider throwing exception in it, plus tests are ran with --exclude-group for that group, plus there is another class called later (after handing the class from above), and finally when the name of that another class does not match it's file name Dec 16, 2017
@sebastianbergmann sebastianbergmann merged commit 8c174fb into sebastianbergmann:5.7 Dec 17, 2017
@sebastianbergmann
Copy link
Owner

@kubawerlos Thank you for taking care of this.

I had to adapt the skip condition in addTestFile() from using strpos() and looking at the class name to checking the sourcecode directory for PHPUnit 6 due to namespaces. See https://github.com/sebastianbergmann/phpunit/blob/6.5/src/Framework/TestSuite.php#L363

@kubawerlos kubawerlos deleted the bugfix/2922 branch August 3, 2018 10:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants