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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Safeguard JUnit logger against non-standard TestCase #3438

Merged
merged 2 commits into from Dec 6, 2018
Merged

Safeguard JUnit logger against non-standard TestCase #3438

merged 2 commits into from Dec 6, 2018

Conversation

epdenouden
Copy link
Contributor

@epdenouden epdenouden commented Dec 6, 2018

Not all project-specific implementations of TestCase implement support for information methods like e.g. TestCase::getNumAssertions() or TestCase::hasOutput() Rather than causing a scary fatal in the JUnit logger, we quietly skip these elements in the log.

ping @Naktibalda 馃巵

Note

I do realize this is a quickfix, however I would rather have this than have existing test collections fail unexpectedly when run with the JUnit logger. The projects that have spent time on implementing their own TestCase are usually large and complex. I feel it to be much nicer to add some protection on the PHPUnit side as a courtesy for now (7.x) and focus on creating an easy-to-use the TestHook system in version 8.x.

Not all project-specific implementations of TestCase implement support
for information methods like e.g. getNumAssertions() or hasOutput()
Rather than causing a scary fatal in the JUnit logger, we quietly skip
these elements in the log.
@codecov
Copy link

codecov bot commented Dec 6, 2018

Codecov Report

Merging #3438 into 7.5 will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@             Coverage Diff              @@
##                7.5    #3438      +/-   ##
============================================
+ Coverage     83.41%   83.41%   +<.01%     
- Complexity     3614     3618       +4     
============================================
  Files           143      143              
  Lines          9627     9632       +5     
============================================
+ Hits           8030     8035       +5     
  Misses         1597     1597
Impacted Files Coverage 螖 Complexity 螖
src/Util/Log/JUnit.php 94.32% <100%> (+0.2%) 34 <0> (+4) 猬嗭笍

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 ebcf10b...cc32d6e. Read the comment docs.

@sebastianbergmann sebastianbergmann merged commit 49ff35c into sebastianbergmann:7.5 Dec 6, 2018
@epdenouden epdenouden deleted the junit-check-if-testcase-methods-exist branch December 6, 2018 12:59
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

2 participants