twistersfury/codeception-coverage

Utility Project To Ensure All Classes Have An Equivalent Test File

Maintainers

Package info

gitlab.com/twistersfury/plugins/codecetion-coverage

Issues

pkg:composer/twistersfury/codeception-coverage

Statistics

Installs: 8

Dependents: 0

Suggesters: 0

Stars: 0

v1.0.0 2026-05-07 01:06 UTC

This package is not auto-updated.

Last update: 2026-05-07 01:17:47 UTC


README

This module will verify that there is a 1-to-1 relationship between the application files and the unit tests.

Usage

Installation

composer require twistersfury/codception-coverage

Initial Setup

The susgested setup is to create a custom suite called coverages and add the test file there. Otherwise, you can put it into the Unit Suite instead. If you've never used a custom suite, you can look at this package's tests folder as an example setup. The key files are coverage.suite.dist.yml and _support/CoverageTester.php in addition to the coverage folder/test.

Create a single file in your unit suite or custom suite with the below contents:

<?php

use TwistersFury\Codeception\Coverage\FileCoverageTest;

class CoverageTest extends FileCoverageTest
{
    // Empty Body
}

Configuration

The below example represents the default configuration and can otherwise be omitted for most projects.

modules:
  config:
    \TwistersFury\Codeception\Coverage\Module:
      sourcePath: 'src' # The path to the source files to be scanned.
      testPath: 'tests/unit' # The path to the unit tests to check.

      ###################################################################################################
      # The extension to check for. It will automatically skip any files that do not have this extension.
      #   This module was originally developed for a Zephir based project, which uses the extension .zep.
      extension: 'php'

      ###################################################################################################
      # Patterns listed in `ignores` will be excluded from the testing. This allows you to define what
      #   items get scanned, and what items do not. This is a str_contains match (not regex). Note that
      #   if you change `extension` above, you'll likely be needing to change `ignores` below.
      ignores:
        - '/etc'
        - 'phalcon_bootstrap.php'
        - '/Interfaces/'
        - 'Interface.php'
        - 'Controller.php'