Skip to content

Commit

Permalink
Rewrote test with $actual
Browse files Browse the repository at this point in the history
  • Loading branch information
devnix committed Dec 28, 2023
1 parent 04df26a commit 8c5deda
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tests/unit/Option/SomeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,14 +87,15 @@ public function testContains(): void
public function testApply(): void
{
$spy = new Ref(1);
$actual = 2;

$option = Option\some(2);
$option = Option\some($actual);
$option->apply(static function (int $value) use ($spy) {
$spy->value += $value;
});

static::assertSame(3, $spy->value);
static::assertSame(2, $option->unwrap());
static::assertSame($actual, $option->unwrap());
}

public function testMap(): void
Expand Down

0 comments on commit 8c5deda

Please sign in to comment.