Skip to content

Commit

Permalink
automatically escape value on assertion (#31196)
Browse files Browse the repository at this point in the history
  • Loading branch information
browner12 authored and taylorotwell committed Jan 22, 2020
1 parent 61c198c commit b61fb11
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion TestResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -416,10 +416,13 @@ public function assertSeeInOrder(array $values)
* Assert that the given string is contained within the response text.
*
* @param string $value
* @param bool $escaped
* @return $this
*/
public function assertSeeText($value)
public function assertSeeText($value, $escaped = true)
{
$value = $escaped ? e($value) : $value;

PHPUnit::assertStringContainsString((string) $value, strip_tags($this->getContent()));

return $this;
Expand Down

0 comments on commit b61fb11

Please sign in to comment.