Skip to content
Permalink
Browse files

Add 'here' to the emulated property set.

This makes `here` accessible as an attribute as the deprecation warnings
suggest.

Refs #12027
  • Loading branch information...
markstory committed May 1, 2018
1 parent 0cb6d51 commit a87b80b6f1a8b6a5ac9f43eac0f575a9bf9b8a07
Showing with 4 additions and 1 deletion.
  1. +1 −1 src/Http/ServerRequest.php
  2. +3 −0 tests/TestCase/Http/ServerRequestTest.php
@@ -196,7 +196,7 @@ class ServerRequest implements ArrayAccess, ServerRequestInterface
*
* @var array
*/
protected $emulatedAttributes = ['session', 'webroot', 'base', 'params'];
protected $emulatedAttributes = ['session', 'webroot', 'base', 'params', 'here'];
/**
* Array of Psr\Http\Message\UploadedFileInterface objects.
@@ -3590,13 +3590,15 @@ public function testGetAttributesCompatibility($prop)
'controller' => 'Articles',
'action' => 'index'
],
'url' => '/articles/view',
'base' => '/cakeapp',
'webroot' => '/cakeapp/'
]);
if ($prop === 'session') {
$this->assertSame($request->getSession(), $request->getAttribute($prop));
} else {
$this->assertNotEmpty($request->getAttribute($prop));
$this->assertSame($request->{$prop}, $request->getAttribute($prop));
}
});
@@ -3733,6 +3735,7 @@ public function testGetEnv()
public function emulatedPropertyProvider()
{
return [
['here'],
['params'],
['base'],
['webroot'],

0 comments on commit a87b80b

Please sign in to comment.
You can’t perform that action at this time.