Skip to content

Commit c667db6

Browse files
authored
Update MakesAssertions.php (#1149)
Add optional parameter to MakesAssertions/assertDontSeeIn $ignoreCase
1 parent 2f09011 commit c667db6

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/Concerns/MakesAssertions.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -157,11 +157,12 @@ public function assertSee($text, $ignoreCase = false)
157157
* Assert that the given text is not present on the page.
158158
*
159159
* @param string $text
160+
* @param bool $ignoreCase
160161
* @return $this
161162
*/
162-
public function assertDontSee($text)
163+
public function assertDontSee($text, $ignoreCase = false)
163164
{
164-
return $this->assertDontSeeIn('', $text);
165+
return $this->assertDontSeeIn('', $text, $ignoreCase);
165166
}
166167

167168
/**
@@ -191,16 +192,17 @@ public function assertSeeIn($selector, $text, $ignoreCase = false)
191192
*
192193
* @param string $selector
193194
* @param string $text
195+
* @param bool $ignoreCase
194196
* @return $this
195197
*/
196-
public function assertDontSeeIn($selector, $text)
198+
public function assertDontSeeIn($selector, $text, $ignoreCase = false)
197199
{
198200
$fullSelector = $this->resolver->format($selector);
199201

200202
$element = $this->resolver->findOrFail($selector);
201203

202204
PHPUnit::assertFalse(
203-
Str::contains($element->getText(), $text),
205+
Str::contains($element->getText(), $text, $ignoreCase),
204206
"Saw unexpected text [{$text}] within element [{$fullSelector}]."
205207
);
206208

0 commit comments

Comments
 (0)