Created
May 15, 2014 15:13
-
-
Save raultm/f6db3a0c3a148405874f to your computer and use it in GitHub Desktop.
Autotesting with CakePHP and Gulp
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Test\TestCase\Custom; | |
use Cake\TestSuite\TestCase; | |
class DemoTest extends TestCase { | |
public function testDemo(){ | |
$this->assertEquals(1, 1); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var gulp = require('gulp'); | |
var shell = require('gulp-shell'); | |
var notify = require('gulp-notify'); | |
gulp.task("testing", function(){ | |
return gulp.src('') | |
.pipe(shell([ | |
'phpunit', | |
])) | |
.on('error', notify.onError({ | |
title: "Alarm Alarm! Tests failing", | |
message: "<%= error.message %>" | |
})) | |
.pipe(notify({ | |
title: "Go go go!", | |
message: 'Everything is alright, go forward bastard!' | |
}) | |
); | |
}); | |
gulp.task('default', function(){ | |
gulp.watch(['Test/TestCase/**/*.php', 'App/Model/**/*.php'], function(){ | |
gulp.run('testing'); | |
}); | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"devDependencies": { | |
"gulp": "^3.6.2", | |
"gulp-notify": "^1.2.5", | |
"gulp-shell": "^0.2.5" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment