diff --git a/tests/AssertionTest.php b/tests/AssertionTest.php index f0e8175..9981f4e 100644 --- a/tests/AssertionTest.php +++ b/tests/AssertionTest.php @@ -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.' + ); + + } }