2017 © Pedro Peláez
 

library sugared-phpunit

PHPUnit sweetened with ease

image

schnittstabil/sugared-phpunit

PHPUnit sweetened with ease

  • Monday, September 26, 2016
  • by schnittstabil
  • Repository
  • 1 Watchers
  • 1 Stars
  • 445 Installations
  • PHP
  • 9 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 11 Versions
  • 0 % Grown

The README.md

SugaredRim\PHPUnit Build Status Coverage Status Scrutinizer Code Quality Code Climate

SensioLabsInsight, (*1)

PHPUnit sweetened with ease :cherries:, (*2)

SugaredRim\PHPUnit takes an opinionated view of testing with PHPUnit, it is preconfigured to get you up and running as quickly as possible., (*3)

Install

$ composer require --dev sugared-rim/phpunit

Usage

Instead of requiring and running phpunit use sugared-rim-phpunit - that's it, no phpunit.xml* needed:, (*4)

{
    ...
    "require-dev": {
        "sugared-rim/phpunit": ...
    },
    "scripts": {
        "test": "sugared-rim-phpunit"
    }
}

Configuration

You may overwrite some options by putting it in your composer.json., (*5)

Some of the default settings:, (*6)

{
    ...
    "scripts": {
        "test": "sugared-rim-phpunit"
    },
    "extra": {
        "sugared-rim/phpunit": {
            "bootstrap": "vendor/autoload.php",
            "coverage": {
                "text": "php://stdout",
                "clover": "build/logs/clover.xml",
                "html": "build/coverage-phpunit/"
            },
            "src": "src",
            "tests": "tests",
            "colors": true,
            "sugared": {
                "listeners": [
                ]
            }
        }
    }
}

src

The source directory., (*7)

tests

The tests directory., (*8)

coverage

See Command-Line Options for details., (*9)

Example: Add SpeedTrapListener

$ composer require --dev johnkary/phpunit-speedtrap
{
    ...
    "extra": {
        "sugared-rim/phpunit": {
            "sugared": {
                "listeners": [
                    {
                        "class": "JohnKary\\PHPUnit\\Listener\\SpeedTrapListener",
                        "arguments": [{"slowThreshold": 500, "reportLength": 10}]
                    }
                ]
            }
        }
    }
}

License

MIT © Michael Mayer, (*10)

The Versions