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

Commit 5fa4b86

Browse files
committed
Remove gulp-phpunit - closes #418
1 parent e2b2a0f commit 5fa4b86

File tree

3 files changed

+28
-22
lines changed

3 files changed

+28
-22
lines changed

Config.js

+4-12
Original file line numberDiff line numberDiff line change
@@ -373,24 +373,16 @@ var config = {
373373
| PHPUnit Autotesting
374374
|----------------------------------------------------------------
375375
|
376-
| Want to automatically trigger your PHPUnit tests. Not a prob!
377-
| This object stores the defaults for the path to your tests
378-
| folder, as well as any "gulp-phpunit" specific options.
376+
| Want to automatically trigger your PHPUnit tests. Not a problem.
377+
| This object stores your default PHPUnit directory path. For a
378+
| custom command, you may use the second arg to mix.phpUnit.
379379
|
380380
*/
381381

382382
phpUnit: {
383-
path: 'tests',
384-
385-
// https://www.npmjs.com/package/gulp-phpunit#api
386-
options: {
387-
debug: true,
388-
notify: true,
389-
configurationFile: 'phpunit.xml'
390-
}
383+
path: 'tests'
391384
},
392385

393-
394386
/*
395387
|----------------------------------------------------------------
396388
| PHPSpec Autotesting

package.json

-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@
3939
"gulp-load-plugins": "^1.0.0-rc.1",
4040
"gulp-notify": "^2.2.0",
4141
"gulp-phpspec": "^0.5.3",
42-
"gulp-phpunit": "0.11.x",
4342
"gulp-rename": "^1.2.2",
4443
"gulp-rev": "^5.1.0",
4544
"gulp-rev-replace": "^0.4.2",

tasks/phpunit.js

+24-9
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1+
var gulp = require('gulp');
12
var Elixir = require('laravel-elixir');
2-
var runTests = require('./shared/Tests');
33

44
var config = Elixir.config;
5+
var notify = new Elixir.Notification();
56

67
/*
78
|----------------------------------------------------------------
@@ -10,15 +11,29 @@ var config = Elixir.config;
1011
|
1112
| This task will trigger your entire PHPUnit test suite and it
1213
| will show notifications indicating the success or failure
13-
| of that test suite. It's works great with the tdd task.
14+
| of that test suite. It works great with your tdd task.
1415
|
1516
*/
1617

17-
Elixir.extend('phpUnit', function(src, options) {
18-
runTests({
19-
name: 'phpUnit',
20-
src: src || (config.testing.phpUnit.path + '/**/*Test.php'),
21-
plugin: Elixir.Plugins.phpunit,
22-
pluginOptions: options || config.testing.phpUnit.options
23-
});
18+
Elixir.extend('phpUnit', function(src, command) {
19+
src = src || (config.testing.phpUnit.path + '/**/*Test.php');
20+
command = command || 'vendor/bin/phpunit --verbose';
21+
22+
new Elixir.Task('phpUnit', function(error) {
23+
Elixir.Log.heading('Triggering PHPUnit: ' + command);
24+
25+
return (
26+
gulp
27+
.src('')
28+
.pipe(Elixir.Plugins.shell(command))
29+
.on('error', function(e) {
30+
notify.forFailedTests(e, 'PHPUnit');
31+
32+
this.emit('end');
33+
})
34+
.pipe(notify.forPassedTests('PHPUnit'))
35+
);
36+
})
37+
.watch(src);
2438
});
39+

0 commit comments

Comments
 (0)