Fixes #325 - Shaarli does not recognize saved links
PHP doesn't seem to autoconvert objects to strings when they're use as array indexes.
Fixes regression introduced in d9d776af19
This commit is contained in:
parent
d7efade5d6
commit
9e1724f192
3 changed files with 73 additions and 35 deletions
tests
16
tests/UrlTest.php
Normal file → Executable file
16
tests/UrlTest.php
Normal file → Executable file
|
@ -151,4 +151,20 @@ class UrlTest extends PHPUnit_Framework_TestCase
|
|||
$url->cleanup()
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test default http scheme.
|
||||
*/
|
||||
public function testDefaultScheme() {
|
||||
$url = new Url(self::$baseUrl);
|
||||
$this->assertEquals('http', $url->getScheme());
|
||||
$url = new Url('domain.tld');
|
||||
$this->assertEquals('http', $url->getScheme());
|
||||
$url = new Url('ssh://domain.tld');
|
||||
$this->assertEquals('ssh', $url->getScheme());
|
||||
$url = new Url('ftp://domain.tld');
|
||||
$this->assertEquals('ftp', $url->getScheme());
|
||||
$url = new Url('git://domain.tld/push?pull=clone#checkout');
|
||||
$this->assertEquals('git', $url->getScheme());
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue