ILIAS  trunk Revision v11.0_alpha-1731-gff9cd7e2bd3
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
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 
50  public function testValues(Link $link): void
51  {
52  $this->assertEquals(
53  $this->label,
54  $link->getLabel()
55  );
56  $this->assertEquals(
57  $this->url,
58  $link->getUrl()
59  );
60  }
61 }
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)
testFactory
Definition: LinkTest.php:50
string $label
Definition: LinkTest.php:30
ILIAS Data Factory $f
Definition: LinkTest.php:29