ILIAS  trunk Revision v11.0_alpha-2645-g16283d3b3f8
ILIAS\MetaData\Services\CopyrightHelper\CopyrightTest Class Reference
+ Inheritance diagram for ILIAS\MetaData\Services\CopyrightHelper\CopyrightTest:
+ Collaboration diagram for ILIAS\MetaData\Services\CopyrightHelper\CopyrightTest:

Public Member Functions

 testIsDefaultTrue ()
 
 testIsDefaultFalse ()
 
 testIsOutdatedTrue ()
 
 testIsOutdatedFalse ()
 
 testIdentifier ()
 
 testTitle ()
 
 testDescription ()
 
 testPresentAsUIComponents ()
 
 testPresentAsString ()
 

Protected Member Functions

 getLegacyComponent ()
 
 getRenderer ()
 
 getIdentifierHandler ()
 
 getEntry (bool $is_default, bool $is_outdated, int $id, string $title, string $description, string $cp_data)
 

Detailed Description

Definition at line 38 of file CopyrightTest.php.

Member Function Documentation

◆ getEntry()

ILIAS\MetaData\Services\CopyrightHelper\CopyrightTest::getEntry ( bool  $is_default,
bool  $is_outdated,
int  $id,
string  $title,
string  $description,
string  $cp_data 
)
protected

Definition at line 82 of file CopyrightTest.php.

References $id, ILIAS\MetaData\Services\CopyrightHelper\CopyrightHelper\__construct(), and ILIAS\GlobalScreen\Provider\id().

Referenced by ILIAS\MetaData\Services\CopyrightHelper\CopyrightTest\testDescription(), ILIAS\MetaData\Services\CopyrightHelper\CopyrightTest\testIdentifier(), ILIAS\MetaData\Services\CopyrightHelper\CopyrightTest\testIsDefaultFalse(), ILIAS\MetaData\Services\CopyrightHelper\CopyrightTest\testIsDefaultTrue(), ILIAS\MetaData\Services\CopyrightHelper\CopyrightTest\testIsOutdatedFalse(), ILIAS\MetaData\Services\CopyrightHelper\CopyrightTest\testIsOutdatedTrue(), ILIAS\MetaData\Services\CopyrightHelper\CopyrightTest\testPresentAsString(), ILIAS\MetaData\Services\CopyrightHelper\CopyrightTest\testPresentAsUIComponents(), and ILIAS\MetaData\Services\CopyrightHelper\CopyrightTest\testTitle().

89  : EntryInterface {
90  return new class ($is_default, $is_outdated, $id, $title, $description, $cp_data) extends NullEntry {
91  public function __construct(
92  protected bool $is_default,
93  protected bool $is_outdated,
94  protected int $id,
95  protected string $title,
96  protected string $description,
97  protected string $cp_data
98  ) {
99  }
100 
101  public function id(): int
102  {
103  return $this->id;
104  }
105 
106  public function title(): string
107  {
108  return $this->title;
109  }
110 
111  public function description(): string
112  {
113  return $this->description;
114  }
115 
116  public function isDefault(): bool
117  {
118  return $this->is_default;
119  }
120 
121  public function isOutdated(): bool
122  {
123  return $this->is_outdated;
124  }
125 
126  public function copyrightData(): CopyrightDataInterface
127  {
128  return new class ($this->cp_data) extends NullCopyrightData {
129  public function __construct(public string $exposed_data)
130  {
131  }
132  };
133  }
134  };
135  }
__construct(SettingsInterface $settings, PathFactory $path_factory, CopyrightRepository $copyright_repo, IdentifierHandler $identifier_handler, RendererInterface $renderer, SearchClauseFactory $search_clause_factory)
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getIdentifierHandler()

◆ getLegacyComponent()

ILIAS\MetaData\Services\CopyrightHelper\CopyrightTest::getLegacyComponent ( )
protected

Definition at line 40 of file CopyrightTest.php.

