From 932ae4ebc09c8494d9f46886745eec18036c1e53 Mon Sep 17 00:00:00 2001 From: Alan Hurtarte Date: Thu, 7 Nov 2024 12:28:36 -0500 Subject: [PATCH] Update MakesAssertions.php Add optional parameter to MakesAssertions/assertDontSeeIn $ignoreCase --- src/Concerns/MakesAssertions.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/Concerns/MakesAssertions.php b/src/Concerns/MakesAssertions.php index 79598770d..9d348586d 100644 --- a/src/Concerns/MakesAssertions.php +++ b/src/Concerns/MakesAssertions.php @@ -157,11 +157,12 @@ public function assertSee($text, $ignoreCase = false) * Assert that the given text is not present on the page. * * @param string $text + * @param bool $ignoreCase * @return $this */ - public function assertDontSee($text) + public function assertDontSee($text, $ignoreCase = false) { - return $this->assertDontSeeIn('', $text); + return $this->assertDontSeeIn('', $text, $ignoreCase); } /** @@ -191,16 +192,17 @@ public function assertSeeIn($selector, $text, $ignoreCase = false) * * @param string $selector * @param string $text + * @param bool $ignoreCase * @return $this */ - public function assertDontSeeIn($selector, $text) + public function assertDontSeeIn($selector, $text, $ignoreCase = false) { $fullSelector = $this->resolver->format($selector); $element = $this->resolver->findOrFail($selector); PHPUnit::assertFalse( - Str::contains($element->getText(), $text), + Str::contains($element->getText(), $text, $ignoreCase), "Saw unexpected text [{$text}] within element [{$fullSelector}]." );