2017 © Pedro Peláez
 

library phpunit-test-checker

image

jimmyoak/phpunit-test-checker

  • Sunday, January 24, 2016
  • by jimmyoak
  • Repository
  • 2 Watchers
  • 0 Stars
  • 2,326 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 8 Versions
  • 2 % Grown

The README.md

PHPUnit test checker

Description

Check for classes without tests. Intended for pre-commit hook., (*1)

Usage

Config file example (phpunit-test-checker.json):, (*2)

{
  "suites": [
    {
      "src-path": "src/",
      "test-path": "test/",
      "test-case-suffix": "Test"
    }
  ]
}

Read config and check for classes with no tests:, (*3)

use JimmyOak\PhpUnitChecker\Checker\Checker;

require_once __DIR__ . '/vendor/autoload.php';

$checker = new Checker(\JimmyOak\PhpUnitChecker\Config\JsonConfigReader::readFile(__DIR__ . '/phpunit-test-checker.json'));
$checker->check();

Output:, (*4)

Classes with no tests:
        - Checker/Checker.php
        - Command/CheckerCommand.php

But if we run with this config...:, (*5)

{
  "suites": [
    {
      "src-path": "src/",
      "test-path": "test/",
      "test-case-suffix": "Test",
      "excluded": [
        "Checker/Checker.php",
        "Command/"
      ]
    }
  ]
}

Outputs nothing :), (*6)

"Excluded" is just a regex like /^Command/, therefore if it's a folder put the / separator at the end., (*7)

TODO

A lot of improvements. This is only an approach. (Proof of concept), (*8)

The Versions

24/01 2016

dev-master

9999999-dev

  Sources   Download

MIT

The Requires

 

The Development Requires

test phpunit hook testing git php check unit utilities checker precommit jimmy jimmyoak

22/01 2016

1.3.2

1.3.2.0

  Sources   Download

MIT

The Requires

 

The Development Requires

phpunit php check utilities checker jimmy jimmyoak

22/01 2016

1.3.1

1.3.1.0

  Sources   Download

MIT

The Requires

 

The Development Requires

phpunit php check utilities checker jimmy jimmyoak

22/01 2016

1.3.0

1.3.0.0

  Sources   Download

MIT

The Requires

 

The Development Requires

phpunit php check utilities checker jimmy jimmyoak

21/01 2016

1.2.0

1.2.0.0

  Sources   Download

MIT

The Requires

 

The Development Requires

phpunit php check utilities checker jimmy jimmyoak

21/01 2016

1.1.1

1.1.1.0

  Sources   Download

MIT

The Requires

 

The Development Requires

phpunit php check utilities checker jimmy jimmyoak

21/01 2016

1.1.0

1.1.0.0

  Sources   Download

MIT

The Requires

 

The Development Requires

phpunit php check utilities checker jimmy jimmyoak

21/01 2016

1.0.0

1.0.0.0

  Sources   Download

MIT

The Requires

 

The Development Requires

phpunit php check utilities checker jimmy jimmyoak