Referenced by ILIAS\MetaData\Services\CopyrightHelper\CopyrightTest\getRenderer().

40  : MockObject|Content
41  {
42  return $this->getMockBuilder(ILegacy::class)
43  ->disableOriginalConstructor()
44  ->getMock();
45  }
+ Here is the caller graph for this function:

◆ getRenderer()

ILIAS\MetaData\Services\CopyrightHelper\CopyrightTest::getRenderer ( )
protected

Definition at line 47 of file CopyrightTest.php.

References ILIAS\MetaData\Services\CopyrightHelper\CopyrightHelper\__construct(), ILIAS\MetaData\Services\CopyrightHelper\CopyrightTest\getLegacyComponent(), null, and ILIAS\Export\ImportHandler\File\XML\Manifest\toString.

Referenced by ILIAS\MetaData\Services\CopyrightHelper\CopyrightTest\testDescription(), ILIAS\MetaData\Services\CopyrightHelper\CopyrightTest\testIdentifier(), ILIAS\MetaData\Services\CopyrightHelper\CopyrightTest\testIsDefaultFalse(), ILIAS\MetaData\Services\CopyrightHelper\CopyrightTest\testIsDefaultTrue(), ILIAS\MetaData\Services\CopyrightHelper\CopyrightTest\testIsOutdatedFalse(), ILIAS\MetaData\Services\CopyrightHelper\CopyrightTest\testIsOutdatedTrue(), ILIAS\MetaData\Services\CopyrightHelper\CopyrightTest\testPresentAsString(), ILIAS\MetaData\Services\CopyrightHelper\CopyrightTest\testPresentAsUIComponents(), and ILIAS\MetaData\Services\CopyrightHelper\CopyrightTest\testTitle().

48  {
49  $legacy_component = $this->getLegacyComponent();
50  return new class ($legacy_component, $this->any()) extends NullRenderer {
51  public ?string $exposed_copyright_data = null;
52 
53  public function __construct(
54  protected MockObject|Content $legacy,
55  protected AnyInvokedCount $any
56  ) {
57  }
58 
59  public function toUIComponents(CopyrightDataInterface $copyright): array
60  {
61  $this->exposed_copyright_data = $copyright->exposed_data;
62  return [$this->legacy];
63  }
64 
65  public function toString(CopyrightDataInterface $copyright): string
66  {
67  return $copyright->exposed_data;
68  }
69  };
70  }
__construct(SettingsInterface $settings, PathFactory $path_factory, CopyrightRepository $copyright_repo, IdentifierHandler $identifier_handler, RendererInterface $renderer, SearchClauseFactory $search_clause_factory)
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ testDescription()

ILIAS\MetaData\Services\CopyrightHelper\CopyrightTest::testDescription ( )

Definition at line 245 of file CopyrightTest.php.

References ILIAS\MetaData\Services\CopyrightHelper\CopyrightTest\getEntry(), ILIAS\MetaData\Services\CopyrightHelper\CopyrightTest\getIdentifierHandler(), and ILIAS\MetaData\Services\CopyrightHelper\CopyrightTest\getRenderer().

245  : void
246  {
247  $copyright = new Copyright(
248  $this->getRenderer(),
249  $this->getIdentifierHandler(),
250  $this->getEntry(
251  false,
252  false,
253  35,
254  'cp title',
255  'cp description',
256  'data of copyright'
257  )
258  );
259 
260  $this->assertSame('cp description', $copyright->description());
261  }
getEntry(bool $is_default, bool $is_outdated, int $id, string $title, string $description, string $cp_data)
+ Here is the call graph for this function:

◆ testIdentifier()

ILIAS\MetaData\Services\CopyrightHelper\CopyrightTest::testIdentifier ( )

Definition at line 209 of file CopyrightTest.php.

References ILIAS\MetaData\Services\CopyrightHelper\CopyrightTest\getEntry(), ILIAS\MetaData\Services\CopyrightHelper\CopyrightTest\getIdentifierHandler(), and ILIAS\MetaData\Services\CopyrightHelper\CopyrightTest\getRenderer().

