From 981e84a026f7ee6469a9e7fc1d9732e49509e284 Mon Sep 17 00:00:00 2001 From: Tim MacDonald Date: Mon, 20 May 2024 13:57:02 +1000 Subject: [PATCH] Add additional tests --- tests/AssertionTest.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) 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.' + ); + + } }