ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
LinkTest.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22use PHPUnit\Framework\TestCase;
23
27class DataLinkTest extends TestCase
28{
29 private \ILIAS\Data\Factory $f;
30 private string $label;
31 private \ILIAS\Data\URI $url;
32
33 protected function setUp(): void
34 {
35 $this->f = new ILIAS\Data\Factory();
36 $this->label = 'ILIAS Homepage';
37 $this->url = $this->f->uri('https://www.ilias.de');
38 }
39
40 public function testFactory(): Link
41 {
42 $link = $this->f->link($this->label, $this->url);
43 $this->assertInstanceOf(Link::class, $link);
44 return $link;
45 }
46
47 #[\PHPUnit\Framework\Attributes\Depends('testFactory')]
48 public function testValues(Link $link): void
49 {
50 $this->assertEquals(
51 $this->label,
52 $link->getLabel()
53 );
54 $this->assertEquals(
55 $this->url,
56 $link->getUrl()
57 );
58 }
59}
Tests the Link Datatype.
Definition: LinkTest.php:28
ILIAS Data URI $url
Definition: LinkTest.php:31
testValues(Link $link)
Definition: LinkTest.php:48
string $label
Definition: LinkTest.php:30
ILIAS Data Factory $f
Definition: LinkTest.php:29
Builds data types.
Definition: Factory.php:36