19declare(strict_types=1);
23use PHPUnit\Framework\TestCase;
32use PHPUnit\Framework\MockObject\MockObject;
35use PHPUnit\Framework\MockObject\Rule\AnyInvokedCount;
42 return $this->getMockBuilder(ILegacy::class)
43 ->disableOriginalConstructor()
50 return new class ($legacy_component, $this->any()) extends
NullRenderer {
51 public ?
string $exposed_copyright_data =
null;
54 protected MockObject|
Content $legacy,
55 protected AnyInvokedCount $any
61 $this->exposed_copyright_data = $copyright->exposed_data;
62 return [$this->legacy];
67 return $copyright->exposed_data;
75 public function buildIdentifierFromEntryID(
int $entry_id):
string
77 return 'identifier_' . $entry_id;
90 return new class ($is_default, $is_outdated,
$id, $title, $description, $cp_data) extends
NullEntry {
92 protected bool $is_default,
93 protected bool $is_outdated,
95 protected string $title,
96 protected string $description,
97 protected string $cp_data
101 public function id():
int
106 public function title(): string
111 public function description(): string
113 return $this->description;
116 public function isDefault(): bool
118 return $this->is_default;
121 public function isOutdated(): bool
123 return $this->is_outdated;
126 public function copyrightData(): CopyrightDataInterface
128 return new class ($this->cp_data) extends NullCopyrightData {
129 public function __construct(
public string $exposed_data)
140 $this->getRenderer(),
141 $this->getIdentifierHandler(),
152 $this->assertTrue($copyright->isDefault());
158 $this->getRenderer(),
159 $this->getIdentifierHandler(),
170 $this->assertFalse($copyright->isDefault());
176 $this->getRenderer(),
177 $this->getIdentifierHandler(),
188 $this->assertTrue($copyright->isOutdated());
194 $this->getRenderer(),
195 $this->getIdentifierHandler(),
206 $this->assertFalse($copyright->isOutdated());
212 $this->getRenderer(),
213 $this->getIdentifierHandler(),
224 $this->assertSame(
'identifier_35', $copyright->identifier());
230 $this->getRenderer(),
231 $this->getIdentifierHandler(),
242 $this->assertSame(
'cp title', $copyright->title());
248 $this->getRenderer(),
249 $this->getIdentifierHandler(),
260 $this->assertSame(
'cp description', $copyright->description());
268 $this->getIdentifierHandler(),
283 $this->assertSame(
'data of copyright',
$renderer->exposed_copyright_data);
289 $this->getRenderer(),
290 $this->getIdentifierHandler(),
301 $this->assertSame(
'data of copyright', $copyright->presentAsString());
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
return['delivery_method'=> 'php',]
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...