Skip to content
This repository has been archived by the owner on Mar 31, 2020. It is now read-only.

Commit

Permalink
Remove gulp-phpunit - closes #418
Browse files Browse the repository at this point in the history
  • Loading branch information
JeffreyWay committed Feb 7, 2016
1 parent e2b2a0f commit 5fa4b86
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 22 deletions.
16 changes: 4 additions & 12 deletions Config.js
Original file line number Diff line number Diff line change
Expand Up @@ -373,24 +373,16 @@ var config = {
| PHPUnit Autotesting
|----------------------------------------------------------------
|
| Want to automatically trigger your PHPUnit tests. Not a prob!
| This object stores the defaults for the path to your tests
| folder, as well as any "gulp-phpunit" specific options.
| Want to automatically trigger your PHPUnit tests. Not a problem.
| This object stores your default PHPUnit directory path. For a
| custom command, you may use the second arg to mix.phpUnit.
|
*/

phpUnit: {
path: 'tests',

// https://www.npmjs.com/package/gulp-phpunit#api
options: {
debug: true,
notify: true,
configurationFile: 'phpunit.xml'
}
path: 'tests'
},


/*
|----------------------------------------------------------------
| PHPSpec Autotesting
Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
"gulp-load-plugins": "^1.0.0-rc.1",
"gulp-notify": "^2.2.0",
"gulp-phpspec": "^0.5.3",
"gulp-phpunit": "0.11.x",
"gulp-rename": "^1.2.2",
"gulp-rev": "^5.1.0",
"gulp-rev-replace": "^0.4.2",
Expand Down
33 changes: 24 additions & 9 deletions tasks/phpunit.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
var gulp = require('gulp');
var Elixir = require('laravel-elixir');
var runTests = require('./shared/Tests');

var config = Elixir.config;
var notify = new Elixir.Notification();

/*
|----------------------------------------------------------------
Expand All @@ -10,15 +11,29 @@ var config = Elixir.config;
|
| This task will trigger your entire PHPUnit test suite and it
| will show notifications indicating the success or failure
| of that test suite. It's works great with the tdd task.
| of that test suite. It works great with your tdd task.
|
*/

Elixir.extend('phpUnit', function(src, options) {
runTests({
name: 'phpUnit',
src: src || (config.testing.phpUnit.path + '/**/*Test.php'),
plugin: Elixir.Plugins.phpunit,
pluginOptions: options || config.testing.phpUnit.options
});
Elixir.extend('phpUnit', function(src, command) {
src = src || (config.testing.phpUnit.path + '/**/*Test.php');
command = command || 'vendor/bin/phpunit --verbose';

new Elixir.Task('phpUnit', function(error) {
Elixir.Log.heading('Triggering PHPUnit: ' + command);

return (
gulp
.src('')
.pipe(Elixir.Plugins.shell(command))
.on('error', function(e) {
notify.forFailedTests(e, 'PHPUnit');

this.emit('end');
})
.pipe(notify.forPassedTests('PHPUnit'))
);
})
.watch(src);
});

0 comments on commit 5fa4b86

Please sign in to comment.