209  : void
210  {
211  $copyright = new Copyright(
212  $this->getRenderer(),
213  $this->getIdentifierHandler(),
214  $this->getEntry(
215  false,
216  false,
217  35,
218  'cp title',
219  'cp description',
220  'data of copyright'
221  )
222  );
223 
224  $this->assertSame('identifier_35', $copyright->identifier());
225  }
getEntry(bool $is_default, bool $is_outdated, int $id, string $title, string $description, string $cp_data)
+ Here is the call graph for this function:

◆ testIsDefaultFalse()

ILIAS\MetaData\Services\CopyrightHelper\CopyrightTest::testIsDefaultFalse ( )

Definition at line 155 of file CopyrightTest.php.

References ILIAS\MetaData\Services\CopyrightHelper\CopyrightTest\getEntry(), ILIAS\MetaData\Services\CopyrightHelper\CopyrightTest\getIdentifierHandler(), and ILIAS\MetaData\Services\CopyrightHelper\CopyrightTest\getRenderer().

155  : void
156  {
157  $copyright = new Copyright(
158  $this->getRenderer(),
159  $this->getIdentifierHandler(),
160  $this->getEntry(
161  false,
162  false,
163  35,
164  'cp title',
165  'cp description',
166  'data of copyright'
167  )
168  );
169 
170  $this->assertFalse($copyright->isDefault());
171  }
getEntry(bool $is_default, bool $is_outdated, int $id, string $title, string $description, string $cp_data)
+ Here is the call graph for this function:

◆ testIsDefaultTrue()

ILIAS\MetaData\Services\CopyrightHelper\CopyrightTest::testIsDefaultTrue ( )

Definition at line 137 of file CopyrightTest.php.

References ILIAS\MetaData\Services\CopyrightHelper\CopyrightTest\getEntry(), ILIAS\MetaData\Services\CopyrightHelper\CopyrightTest\getIdentifierHandler(), and ILIAS\MetaData\Services\CopyrightHelper\CopyrightTest\getRenderer().

137  : void
138  {
139  $copyright = new Copyright(
140  $this->getRenderer(),
141  $this->getIdentifierHandler(),
142  $this->getEntry(
143  true,
144  false,
145  35,
146  'cp title',
147  'cp description',
148  'data of copyright'
149  )
150  );
151 
152  $this->assertTrue($copyright->isDefault());
153  }
getEntry(bool $is_default, bool $is_outdated, int $id, string $title, string $description, string $cp_data)
+ Here is the call graph for this function:

◆ testIsOutdatedFalse()

ILIAS\MetaData\Services\CopyrightHelper\CopyrightTest::testIsOutdatedFalse ( )

Definition at line 191 of file CopyrightTest.php.

References ILIAS\MetaData\Services\CopyrightHelper\CopyrightTest\getEntry(), ILIAS\MetaData\Services\CopyrightHelper\CopyrightTest\getIdentifierHandler(), and ILIAS\MetaData\Services\CopyrightHelper\CopyrightTest\getRenderer().

191  : void
192  {
193  $copyright = new Copyright(
194  $this->getRenderer(),
195  $this->getIdentifierHandler(),
196  $this->getEntry(
197  false,
198  false,
199  35,
200  'cp title',
201  'cp description',
202  'data of copyright'
203  )
204  );
205 
206  $this->assertFalse($copyright->isOutdated());
207  }
getEntry(bool $is_default, bool $is_outdated, int $id, string $title, string $description, string $cp_data)
+ Here is the call graph for this function:

◆ testIsOutdatedTrue()

ILIAS\MetaData\Services\CopyrightHelper\CopyrightTest::testIsOutdatedTrue ( )

Definition at line 173 of file CopyrightTest.php.

References ILIAS\MetaData\Services\CopyrightHelper\CopyrightTest\getEntry(), ILIAS\MetaData\Services\CopyrightHelper\CopyrightTest\getIdentifierHandler(), and ILIAS\MetaData\Services\CopyrightHelper\CopyrightTest\getRenderer().

