GithubHelp home page GithubHelp logo

gomoob / grunt-phpunit Goto Github PK

View Code? Open in Web Editor NEW

This project forked from saschagalley/grunt-phpunit

0.0 2.0 0.0 172 KB

Grunt plugin for running phpunit.

License: MIT License

JavaScript 84.79% PHP 15.21%

grunt-phpunit's Introduction

grunt-phpunit

Grunt plugin for running phpunit.

##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 --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.

####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.

####testdox Type: Boolean Default: false

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

####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: String Default: false

Sets a php.ini value.

####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.

grunt-phpunit's People

Contributors

anahkiasen avatar bgaillard avatar ishikawam avatar joakimbeng avatar saschagalley avatar tomzx avatar voidcontext avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.