<?php
namespace Test;

// \HttpMessage
use Kambo\HttpMessage\Uri;
use Kambo\HttpMessage\Factories\String\UriFactory;

/**
 * Unit test for the UriFactory object.
 *
 * @package Test
 * @author  Bohuslav Simek <bohuslav@simek.si>
 * @license MIT
 */
class UriFactoryTest extends \PHPUnit_Framework_TestCase
{
    /**
     * Test creating url from string.
     * 
     * @return void
     */
    public function testCreate()
    {
        $uri = UriFactory::create(
            'http://user:password@test.com:1111/path/123?q=abc#test'
        );

        $this->assertInstanceOf('Kambo\HttpMessage\Uri', $uri);
        $this->assertEquals('http', $uri->getScheme());
        $this->assertEquals('user:password', $uri->getUserInfo());
        $this->assertEquals('test.com', $uri->getHost());
        $this->assertEquals(1111, $uri->getPort());
        $this->assertEquals('/path/123', $uri->getPath());
        $this->assertEquals('q=abc', $uri->getQuery());
        $this->assertEquals('test', $uri->getFragment());
    }
}

<?php
namespace Test;

// \HttpMessage
use Kambo\HttpMessage\Uri;
use Kambo\HttpMessage\Factories\String\UriFactory;

/**
 * Unit test for the UriFactory object.
 *
 * @package Test
 * @author  Bohuslav Simek <bohuslav@simek.si>
 * @license MIT
 */
class UriFactoryTest extends \PHPUnit_Framework_TestCase
{
    /**
     * Test creating url from string.
     * 
     * @return void
     */
    public function testCreate()
    {
        $uri = UriFactory::create(
            'http://user:password@test.com:1111/path/123?q=abc#test'
        );

        $this->assertInstanceOf(Uri::class, $uri);
        $this->assertEquals('http', $uri->getScheme());
        $this->assertEquals('user:password', $uri->getUserInfo());
        $this->assertEquals('test.com', $uri->getHost());
        $this->assertEquals(1111, $uri->getPort());
        $this->assertEquals('/path/123', $uri->getPath());
        $this->assertEquals('q=abc', $uri->getQuery());
        $this->assertEquals('test', $uri->getFragment());
    }
}

Revert "Fix broken test in PHP 5.4"
Revert "Fix broken test in PHP 5.4"

This reverts commit 60a6a6943c76a783f0251245b8a3919d86640f6b.
