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

PHPCSStandards / PHP_CodeSniffer / 7369434979
78%
master: 79%

Build:
Build:
LAST BUILD BRANCH: feature/fixer-conflict/PSR12.Functions.ReturnTypeDeclaration
DEFAULT BRANCH: master
Ran 31 Dec 2023 08:44AM UTC
Jobs 3
Files 257
Run time 16s
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

31 Dec 2023 08:43AM UTC coverage: 64.178% (+0.2%) from 64.019%
7369434979

push

github

jrfnl
Filters: add tests for `GitModified` and `GitStaged` filters

This is an initial set of tests for the `GitModified` and `GitStaged` filters.

The tests are largely the same for both filters as the logic under test is also largely the same.
Still, having separate test classes will allow for differentiating the tests if the logic in the filters themselves would start to diverge over time or if the output of the individual git commands would give reason to add extra tests.

Notes:
* To allow for mocking the output of the "git modified"/"git staged" commands, the handling of the function call to `exec` has been moved to a separate method in both the `GitModified`, as well as the `GitStaged` class.
* This commit adds three new helper methods to the `AbstractFilterTestCase`:
    - `getMockedClass()` to handle creating a mock object of the filter under test in a PHPUnit cross-version compatible manner.
    - `getBaseDir()` to get the project root directory for use as the `$basedir` for the filters.
    - `getFakeFileList()` to get, as the name says, a fake file list for use in the tests, which contains a range of different file/directory situations which filter may need to take into account.
        Note: `.` and `..` are not included as the `PHP_CodeSniffer\Files\FileList` (which is basically what we're faking here) does not include those either, so that would create unrealistic test scenarios.
        Also note that, aside from some non-existent files added to the list for testing purposes, the files in this list _do_ actually need to exist for the tests to be valid.

15171 of 23639 relevant lines covered (64.18%)

5.41 hits per line

Jobs
ID Job ID Ran Files Coverage
1 php-8.3-custom-ini-false - 7369434979.1 31 Dec 2023 08:44AM UTC 257
63.31
GitHub Action Run
2 php-8.0-custom-ini-true - 7369434979.2 31 Dec 2023 08:44AM UTC 257
63.27
GitHub Action Run
3 php-7.2-custom-ini-false - 7369434979.3 31 Dec 2023 08:44AM UTC 257
60.21
GitHub Action Run
Source Files on build 7369434979
  • Tree
  • List 257
  • Changed 3
  • Source Changed 2
  • Coverage Changed 3
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #7369434979
  • ebbb4641 on github
  • Prev Build on 4.0 (#7369272488)
  • Next Build on 4.0 (#7369478821)
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

© 2025 Coveralls, Inc