Skip to content

Commit

Permalink
Add message test
Browse files Browse the repository at this point in the history
  • Loading branch information
timacdonald committed May 19, 2024
1 parent 76fa9f8 commit 428202a
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions tests/AssertionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -552,4 +552,15 @@ public function testAssertHasSharedContext(): void
'Expected shared context was not found.'
);
}

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

self::assertFailsWithMessage(
fn () => $log->assertHasSharedContext(fn ($context) => false, 'Whoops!'),
'Whoops!'
);
}
}

0 comments on commit 428202a

Please sign in to comment.