Skip to content

Commit

Permalink
[10.x] Address Null Parameter Deprecations in UrlGenerator (#51148)
Browse files Browse the repository at this point in the history
* Replace null values with empty strings for strpos.
Replace null values with empty strings for preg_match.

* Revert change to UrlGenerator.
Change default header get to empty string.
  • Loading branch information
aldobarr authored Apr 22, 2024
1 parent 877ebca commit 25e285e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Illuminate/Testing/TestResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ public function assertHeaderMissing($headerName)
public function assertLocation($uri)
{
PHPUnit::assertEquals(
app('url')->to($uri), app('url')->to($this->headers->get('Location'))
app('url')->to($uri), app('url')->to($this->headers->get('Location', ''))
);

return $this;
Expand All @@ -324,7 +324,7 @@ public function assertLocation($uri)
*/
public function assertDownload($filename = null)
{
$contentDisposition = explode(';', $this->headers->get('content-disposition'));
$contentDisposition = explode(';', $this->headers->get('content-disposition', ''));

if (trim($contentDisposition[0]) !== 'attachment') {
PHPUnit::fail(
Expand Down

0 comments on commit 25e285e

Please sign in to comment.