Exemple #1
0
 function testToString()
 {
     $u = new URL('one', 'two', array('hello' => 'john'));
     $this->assertEquals('/one/two/hello:john/', $u->toString(), 'Построение адреса');
     $this->assertEquals($u->toString(), (string) $u, 'Приведение объекта к строке');
     $this->assertEquals('<a class="hello" href="/one/two/hello:john/" target="_blank">hi</a>', $u->toHTML('hi', 'hello', '_blank'), 'HTML ссылка');
 }
Exemple #2
0
 function testConstructor()
 {
     $u1 = new URL('one', 'two', 'three');
     $u2 = new URL();
     $u2->load('one', 'two', 'three');
     $this->assertEquals($u2->toString(), $u1->toString(), 'Конструктор и Load');
 }