public function testNewTldExtendedShatter() { $url = Spurl\Url::shatter('http://www.test.versicherung/example', true); $this->assertArrayHasKey('prefix', $url['host']); $this->assertEquals($url['host']['prefix'], 'www'); $this->assertArrayHasKey('domain', $url['host']); $this->assertEquals($url['host']['domain'], 'test'); $this->assertArrayHasKey('suffix', $url['host']); $this->assertEquals($url['host']['suffix'], 'versicherung'); }
public function testUrlBuildStrings() { $url = ['protocol' => 'https', 'host' => 'test.domain.spurl.co.uk', 'path' => 'test/path/to/be/joined']; $result = Spurl\Url::build($url); $this->assertEquals($result, 'https://test.domain.spurl.co.uk/test/path/to/be/joined/'); }