Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions src/Concerns/MakesAssertions.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

/**
Expand Down Expand Up @@ -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}]."
);

Expand Down