Skip to content

Commit adbfb9b

Browse files
committed
Add method Flow#isWaiting
1 parent 49c85c6 commit adbfb9b

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

src/Resource/Logbook/Flow.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ class Flow extends AbstractResource
1919
public const STATE_SUCCESS = 'success';
2020
public const STATE_REVERTED = 'reverted';
2121
public const STATE_RUNNING = 'running';
22+
public const STATE_WAITING = 'waiting';
2223

2324
protected array $dateAttributes = [
2425
'created_at',
@@ -44,4 +45,9 @@ public function isRunning(): bool
4445
{
4546
return $this->state === self::STATE_RUNNING;
4647
}
48+
49+
public function isWaiting(): bool
50+
{
51+
return $this->state === self::STATE_WAITING;
52+
}
4753
}

tests/unit/Resource/Logbook/FlowTest.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,4 +56,16 @@ public function testIsRunningReturnsFalse()
5656
$flow = new Flow(['state' => 'success']);
5757
$this->assertFalse($flow->isRunning());
5858
}
59+
60+
public function testIsWaitingReturnsTrue()
61+
{
62+
$flow = new Flow(['state' => 'waiting']);
63+
$this->assertTrue($flow->isWaiting());
64+
}
65+
66+
public function testIsWaitingReturnsFalse()
67+
{
68+
$flow = new Flow(['state' => 'running']);
69+
$this->assertFalse($flow->isWaiting());
70+
}
5971
}

0 commit comments

Comments
 (0)