Skip to content

Bug: IncomingRequest does not respect constructor param URI #7643

Description

@kenjis

The following test fails on develop and 4.4.

Failed asserting that two strings are identical.
Expected :'http://example.com/foo/bar'
Actual   :'http://example.com'
<?php

namespace CodeIgniter;

use CodeIgniter\HTTP\IncomingRequest;
use CodeIgniter\HTTP\URI;
use CodeIgniter\HTTP\UserAgent;
use CodeIgniter\Test\CIUnitTestCase;
use Config\App;

final class TestTest extends CIUnitTestCase
{
    public function test()
    {
        $appConfig = new App();
        $request   = new IncomingRequest(
            $appConfig,
            new URI($appConfig->baseURL . 'foo/bar'),
            null,
            new UserAgent()
        );

        $this->assertSame(
            'http://example.com/foo/bar',
            (string) $request->getUri()
        );
    }
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugVerified issues on the current code behavior or pull requests that will fix them

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions