From 53fbea17b7f2566b2d44e5c2cd887edfaebc1275 Mon Sep 17 00:00:00 2001 From: Tseho Date: Sun, 17 Sep 2017 13:04:03 +0200 Subject: [PATCH] Add tests for invoke on groups --- test/fixture/recipe/party.php | 22 ++++++++++++++++++++++ test/recipe/PartyTest.php | 7 +++++++ 2 files changed, 29 insertions(+) diff --git a/test/fixture/recipe/party.php b/test/fixture/recipe/party.php index b1cd5600..1b960c0e 100644 --- a/test/fixture/recipe/party.php +++ b/test/fixture/recipe/party.php @@ -45,6 +45,28 @@ task('test_invoke:subtask2', function () { }); +/* + * Invoke group test + */ + +task('test_invoke_group', function () { + invoke('test_invoke_group:group'); +}); + +task('test_invoke_group:group', [ + 'test_invoke_group:subtask1', + 'test_invoke_group:subtask2', +]); + +task('test_invoke_group:subtask1', function () { + writeln('first'); +}); + +task('test_invoke_group:subtask2', function () { + writeln('second'); +}); + + /* * Function "on" test */ diff --git a/test/recipe/PartyTest.php b/test/recipe/PartyTest.php index 00506caf..db616173 100644 --- a/test/recipe/PartyTest.php +++ b/test/recipe/PartyTest.php @@ -33,6 +33,13 @@ class PartyTest extends DepCase self::assertContains('second', $output); } + public function testInvokeGroup() + { + $output = $this->start('test_invoke_group'); + self::assertContains('first', $output); + self::assertContains('second', $output); + } + public function testOn() { $output = $this->start('test_on');