19declare(strict_types=1);
21use PHPUnit\Framework\TestCase;
31 $writer = $this->createMock(ilXmlWriter::class);
32 $writer->expects($this->once())
33 ->method(
'xmlStartTag')
47 $writer->expects($this->exactly(3))
48 ->method(
'xmlElement')
49 ->willReturnCallback(fn($tag, $attrs,
$data) => match([$tag, $attrs,
$data]) {
50 [
'Title', [],
'title'] => 1,
51 [
'Description', [],
'description'] => 2,
52 [
'Target', [],
'target'] => 3
54 $writer->expects($this->once())
58 $param1 = $this->createMock(ilWebLinkParameter::class);
59 $param1->expects($this->once())
62 $param2 = $this->createMock(ilWebLinkParameter::class);
63 $param2->expects($this->once())
67 $item_stub =
new class (
74 new DateTimeImmutable(),
75 new DateTimeImmutable(),
78 public function getResolvedLink(
bool $with_parameters =
true):
string
83 public function isInternal():
bool
88 $item_stub->toXML($writer, 7);
Immutable class for Web Link items.
Unit tests for ilWebLinkItem.