Test after/before task in group tasks 🪲

This commit is contained in:
Elfet 2014-07-06 22:26:52 +04:00
parent 3194750708
commit 25c78b5b1a

View File

@ -32,5 +32,33 @@ class GroupTaskTest extends DeployerTester
$this->runCommand('group');
}
public function testAfter()
{
$mock = $this->getMock('stdClass', ['callback']);
$mock->expects($this->exactly(2))
->method('callback')
->will($this->returnValue(true));
task('task1', function () {
});
task('task2', function () {
});
task('group', ['task1', 'task2']);
after('task1', function () use($mock) {
$mock->callback();
});
task('after', function () use($mock) {
$mock->callback();
});
after('task1', 'after');
$this->runCommand('group');
}
}