test: refactor: $request->uri → $request->getUri()

This commit is contained in:
kenjis 2022-01-15 09:39:43 +09:00
parent f95a8f5fbd
commit 015b302cc9
No known key found for this signature in database
GPG Key ID: BD254878922AF198
4 changed files with 3 additions and 8 deletions

View File

@ -940,11 +940,6 @@ parameters:
count: 1
path: system/Test/Fabricator.php
-
message: "#^Access to protected property CodeIgniter\\\\HTTP\\\\Request\\:\\:\\$uri\\.$#"
count: 1
path: system/Test/FeatureTestCase.php
-
message: "#^Property CodeIgniter\\\\Test\\\\CIUnitTestCase\\:\\:\\$bodyFormat \\(string\\) in isset\\(\\) is not nullable\\.$#"
count: 1

View File

@ -349,7 +349,7 @@ class FeatureTestCase extends CIUnitTestCase
// otherwise set it from the URL.
$get = ! empty($params) && $method === 'get'
? $params
: $this->getPrivateProperty($request->uri, 'query');
: $this->getPrivateProperty($request->getUri(), 'query');
$request->setGlobal('get', $get);
if ($method !== 'get') {

View File

@ -344,7 +344,7 @@ trait FeatureTestTrait
// otherwise set it from the URL.
$get = ! empty($params) && $method === 'get'
? $params
: $this->getPrivateProperty($request->uri, 'query');
: $this->getPrivateProperty($request->getUri(), 'query');
$request->setGlobal('get', $get);
if ($method !== 'get') {

View File

@ -875,7 +875,7 @@ final class URITest extends CIUnitTestCase
Services::injectMock('request', $request);
// going through request
$this->assertSame('http://example.com/ci/v4/controller/method', (string) $request->uri);
$this->assertSame('http://example.com/ci/v4/controller/method', (string) $request->getUri());
$this->assertSame('/ci/v4/controller/method', $request->getUri()->getPath());
// standalone