npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

grunt-phpunit-dplus

v0.4.0

Published

Grunt plugin for running phpunit.

Downloads

597

Readme

grunt-phpunit-D+

Grunt plugin for running phpunit. It's a fork of grunt-phpunit with enhanced possibilities for the 'd' options.

##Getting Started

This plugin requires Grunt 0.4.0.

If you haven't used Grunt before, be sure to check out the Getting Started guide, as it explains how to create a Gruntfile as well as install and use Grunt plugins.

  1. Install this grunt plugin with the following command:

    npm install grunt-phpunit-dplus --save-dev
  2. Install phpunit (preferably with composer)

    composer install
  3. Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:

    grunt.loadNpmTasks('grunt-phpunit');

##PHPUnit task

Run this task with the grunt phpunit command.

###Usage Example

phpunit: {
	classes: {
		dir: 'tests/php/'
	},
	options: {
		bin: 'vendor/bin/phpunit',
		bootstrap: 'tests/php/phpunit.php',
		colors: true
	}
}

###Target Properties ####dir Type: String

The directory where phpunit should be run, i.e. where the test classes and the bootstrap are located in.

###Options ####bin Type: String Default: 'phpunit'

The executable binary.

####logJunit Type: String Default: false

Log test execution in JUnit XML format to file.

####logTap Type: String Default: false

Log test execution in TAP format to file.

####logJson Type: String Default: false

Log test execution in JSON format.

####coverageClover Type: String Default: false

Generate code coverage report in Clover XML format.

####coverageHtml Type: String Default: false

Generate code coverage report in HTML format.

####coveragePhp Type: String Default: false

Serialize PHP_CodeCoverage object to file.

####coverage (or coverageText) Type: Boolean Default: false

Generate code coverage report in text format. Default to writing to the standard output. This option can also be set by running the task with --coverage.

####testsuite Type: String Default: false Filter which testsuite to run.

####testSuffix Type: String Default: false Only search for test in files with specified suffix(es).

####testdox Type: Boolean Default: false

Report test execution progress in TestDox format. This option can also be set by running the task with --testdox.

####testdoxHtml Type: String Default: false

Write agile documentation in HTML format to file.

####testdoxText Type: String Default: false

Write agile documentation in Text format to file.

####filter Type: String Default: false

Filter which tests to run.

####group Type: String Default: false

Only runs tests from the specified group(s).

####excludeGroup Type: String Default: false

Exclude tests from the specified group(s).

####listGroups Type: Boolean Default: false

List available test groups. This option can also be set by running the task with --list-groups.

####loader Type: String Default: false

TestSuiteLoader implementation to use.

####printer Type: String Default: false

TestSuiteListener implementation to use.

####repeat Type: String Default: false

Runs the test(s) repeatedly.

####tap Type: Boolean Default: false

Report test execution progress in TAP format. This option can also be set by running the task with --tap.

####colors Type: Boolean Default: false

Use colors in output. This option can also be set by running the task with --colors.

####stderr Type: Boolean Default: false

Write to STDERR instead of STDOUT. This option can also be set by running the task with --stderr.

####stopOnError Type: Boolean Default: false

Stop execution upon first error. This option can also be set by running the task with --stop-on-error.

####stopOnFailure Type: Boolean Default: false

Stop execution upon first error or failure. This option can also be set by running the task with --stop-on-failure.

####stopOnSkipped Type: Boolean Default: false

Stop execution upon first skipped test. This option can also be set by running the task with --stop-on-skipped.

####stopOnIncomplete Type: Boolean Default: false

Stop execution upon first incomplete test. This option can also be set by running the task with --stop-on-incomplete.

####strict Type: Boolean Default: false

Run tests in strict mode. This option can also be set by running the task with --strict.

####verbose Type: Boolean Default: false

Output more verbose information. This option can also be set by running the task with --verbose.

####debug Type: Boolean Default: false

Display debbuging information during test execution. This option can also be set by running the task with --debug.

####processIsolation Type: Boolean Default: false

Run each test in a separate PHP process. This option can also be set by running the task with --process-isolation.

####noGlobalsBackup Type: Boolean Default: false

Do not backup and restore $GLOBALS for each test. This option can also be set by running the task with --no-globals-backup.

####staticBackup Type: Boolean Default: false

Backup and restore static attributes for each test. This option can also be set by running the task with --static-backup.

####bootstrap Type: String Default: false

A "bootstrap" PHP file that is run before the tests.

####configuration Type: String Default: false

Read configuration from XML file.

####noConfiguration Type: Boolean Default: false

Ignore default configuration file (phpunit.xml). This option can also be set by running the task with --no-configuration.

####includePath Type: String Default: false

Prepend PHP's include_path with given path(s).

####d Type: Object Default: undefined

Sets a php.ini value, e.g.:

options: {
    d: {
        'error_reporting': 32767, // E_ALL
        'display_errors': '1',
        'display_startup_errors': '1'
    },
},

####followOutput Type: Boolean Default: false

Prints the output to the console immediately, instead of displaying the whole ouput at the end. This can be useful -combining with debug: true- when there are many long running tests.

####failOnFailures Type: Boolean Default: false

Phpunit will return with exit code 1 when there are failed tests and wit exit code 2 when there are errors, and grunt will abort in this cases. When you want the task finish without aborting set failOnFailures to true.

####execMaxBuffer Type: Integer Default: 200*1024

Configure the Node JS maxBuffer option passed to the exec function. This can be useful if you need to run a large test suite which outputs lot of logs, otherwise you could encounter a Fatal error: stdout maxBuffer exceeded. error. See issue #29 for more informations about this.