ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ConditionalGotoLinkTest.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
23use ILIAS\LegalDocuments\test\ContainerMock;
26use PHPUnit\Framework\TestCase;
27
28require_once __DIR__ . '/../ContainerMock.php';
29
30class ConditionalGotoLinkTest extends TestCase
31{
32 use ContainerMock;
33
34 public function testConstruct(): void
35 {
36 $this->assertInstanceOf(ConditionalGotoLink::class, new ConditionalGotoLink(
37 'foo',
38 $this->fail(...)
39 ));
40 }
41
42 public function testName(): void
43 {
44 $instance = new ConditionalGotoLink(
45 'foo',
46 $this->fail(...)
47 );
48
49 $this->assertSame('foo', $instance->name());
50 }
51
52 public function testTarget(): void
53 {
54 $target = $this->mock(Target::class);
55
56 $instance = new ConditionalGotoLink(
57 'foo',
58 fn() => $target
59 );
60
61 $this->assertSame($target, $instance->target());
62 }
63}