Skip to content

Commit e9f751e

Browse files
committed
expose state values
1 parent 1ca5f88 commit e9f751e

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

src/State.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,11 @@ public function getId(): string
7272
return $this->id;
7373
}
7474

75+
public function getValues(): array
76+
{
77+
return $this->values;
78+
}
79+
7580
/**
7681
* Mark the saga as done.
7782
*/

test/StateTest.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,20 @@ public function it_exposes_its_id()
7979
$this->assertEquals(42, $this->state->getId());
8080
}
8181

82+
/**
83+
* @test
84+
*/
85+
public function it_exposes_its_values()
86+
{
87+
$state = new State('42');
88+
$state->set('foo', 'bar');
89+
$state->set('bar', 'baz');
90+
$this->assertEquals([
91+
'foo' => 'bar',
92+
'bar' => 'baz',
93+
], $state->getValues());
94+
}
95+
8296
/**
8397
* @test
8498
*/

0 commit comments

Comments
 (0)