mirror of
https://github.com/deployphp/deployer.git
synced 2025-02-23 00:32:25 +01:00
Test after/before task in group tasks 🪲
This commit is contained in:
parent
3194750708
commit
25c78b5b1a
@ -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');
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user