Skip to content

Instantly share code, notes, and snippets.

@raultm
Created May 15, 2014 15:13
Show Gist options
  • Save raultm/f6db3a0c3a148405874f to your computer and use it in GitHub Desktop.
Save raultm/f6db3a0c3a148405874f to your computer and use it in GitHub Desktop.
Autotesting with CakePHP and Gulp
<?php
namespace App\Test\TestCase\Custom;
use Cake\TestSuite\TestCase;
class DemoTest extends TestCase {
public function testDemo(){
$this->assertEquals(1, 1);
}
}
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');
});
});
{
"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