Skip to content
This repository was archived by the owner on Apr 3, 2026. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 17 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -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

Expand All @@ -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
```


Expand Down Expand Up @@ -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`
Expand All @@ -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.
18 changes: 4 additions & 14 deletions package.json
Original file line number Diff line number Diff line change
@@ -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 <michbuett@gmx.de>",
"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"
Expand Down
24 changes: 19 additions & 5 deletions tasks/lib/builder.js
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -122,7 +121,6 @@ exports.init = function(grunt) {
printer: 'printer',
repeat: 'repeat',
includePath: 'include-path',
d: 'd',
testsuite: 'testsuite',
testSuffix: 'test-suffix'
};
Expand Down Expand Up @@ -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
*
Expand All @@ -196,7 +209,8 @@ exports.init = function(grunt) {
var options = [].concat(
buildFlagOptions(),
buildFileOptions(),
buildValuedOptions()
buildValuedOptions(),
buildDOptions()
);
return options.join(' ');
};
Expand Down