ILIAS  release_8 Revision v8.24
LinkTest.php
Go to the documentation of this file.
1<?php
2
3declare(strict_types=1);
4
6use PHPUnit\Framework\TestCase;
7
11class DataLinkTest extends TestCase
12{
13 private \ILIAS\Data\Factory $f;
14 private string $label;
15 private \ILIAS\Data\URI $url;
16
17 protected function setUp(): void
18 {
19 $this->f = new ILIAS\Data\Factory();
20 $this->label = 'ILIAS Homepage';
21 $this->url = $this->f->uri('https://www.ilias.de');
22 }
23
24 public function testFactory(): Link
25 {
26 $link = $this->f->link($this->label, $this->url);
27 $this->assertInstanceOf(Link::class, $link);
28 return $link;
29 }
30
34 public function testValues(Link $link): void
35 {
36 $this->assertEquals(
37 $this->label,
38 $link->getLabel()
39 );
40 $this->assertEquals(
41 $this->url,
42 $link->getUrl()
43 );
44 }
45}
Tests the Link Datatype.
Definition: LinkTest.php:12
ILIAS Data URI $url
Definition: LinkTest.php:15
testValues(Link $link)
@depends testFactory
Definition: LinkTest.php:34
string $label
Definition: LinkTest.php:14
ILIAS Data Factory $f
Definition: LinkTest.php:13
Builds data types.
Definition: Factory.php:21