ILIAS  trunk Revision v11.0_alpha-1769-g99a433fe2dc
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
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 84 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().

91  : EntryInterface {
92  return new class ($is_default, $is_outdated, $id, $title, $description, $cp_data) extends NullEntry {
93  public function __construct(
94  protected bool $is_default,
95  protected bool $is_outdated,
96  protected int $id,
97  protected string $title,
98  protected string $description,
99  protected string $cp_data
100  ) {
101  }
102 
103  public function id(): int
104  {
105  return $this->id;
106  }
107 
108  public function title(): string
109  {
110  return $this->title;
111  }
112 
113  public function description(): string
114  {
115  return $this->description;
116  }
117 
118  public function isDefault(): bool
119  {
120  return $this->is_default;
121  }
122 
123  public function isOutdated(): bool
124  {
125  return $this->is_outdated;
126  }
127 
128  public function copyrightData(): CopyrightDataInterface
129  {
130  return new class ($this->cp_data) extends NullCopyrightData {
131  public function __construct(public string $exposed_data)
132  {
133  }
134  };
135  }
136  };
137  }
__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  ->addMethods(['exposeData'])
45  ->getMock();
46  }
+ Here is the caller graph for this function:

◆ getRenderer()

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

Definition at line 48 of file CopyrightTest.php.

References ILIAS\MetaData\Services\CopyrightHelper\CopyrightHelper\__construct(), ILIAS\MetaData\Services\CopyrightHelper\CopyrightTest\getLegacyComponent(), 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().

49  {
50  $legacy_component = $this->getLegacyComponent();
51  return new class ($legacy_component, $this->any()) extends NullRenderer {
52  public function __construct(
53  protected MockObject|Content $legacy,
54  protected AnyInvokedCount $any
55  ) {
56  }
57 
58  public function toUIComponents(CopyrightDataInterface $copyright): array
59  {
60  $legacy_clone = clone $this->legacy;
61  $legacy_clone->expects($this->any)
62  ->method('exposeData')
63  ->willReturn($copyright->exposed_data);
64  return [$legacy_clone];
65  }
66 
67  public function toString(CopyrightDataInterface $copyright): string
68  {
69  return $copyright->exposed_data;
70  }
71  };
72  }
__construct(SettingsInterface $settings, PathFactory $path_factory, CopyrightRepository $copyright_repo, IdentifierHandler $identifier_handler, RendererInterface $renderer, SearchClauseFactory $search_clause_factory)
+ 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 247 of file CopyrightTest.php.

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

247  : void
248  {
249  $copyright = new Copyright(
250  $this->getRenderer(),
251  $this->getIdentifierHandler(),
252  $this->getEntry(
253  false,
254  false,
255  35,
256  'cp title',
257  'cp description',
258  'data of copyright'
259  )
260  );
261 
262  $this->assertSame('cp description', $copyright->description());
263  }
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 211 of file CopyrightTest.php.

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

211  : void
212  {
213  $copyright = new Copyright(
214  $this->getRenderer(),
215  $this->getIdentifierHandler(),
216  $this->getEntry(
217  false,
218  false,
219  35,
220  'cp title',
221  'cp description',
222  'data of copyright'
223  )
224  );
225 
226  $this->assertSame('identifier_35', $copyright->identifier());
227  }
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 157 of file CopyrightTest.php.

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

157  : void
158  {
159  $copyright = new Copyright(
160  $this->getRenderer(),
161  $this->getIdentifierHandler(),
162  $this->getEntry(
163  false,
164  false,
165  35,
166  'cp title',
167  'cp description',
168  'data of copyright'
169  )
170  );
171 
172  $this->assertFalse($copyright->isDefault());
173  }
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 139 of file CopyrightTest.php.

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

139  : void
140  {
141  $copyright = new Copyright(
142  $this->getRenderer(),
143  $this->getIdentifierHandler(),
144  $this->getEntry(
145  true,
146  false,
147  35,
148  'cp title',
149  'cp description',
150  'data of copyright'
151  )
152  );
153 
154  $this->assertTrue($copyright->isDefault());
155  }
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 193 of file CopyrightTest.php.

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

193  : void
194  {
195  $copyright = new Copyright(
196  $this->getRenderer(),
197  $this->getIdentifierHandler(),
198  $this->getEntry(
199  false,
200  false,
201  35,
202  'cp title',
203  'cp description',
204  'data of copyright'
205  )
206  );
207 
208  $this->assertFalse($copyright->isOutdated());
209  }
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 175 of file CopyrightTest.php.

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

175  : void
176  {
177  $copyright = new Copyright(
178  $this->getRenderer(),
179  $this->getIdentifierHandler(),
180  $this->getEntry(
181  false,
182  true,
183  35,
184  'cp title',
185  'cp description',
186  'data of copyright'
187  )
188  );
189 
190  $this->assertTrue($copyright->isOutdated());
191  }
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 287 of file CopyrightTest.php.

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

287  : void
288  {
289  $copyright = new Copyright(
290  $this->getRenderer(),
291  $this->getIdentifierHandler(),
292  $this->getEntry(
293  false,
294  false,
295  35,
296  'cp title',
297  'cp description',
298  'data of copyright'
299  )
300  );
301 
302  $this->assertSame('data of copyright', $copyright->presentAsString());
303  }
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 265 of file CopyrightTest.php.

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

265  : void
266  {
267  $copyright = new Copyright(
268  $this->getRenderer(),
269  $this->getIdentifierHandler(),
270  $this->getEntry(
271  false,
272  false,
273  35,
274  'cp title',
275  'cp description',
276  'data of copyright'
277  )
278  );
279 
280  $components = $copyright->presentAsUIComponents();
281 
282  $this->assertCount(1, $components);
284  $this->assertSame('data of copyright', $components[0]->exposeData());
285  }
$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 229 of file CopyrightTest.php.

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

229  : void
230  {
231  $copyright = new Copyright(
232  $this->getRenderer(),
233  $this->getIdentifierHandler(),
234  $this->getEntry(
235  false,
236  false,
237  35,
238  'cp title',
239  'cp description',
240  'data of copyright'
241  )
242  );
243 
244  $this->assertSame('cp title', $copyright->title());
245  }
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: