• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

PHPCSStandards / PHP_CodeSniffer / 10122611223
78%
master: 79%

Build:
Build:
LAST BUILD BRANCH: 4.x
DEFAULT BRANCH: master
Ran 27 Jul 2024 09:47AM UTC
Jobs 3
Files 260
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

27 Jul 2024 09:43AM UTC coverage: 74.597% (+0.8%) from 73.786%
10122611223

push

github

jrfnl
Tests/ConfigDouble: bug fix - always reset Config statics after use

The `Config` class uses a number of static properties, which may be updated during tests. These were previously - prior to 275 - reset to their default values in the `AbstractMethodUnitTest::resetTestFile()` method, but this reset was inadvertently removed with the reasoning that, if all tests use the `ConfigDouble`, the reset would no longer be needed as the `ConfigDouble` resets on being initialized.

The flaw in this logic is that not all tests are guaranteed to use the `ConfigDouble`, which means that without the reset, the `Config` class may be left "dirty" after tests using the `ConfigDouble`, which could break tests.

This commit fixes this issue by:
* Adding a `__destruct()` method to the `ConfigDouble` class which will reset the static properties on the PHPCS native `Config` class whenever an object created from this class is destroyed.
* Explicitly calling the `__destruct()` method from the `AbstractMethodUnitTest::reset()` method to ensure it is always run after a test has finished ("after class"), even if there would still be a lingering reference to the object.

This is only a stability tweak, there are no existing tests affected by this issue at this time.

17969 of 24088 relevant lines covered (74.6%)

71.71 hits per line

Jobs
ID Job ID Ran Files Coverage
1 php-8.1-custom-ini-true - 10122611223.1 27 Jul 2024 09:47AM UTC 260
72.36
GitHub Action Run
2 php-8.3-custom-ini-false - 10122611223.2 27 Jul 2024 09:48AM UTC 260
72.33
GitHub Action Run
3 php-7.2-custom-ini-false - 10122611223.3 27 Jul 2024 09:49AM UTC 260
70.49
GitHub Action Run
Source Files on build 10122611223
  • Tree
  • List 260
  • Changed 7
  • Source Changed 0
  • Coverage Changed 6
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #10122611223
  • d8a916af on github
  • Prev Build on 4.0 (#10053716850)
  • Next Build on 4.0 (#10122702951)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc