Skip to content

Commit

Permalink
add here to the return of getAttributes
Browse files Browse the repository at this point in the history
  • Loading branch information
saeideng committed May 16, 2018
1 parent fe6d068 commit f00a4ff
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
7 changes: 4 additions & 3 deletions src/Http/ServerRequest.php
Expand Up @@ -112,7 +112,7 @@ class ServerRequest implements ArrayAccess, ServerRequestInterface
* The full address to the current request
*
* @var string
* @deprecated 3.4.0 This public property will be removed in 4.0.0. Use getUri()->getPath() instead.
* @deprecated 3.4.0 This public property will be removed in 4.0.0. Use getAttribute('here') or getUri()->getPath() instead.
*/
protected $here;

Expand Down Expand Up @@ -2150,7 +2150,7 @@ public function getAttribute($name, $default = null)
/**
* Get all the attributes in the request.
*
* This will include the params, webroot, and base attributes that CakePHP
* This will include the params, webroot, base, and here attributes that CakePHP
* provides.
*
* @return array
Expand All @@ -2160,7 +2160,8 @@ public function getAttributes()
$emulated = [
'params' => $this->params,
'webroot' => $this->webroot,
'base' => $this->base
'base' => $this->base,
'here' => $this->here
];

return $this->attributes + $emulated;
Expand Down
3 changes: 2 additions & 1 deletion tests/TestCase/Http/ServerRequestTest.php
Expand Up @@ -3630,7 +3630,8 @@ public function testGetAttributes()
'pass' => [],
],
'webroot' => '',
'base' => ''
'base' => '',
'here' => '/'
];
$this->assertEquals($expected, $new->getAttributes());
}
Expand Down

0 comments on commit f00a4ff

Please sign in to comment.