173  : void
174  {
175  $copyright = new Copyright(
176  $this->getRenderer(),
177  $this->getIdentifierHandler(),
178  $this->getEntry(
179  false,
180  true,
181  35,
182  'cp title',
183  'cp description',
184  'data of copyright'
185  )
186  );
187 
188  $this->assertTrue($copyright->isOutdated());
189  }
getEntry(bool $is_default, bool $is_outdated, int $id, string $title, string $description, string $cp_data)
+ Here is the call graph for this function:

◆ testPresentAsString()

ILIAS\MetaData\Services\CopyrightHelper\CopyrightTest::testPresentAsString ( )

Definition at line 286 of file CopyrightTest.php.

References ILIAS\MetaData\Services\CopyrightHelper\CopyrightTest\getEntry(), ILIAS\MetaData\Services\CopyrightHelper\CopyrightTest\getIdentifierHandler(), and ILIAS\MetaData\Services\CopyrightHelper\CopyrightTest\getRenderer().

286  : void
287  {
288  $copyright = new Copyright(
289  $this->getRenderer(),
290  $this->getIdentifierHandler(),
291  $this->getEntry(
292  false,
293  false,
294  35,
295  'cp title',
296  'cp description',
297  'data of copyright'
298  )
299  );
300 
301  $this->assertSame('data of copyright', $copyright->presentAsString());
302  }
getEntry(bool $is_default, bool $is_outdated, int $id, string $title, string $description, string $cp_data)
+ Here is the call graph for this function:

◆ testPresentAsUIComponents()

ILIAS\MetaData\Services\CopyrightHelper\CopyrightTest::testPresentAsUIComponents ( )

PhpUndefinedMethodInspection

Definition at line 263 of file CopyrightTest.php.

References $components, ILIAS\MetaData\Services\CopyrightHelper\CopyrightHelper\$renderer, ILIAS\MetaData\Services\CopyrightHelper\CopyrightTest\getEntry(), ILIAS\MetaData\Services\CopyrightHelper\CopyrightTest\getIdentifierHandler(), and ILIAS\MetaData\Services\CopyrightHelper\CopyrightTest\getRenderer().

263  : void
264  {
265  $renderer = $this->getRenderer();
266  $copyright = new Copyright(
267  $renderer,
268  $this->getIdentifierHandler(),
269  $this->getEntry(
270  false,
271  false,
272  35,
273  'cp title',
274  'cp description',
275  'data of copyright'
276  )
277  );
278 
279  $components = $copyright->presentAsUIComponents();
280 
281  $this->assertCount(1, $components);
283  $this->assertSame('data of copyright', $renderer->exposed_copyright_data);
284  }
$components
getEntry(bool $is_default, bool $is_outdated, int $id, string $title, string $description, string $cp_data)
+ Here is the call graph for this function:

◆ testTitle()

ILIAS\MetaData\Services\CopyrightHelper\CopyrightTest::testTitle ( )

Definition at line 227 of file CopyrightTest.php.

References ILIAS\MetaData\Services\CopyrightHelper\CopyrightTest\getEntry(), ILIAS\MetaData\Services\CopyrightHelper\CopyrightTest\getIdentifierHandler(), and ILIAS\MetaData\Services\CopyrightHelper\CopyrightTest\getRenderer().

227  : void
228  {
229  $copyright = new Copyright(
230  $this->getRenderer(),
231  $this->getIdentifierHandler(),
232  $this->getEntry(
233  false,
234  false,
235  35,
236  'cp title',
237  'cp description',
238  'data of copyright'
239  )
240  );
241 
242  $this->assertSame('cp title', $copyright->title());
243  }
getEntry(bool $is_default, bool $is_outdated, int $id, string $title, string $description, string $cp_data)
+ Here is the call graph for this function:

The documentation for this class was generated from the following file: