Skip to content

Commit

Permalink
formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
taylorotwell committed Oct 27, 2020
1 parent 56bf628 commit 2b98bcc
Showing 1 changed file with 20 additions and 36 deletions.
56 changes: 20 additions & 36 deletions src/Illuminate/Testing/TestResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -397,15 +397,11 @@ protected function getCookie($cookieName)
*/
public function assertSee($value, $escape = true)
{
if (is_array($value)) {
$values = $escape ? array_map('e', ($value)) : $value;
$value = Arr::wrap($value);

foreach ($values as $value) {
PHPUnit::assertStringContainsString((string) $value, $this->getContent());
}
} else {
$value = $escape ? e($value) : $value;
$values = $escape ? array_map('e', ($value)) : $value;

foreach ($values as $value) {
PHPUnit::assertStringContainsString((string) $value, $this->getContent());
}

Expand Down Expand Up @@ -437,19 +433,15 @@ public function assertSeeInOrder(array $values, $escape = true)
*/
public function assertSeeText($value, $escape = true)
{
if (is_array($value)) {
$values = $escape ? array_map('e', ($value)) : $value;
$value = Arr::wrap($value);

tap(strip_tags($this->getContent()), function ($content) use ($values) {
foreach ($values as $value) {
PHPUnit::assertStringContainsString((string) $value, $content);
}
});
} else {
$value = $escape ? e($value) : $value;
$values = $escape ? array_map('e', ($value)) : $value;

PHPUnit::assertStringContainsString((string) $value, strip_tags($this->getContent()));
}
tap(strip_tags($this->getContent()), function ($content) use ($values) {
foreach ($values as $value) {
PHPUnit::assertStringContainsString((string) $value, $content);
}
});

return $this;
}
Expand Down Expand Up @@ -479,15 +471,11 @@ public function assertSeeTextInOrder(array $values, $escape = true)
*/
public function assertDontSee($value, $escape = true)
{
if (is_array($value)) {
$values = $escape ? array_map('e', ($value)) : $value;
$value = Arr::wrap($value);

foreach ($values as $value) {
PHPUnit::assertStringNotContainsString((string) $value, $this->getContent());
}
} else {
$value = $escape ? e($value) : $value;
$values = $escape ? array_map('e', ($value)) : $value;

foreach ($values as $value) {
PHPUnit::assertStringNotContainsString((string) $value, $this->getContent());
}

Expand All @@ -503,19 +491,15 @@ public function assertDontSee($value, $escape = true)
*/
public function assertDontSeeText($value, $escape = true)
{
if (is_array($value)) {
$values = $escape ? array_map('e', ($value)) : $value;
$value = Arr::wrap($value);

tap(strip_tags($this->getContent()), function ($content) use ($values) {
foreach ($values as $value) {
PHPUnit::assertStringNotContainsString((string) $value, $content);
}
});
} else {
$value = $escape ? e($value) : $value;
$values = $escape ? array_map('e', ($value)) : $value;

PHPUnit::assertStringNotContainsString((string) $value, strip_tags($this->getContent()));
}
tap(strip_tags($this->getContent()), function ($content) use ($values) {
foreach ($values as $value) {
PHPUnit::assertStringNotContainsString((string) $value, $content);
}
});

return $this;
}
Expand Down

0 comments on commit 2b98bcc

Please sign in to comment.