Skip to content

Commit

Permalink
expose state values
Browse files Browse the repository at this point in the history
  • Loading branch information
othillo committed Apr 28, 2020
1 parent 1ca5f88 commit e9f751e
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/State.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,11 @@ public function getId(): string
return $this->id;
}

public function getValues(): array
{
return $this->values;
}

/**
* Mark the saga as done.
*/
Expand Down
14 changes: 14 additions & 0 deletions test/StateTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,20 @@ public function it_exposes_its_id()
$this->assertEquals(42, $this->state->getId());
}

/**
* @test
*/
public function it_exposes_its_values()
{
$state = new State('42');
$state->set('foo', 'bar');
$state->set('bar', 'baz');
$this->assertEquals([
'foo' => 'bar',
'bar' => 'baz',
], $state->getValues());
}

/**
* @test
*/
Expand Down

0 comments on commit e9f751e

Please sign in to comment.