Skip to content

Commit a5ef655

Browse files
committed
Add empty state check for isWaiting
1 parent adbfb9b commit a5ef655

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

src/Resource/Logbook/Flow.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,6 @@ public function isRunning(): bool
4848

4949
public function isWaiting(): bool
5050
{
51-
return $this->state === self::STATE_WAITING;
51+
return empty($this->state) || $this->state === self::STATE_WAITING;
5252
}
5353
}

tests/unit/Resource/Logbook/FlowTest.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,12 @@ public function testIsRunningReturnsFalse()
5757
$this->assertFalse($flow->isRunning());
5858
}
5959

60+
public function testIsWaitingReturnsTrueForEmptyState()
61+
{
62+
$flow = new Flow(['state' => null]);
63+
$this->assertTrue($flow->isWaiting());
64+
}
65+
6066
public function testIsWaitingReturnsTrue()
6167
{
6268
$flow = new Flow(['state' => 'waiting']);

0 commit comments

Comments
 (0)