Skip to content

Commit

Permalink
renaming methods
Browse files Browse the repository at this point in the history
  • Loading branch information
taylorotwell committed Dec 15, 2020
1 parent 0ed6359 commit dc683ee
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
16 changes: 8 additions & 8 deletions src/Concerns/MakesAssertions.php
Original file line number Diff line number Diff line change
Expand Up @@ -206,40 +206,40 @@ public function assertDontSeeIn($selector, $text)
}

/**
* Assert that the given selector has no text.
* Assert that the given selector has some text.
*
* @param string $selector
* @return $this
*/
public function assertSeeEmptyTextIn($selector)
public function assertSeeAnythingIn($selector)
{
$fullSelector = $this->resolver->format($selector);

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

PHPUnit::assertTrue(
$element->getText() === '',
"Did not see expected text [''] within element [{$fullSelector}]."
$element->getText() !== '',
"Saw unexpected text [''] within element [{$fullSelector}]."
);

return $this;
}

/**
* Assert that the given selector has some text.
* Assert that the given selector has no text.
*
* @param string $selector
* @return $this
*/
public function assertDontSeeEmptyTextIn($selector)
public function assertSeeNothingIn($selector)
{
$fullSelector = $this->resolver->format($selector);

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

PHPUnit::assertTrue(
$element->getText() !== '',
"Saw unexpected text [''] within element [{$fullSelector}]."
$element->getText() === '',
"Did not see expected text [''] within element [{$fullSelector}]."
);

return $this;
Expand Down
8 changes: 4 additions & 4 deletions tests/MakesAssertionsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -1131,7 +1131,7 @@ public function test_assert_see_empty_text_in_element_with_empty_text()

$browser = new Browser($driver, $resolver);

$browser->assertSeeEmptyTextIn('foo');
$browser->assertSeeNothingIn('foo');
}

public function test_assert_see_empty_text_in_element_without_empty_text()
Expand All @@ -1148,7 +1148,7 @@ public function test_assert_see_empty_text_in_element_without_empty_text()
$browser = new Browser($driver, $resolver);

try {
$browser->assertSeeEmptyTextIn('foo');
$browser->assertSeeNothingIn('foo');
} catch (ExpectationFailedException $e) {
$this->assertStringContainsString(
'Did not see expected text [\'\'] within element [body foo].',
Expand All @@ -1171,7 +1171,7 @@ public function test_assert_dont_see_empty_text_in_element_with_empty_text()
$browser = new Browser($driver, $resolver);

try {
$browser->assertDontSeeEmptyTextIn('foo');
$browser->assertSeeAnythingIn('foo');
} catch (ExpectationFailedException $e) {
$this->assertStringContainsString(
'Saw unexpected text [\'\'] within element [body foo].',
Expand All @@ -1193,7 +1193,7 @@ public function test_assert_dont_see_empty_text_in_element_without_empty_text()

$browser = new Browser($driver, $resolver);

$browser->assertDontSeeEmptyTextIn('foo');
$browser->assertSeeAnythingIn('foo');
}

public function test_assert_source_has()
Expand Down

0 comments on commit dc683ee

Please sign in to comment.