Skip to content

Commit

Permalink
Add additional tests
Browse files Browse the repository at this point in the history
  • Loading branch information
timacdonald committed May 20, 2024
1 parent 6d3ce08 commit 981e84a
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions tests/AssertionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -563,4 +563,17 @@ public function testItCanProvideCustomMessageWithAssertHasSharedContext(): void
'Whoops!'
);
}

public function testItCanPassContextArrayDirectlyToAssertHasSharedContext(): void
{
$log = new LogFake();
$log->shareContext(['shared' => 'context']);

$log->assertHasSharedContext(['shared' => 'context']);
self::assertFailsWithMessage(
fn () => $log->assertHasSharedContext([]),
'Expected shared context was not found.'
);

}
}

0 comments on commit 981e84a

Please sign in to comment.