ILIAS  trunk Revision v11.0_alpha-2645-g16283d3b3f8
LinkTest.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
21 use ILIAS\Data\Link;
23 
27 class 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:27
ILIAS Data URI $url
Definition: LinkTest.php:31
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
testValues(Link $link)
Definition: LinkTest.php:48
string $label
Definition: LinkTest.php:30
ILIAS Data Factory $f
Definition: LinkTest.php:29