diff --git a/README.md b/README.md index da9d8dc..ae9d79b 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,7 @@ -# grunt-phpunit +# grunt-phpunit-D+ > Grunt plugin for running phpunit. +It's a fork of [grunt-phpunit](https://github.com/SaschaGalley/grunt-phpunit) with enhanced possibilities for the 'd' options. ##Getting Started @@ -11,7 +12,7 @@ If you haven't used [Grunt](http://gruntjs.com/) before, be sure to check out th 1. Install this grunt plugin with the following command: ```shell - npm install grunt-phpunit --save-dev + npm install grunt-phpunit-dplus --save-dev ``` @@ -239,9 +240,18 @@ Type: `String` Default: `false` Prepend PHP's include_path with given path(s). ####d -Type: `String` Default: `false` +Type: `Object` Default: `undefined` -Sets a php.ini value. +Sets a php.ini value, e.g.: +```js +options: { + d: { + 'error_reporting': 32767, // E_ALL + 'display_errors': '1', + 'display_startup_errors': '1' + }, +}, +``` ####followOutput Type: `Boolean` Default: `false` @@ -258,7 +268,7 @@ 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`](http://nodejs.org/api/child_process.html#child_process_child_process_exec_command_options_callback) function. -This can be useful if you need to run a large test suite which outputs lot of logs, otherwise you could encounter a +Configure the Node JS `maxBuffer` option passed to the +[`exec`](http://nodejs.org/api/child_process.html#child_process_child_process_exec_command_options_callback) 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](https://github.com/SaschaGalley/grunt-phpunit/issues/29) for more informations about this. diff --git a/package.json b/package.json index fcb8949..b3d256f 100644 --- a/package.json +++ b/package.json @@ -1,22 +1,12 @@ { - "name": "grunt-phpunit", + "name": "grunt-phpunit-dplus", "description": "Grunt plugin for running phpunit.", - "homepage": "https://github.com/SaschaGalley/grunt-phpunit", - "author": { - "name": "Sascha Galley", - "email": "me@xash.at", - "url": "http://xash.at/" - }, + "author": "Michael Büttner ", "repository": { "type": "git", - "url": "git://github.com/SaschaGalley/grunt-phpunit.git" + "url": "git://github.com/michbuett/grunt-phpunit.git" }, - "version": "0.3.6", - "contributors": [{ - "name": "James Cryer", - "email": "chat@jamescryer.com", - "url": "http://www.jamescryer.com/" - }], + "version": "0.4.0", "main": "Gruntfile.js", "engines": { "node": "0.10.x" diff --git a/tasks/lib/builder.js b/tasks/lib/builder.js index 7059a4d..a9d1ddf 100644 --- a/tasks/lib/builder.js +++ b/tasks/lib/builder.js @@ -58,13 +58,12 @@ exports.init = function(grunt) { staticBackup: false, noConfiguration: false, includePath: false, - d: false, testsuite: false, testSuffix: false, followOutput: false, failOnFailures: false, - - // See NodeJS exec options + + // See NodeJS exec options // http://nodejs.org/api/child_process.html#child_process_child_process_exec_command_options_callback execMaxBuffer: 200*1024 @@ -122,7 +121,6 @@ exports.init = function(grunt) { printer: 'printer', repeat: 'repeat', includePath: 'include-path', - d: 'd', testsuite: 'testsuite', testSuffix: 'test-suffix' }; @@ -186,6 +184,21 @@ exports.init = function(grunt) { return options; }; + /** + * Builds options for the php.ini settings + * + * @return array + */ + var buildDOptions = function() { + + var options = []; + + _.each(config.d, function(value, key) { + options.push('-d '+key+'='+value); + }); + return options; + }; + /** * Builds phpunit command * @@ -196,7 +209,8 @@ exports.init = function(grunt) { var options = [].concat( buildFlagOptions(), buildFileOptions(), - buildValuedOptions() + buildValuedOptions(), + buildDOptions() ); return options.join(' '); };