Skip to content

test: remove $request->uri and fix incorrect assertions#6682

Merged
kenjis merged 2 commits intocodeigniter4:developfrom
kenjis:test-remove-request-uri
Oct 15, 2022
Merged

test: remove $request->uri and fix incorrect assertions#6682
kenjis merged 2 commits intocodeigniter4:developfrom
kenjis:test-remove-request-uri

Conversation

@kenjis
Copy link
Copy Markdown
Member

@kenjis kenjis commented Oct 14, 2022

Description
See #5344

  • IncomingRequest::$uri will be protected.
  • $request->getUri()->getPath() does not start with /. IncomingRequest::$uri is a bit different from a normal URI object.
    * The URI for this request.
    *
    * Note: This WILL NOT match the actual URL in the browser since for
    * everything this cares about (and the router, etc) is the portion
    * AFTER the script name. So, if hosted in a sub-folder this will
    * appear different than actual URL. If you need that use getPath().
    *
    * @TODO should be protected. Use getUri() instead.
    *
    * @var URI
    */
    public $uri;

Checklist:

  • Securely signed commits
  • [] Component(s) with PHPDoc blocks, only if necessary or adds value
  • [] Unit testing, with >80% coverage
  • [] User guide updated
  • Conforms to style guide

The test is when BaseURL does not have `index.php`, so $config->indexPage
should be empty string.
@kenjis kenjis added the testing Pull requests that changes tests only label Oct 14, 2022
Comment thread tests/system/HTTP/URITest.php
@kenjis kenjis merged commit 553ab0f into codeigniter4:develop Oct 15, 2022
@kenjis kenjis deleted the test-remove-request-uri branch October 15, 2022 10:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

testing Pull requests that changes tests only

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants