ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ILIAS\MetaData\Copyright\DatabaseRepositoryTest Class Reference
+ Inheritance diagram for ILIAS\MetaData\Copyright\DatabaseRepositoryTest:
+ Collaboration diagram for ILIAS\MetaData\Copyright\DatabaseRepositoryTest:

Public Member Functions

 testGetEntry ()
 
 testGetEntryNoLinks ()
 
 testGetEntryNoneFound ()
 
 testGetDefaultEntry ()
 
 testGetAllEntries ()
 
 testGetActiveEntries ()
 
 testDeleteEntry ()
 
 testCreateWithLinkImage ()
 
 testCreateWithFileImage ()
 
 testCreateEmptyTitleException ()
 
 testUpdateWithLinkImage ()
 
 testUpdateWithFileImage ()
 
 testUpdateEmptyTitleException ()
 
 testReorderEntries ()
 

Protected Member Functions

 getDBWrapper (array ... $query_results)
 
 getMockURI ()
 
 getRepo (WrapperInterface $wrapper)
 

Protected Attributes

const int NEXT_ID = 123
 
const array ROW_DEFAULT
 
const array ROW_1
 
const array ROW_2
 

Detailed Description

Definition at line 30 of file DatabaseRepositoryTest.php.

Member Function Documentation

◆ getDBWrapper()

ILIAS\MetaData\Copyright\DatabaseRepositoryTest::getDBWrapper ( array ...  $query_results)
protected

Definition at line 76 of file DatabaseRepositoryTest.php.

76 : WrapperInterface
77 {
78 return new class (self::NEXT_ID, $query_results) extends NullWrapper {
79 public array $exposed_tables;
80 public array $exposed_queries;
81 public array $exposed_manipulates;
82 public array $exposed_values;
83 public array $exposed_wheres;
84
85 public function __construct(
86 protected int $next_id,
87 protected array $query_results
88 ) {
89 }
90
91 public function nextID(string $table): int
92 {
93 $this->exposed_tables[] = $table;
94 return $this->next_id;
95 }
96
97 public function quoteInteger(int $integer): string
98 {
99 return '~' . $integer . '~';
100 }
101
102 public function query(string $query): \Generator
103 {
104 $this->exposed_queries[] = $query;
105 yield from $this->query_results;
106 }
107
108 public function manipulate(string $query): void
109 {
110 $this->exposed_manipulates[] = $query;
111 }
112
113 public function update(string $table, array $values, array $where): void
114 {
115 $this->exposed_tables[] = $table;
116 $this->exposed_values[] = $values;
117 $this->exposed_wheres[] = $where;
118 }
119
120 public function insert(string $table, array $values): void
121 {
122 $this->exposed_tables[] = $table;
123 $this->exposed_values[] = $values;
124 }
125 };
126 }
__construct()
Constructor setup ILIAS global object @access public.
Definition: class.ilias.php:76

References ILIAS\__construct(), ILIAS\ResourceStorage\Flavour\Machine\DefaultMachines\from(), and ILIAS\MetaData\Copyright\DatabaseRepositoryTest\NEXT_ID.

Referenced by ILIAS\MetaData\Copyright\DatabaseRepositoryTest\testCreateEmptyTitleException(), ILIAS\MetaData\Copyright\DatabaseRepositoryTest\testCreateWithFileImage(), ILIAS\MetaData\Copyright\DatabaseRepositoryTest\testCreateWithLinkImage(), ILIAS\MetaData\Copyright\DatabaseRepositoryTest\testDeleteEntry(), ILIAS\MetaData\Copyright\DatabaseRepositoryTest\testGetActiveEntries(), ILIAS\MetaData\Copyright\DatabaseRepositoryTest\testGetAllEntries(), ILIAS\MetaData\Copyright\DatabaseRepositoryTest\testGetDefaultEntry(), ILIAS\MetaData\Copyright\DatabaseRepositoryTest\testGetEntry(), ILIAS\MetaData\Copyright\DatabaseRepositoryTest\testGetEntryNoLinks(), ILIAS\MetaData\Copyright\DatabaseRepositoryTest\testGetEntryNoneFound(), ILIAS\MetaData\Copyright\DatabaseRepositoryTest\testReorderEntries(), ILIAS\MetaData\Copyright\DatabaseRepositoryTest\testUpdateEmptyTitleException(), ILIAS\MetaData\Copyright\DatabaseRepositoryTest\testUpdateWithFileImage(), and ILIAS\MetaData\Copyright\DatabaseRepositoryTest\testUpdateWithLinkImage().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getMockURI()

ILIAS\MetaData\Copyright\DatabaseRepositoryTest::getMockURI ( )
protected

◆ getRepo()

ILIAS\MetaData\Copyright\DatabaseRepositoryTest::getRepo ( WrapperInterface  $wrapper)
protected

Definition at line 133 of file DatabaseRepositoryTest.php.

133 : DatabaseRepository
134 {
135 $uri = $this->getMockURI();
136
137 return new class ($wrapper, $uri) extends DatabaseRepository {
138 public function __construct(
139 WrapperInterface $wrapper,
140 protected URI|MockObject $uri
141 ) {
142 parent::__construct($wrapper);
143 }
144
145 protected function getURI(string $uri): URI
146 {
147 $clone = clone $this->uri;
148 $clone->method('__toString')->willReturn($uri);
149 return $clone;
150 }
151 };
152 }
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
if( $request_wrapper->has( 'ui_mainbar')) getURI()
Definition: ui_mainbar.php:301

References ILIAS\__construct(), ILIAS\GlobalScreen\Provider\__construct(), ILIAS\MetaData\Copyright\DatabaseRepositoryTest\getMockURI(), and ILIAS\UI\examples\Layout\Page\Standard\getURI().

Referenced by ILIAS\MetaData\Copyright\DatabaseRepositoryTest\testCreateEmptyTitleException(), ILIAS\MetaData\Copyright\DatabaseRepositoryTest\testCreateWithFileImage(), ILIAS\MetaData\Copyright\DatabaseRepositoryTest\testCreateWithLinkImage(), ILIAS\MetaData\Copyright\DatabaseRepositoryTest\testDeleteEntry(), ILIAS\MetaData\Copyright\DatabaseRepositoryTest\testGetActiveEntries(), ILIAS\MetaData\Copyright\DatabaseRepositoryTest\testGetAllEntries(), ILIAS\MetaData\Copyright\DatabaseRepositoryTest\testGetDefaultEntry(), ILIAS\MetaData\Copyright\DatabaseRepositoryTest\testGetEntry(), ILIAS\MetaData\Copyright\DatabaseRepositoryTest\testGetEntryNoLinks(), ILIAS\MetaData\Copyright\DatabaseRepositoryTest\testGetEntryNoneFound(), ILIAS\MetaData\Copyright\DatabaseRepositoryTest\testReorderEntries(), ILIAS\MetaData\Copyright\DatabaseRepositoryTest\testUpdateEmptyTitleException(), ILIAS\MetaData\Copyright\DatabaseRepositoryTest\testUpdateWithFileImage(), and ILIAS\MetaData\Copyright\DatabaseRepositoryTest\testUpdateWithLinkImage().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ testCreateEmptyTitleException()

ILIAS\MetaData\Copyright\DatabaseRepositoryTest::testCreateEmptyTitleException ( )

Definition at line 362 of file DatabaseRepositoryTest.php.

362 : void
363 {
364 $repo = $this->getRepo($this->getDBWrapper());
365
366 $this->expectException(\ilMDCopyrightException::class);
367 $repo->createEntry('');
368 }

References ILIAS\MetaData\Copyright\DatabaseRepositoryTest\getDBWrapper(), and ILIAS\MetaData\Copyright\DatabaseRepositoryTest\getRepo().

+ Here is the call graph for this function:

◆ testCreateWithFileImage()

ILIAS\MetaData\Copyright\DatabaseRepositoryTest::testCreateWithFileImage ( )

Definition at line 316 of file DatabaseRepositoryTest.php.

316 : void
317 {
318 $db = $this->getDBWrapper(['max' => 5]);
319 $uri = $this->getMockURI();
320 $uri->method('__toString')->willReturn('new link');
321 $repo = $this->getRepo($db);
322
323 $repo->createEntry(
324 'new title',
325 'new description',
326 false,
327 'new full name',
328 null,
329 'new image file',
330 'new alt text'
331 );
332 $this->assertSame(
333 ['SELECT MAX(position) AS max FROM il_md_cpr_selections WHERE is_default = 0'],
334 $db->exposed_queries
335 );
336 $this->assertSame(
337 [
338 'il_md_cpr_selections',
339 'il_md_cpr_selections'
340 ],
341 $db->exposed_tables
342 );
343 $this->assertSame(
344 [[
345 'entry_id' => [\ilDBConstants::T_INTEGER, 123],
346 'title' => [\ilDBConstants::T_TEXT, 'new title'],
347 'description' => [\ilDBConstants::T_TEXT, 'new description'],
348 'is_default' => [\ilDBConstants::T_INTEGER, 0],
349 'outdated' => [\ilDBConstants::T_INTEGER, 0],
350 'position' => [\ilDBConstants::T_INTEGER, 6],
351 'full_name' => [\ilDBConstants::T_TEXT, 'new full name'],
352 'link' => [\ilDBConstants::T_TEXT, ''],
353 'image_link' => [\ilDBConstants::T_TEXT, ''],
354 'image_file' => [\ilDBConstants::T_TEXT, 'new image file'],
355 'alt_text' => [\ilDBConstants::T_TEXT, 'new alt text'],
356 'migrated' => [\ilDBConstants::T_INTEGER, 1]
357 ]],
358 $db->exposed_values
359 );
360 }

References ILIAS\$db, ILIAS\MetaData\Copyright\DatabaseRepositoryTest\getDBWrapper(), ILIAS\MetaData\Copyright\DatabaseRepositoryTest\getMockURI(), ILIAS\MetaData\Copyright\DatabaseRepositoryTest\getRepo(), ilDBConstants\T_INTEGER, and ilDBConstants\T_TEXT.

+ Here is the call graph for this function:

◆ testCreateWithLinkImage()

ILIAS\MetaData\Copyright\DatabaseRepositoryTest::testCreateWithLinkImage ( )

Definition at line 268 of file DatabaseRepositoryTest.php.

268 : void
269 {
270 $db = $this->getDBWrapper(['max' => 5]);
271 $uri = $this->getMockURI();
272 $uri->method('__toString')->willReturn('new link');
273 $img_uri = $this->getMockURI();
274 $img_uri->method('__toString')->willReturn('new image link');
275 $repo = $this->getRepo($db);
276
277 $repo->createEntry(
278 'new title',
279 'new description',
280 true,
281 'new full name',
282 $uri,
283 $img_uri,
284 'new alt text'
285 );
286 $this->assertSame(
287 ['SELECT MAX(position) AS max FROM il_md_cpr_selections WHERE is_default = 0'],
288 $db->exposed_queries
289 );
290 $this->assertSame(
291 [
292 'il_md_cpr_selections',
293 'il_md_cpr_selections'
294 ],
295 $db->exposed_tables
296 );
297 $this->assertSame(
298 [[
299 'entry_id' => [\ilDBConstants::T_INTEGER, 123],
300 'title' => [\ilDBConstants::T_TEXT, 'new title'],
301 'description' => [\ilDBConstants::T_TEXT, 'new description'],
302 'is_default' => [\ilDBConstants::T_INTEGER, 0],
303 'outdated' => [\ilDBConstants::T_INTEGER, 1],
304 'position' => [\ilDBConstants::T_INTEGER, 6],
305 'full_name' => [\ilDBConstants::T_TEXT, 'new full name'],
306 'link' => [\ilDBConstants::T_TEXT, 'new link'],
307 'image_link' => [\ilDBConstants::T_TEXT, 'new image link'],
308 'image_file' => [\ilDBConstants::T_TEXT, ''],
309 'alt_text' => [\ilDBConstants::T_TEXT, 'new alt text'],
310 'migrated' => [\ilDBConstants::T_INTEGER, 1]
311 ]],
312 $db->exposed_values
313 );
314 }

References ILIAS\$db, ILIAS\MetaData\Copyright\DatabaseRepositoryTest\getDBWrapper(), ILIAS\MetaData\Copyright\DatabaseRepositoryTest\getMockURI(), ILIAS\MetaData\Copyright\DatabaseRepositoryTest\getRepo(), ilDBConstants\T_INTEGER, and ilDBConstants\T_TEXT.

+ Here is the call graph for this function:

◆ testDeleteEntry()

ILIAS\MetaData\Copyright\DatabaseRepositoryTest::testDeleteEntry ( )

Definition at line 256 of file DatabaseRepositoryTest.php.

256 : void
257 {
258 $db = $this->getDBWrapper();
259 $repo = $this->getRepo($db);
260
261 $repo->deleteEntry(5);
262 $this->assertSame(
263 ['DELETE ' . 'FROM il_md_cpr_selections WHERE entry_id = ~5~'],
264 $db->exposed_manipulates
265 );
266 }

References ILIAS\$db, ILIAS\MetaData\Copyright\DatabaseRepositoryTest\getDBWrapper(), and ILIAS\MetaData\Copyright\DatabaseRepositoryTest\getRepo().

+ Here is the call graph for this function:

◆ testGetActiveEntries()

ILIAS\MetaData\Copyright\DatabaseRepositoryTest::testGetActiveEntries ( )

Definition at line 237 of file DatabaseRepositoryTest.php.

237 : void
238 {
239 $db = $this->getDBWrapper(
240 self::ROW_DEFAULT,
241 self::ROW_2
242 );
243 $repo = $this->getRepo($db);
244
245 $res = iterator_to_array($repo->getActiveEntries());
246 $this->assertSame(
247 ['SELECT * FROM il_md_cpr_selections WHERE outdated = 0
248 ORDER BY is_default DESC, position ASC'],
249 $db->exposed_queries
250 );
251 $this->assertCount(2, $res);
252 $this->assertInstanceOf(EntryInterface::class, $res[0]);
253 $this->assertInstanceOf(EntryInterface::class, $res[1]);
254 }
$res
Definition: ltiservices.php:69

References ILIAS\$db, $res, ILIAS\MetaData\Copyright\DatabaseRepositoryTest\getDBWrapper(), and ILIAS\MetaData\Copyright\DatabaseRepositoryTest\getRepo().

+ Here is the call graph for this function:

◆ testGetAllEntries()

ILIAS\MetaData\Copyright\DatabaseRepositoryTest::testGetAllEntries ( )

Definition at line 216 of file DatabaseRepositoryTest.php.

216 : void
217 {
218 $db = $this->getDBWrapper(
219 self::ROW_DEFAULT,
220 self::ROW_2,
221 self::ROW_1
222 );
223 $repo = $this->getRepo($db);
224
225 $res = iterator_to_array($repo->getAllEntries());
226 $this->assertSame(
227 ['SELECT * FROM il_md_cpr_selections
228 ORDER BY is_default DESC, position ASC'],
229 $db->exposed_queries
230 );
231 $this->assertCount(3, $res);
232 $this->assertInstanceOf(EntryInterface::class, $res[0]);
233 $this->assertInstanceOf(EntryInterface::class, $res[1]);
234 $this->assertInstanceOf(EntryInterface::class, $res[2]);
235 }

References ILIAS\$db, $res, ILIAS\MetaData\Copyright\DatabaseRepositoryTest\getDBWrapper(), and ILIAS\MetaData\Copyright\DatabaseRepositoryTest\getRepo().

+ Here is the call graph for this function:

◆ testGetDefaultEntry()

ILIAS\MetaData\Copyright\DatabaseRepositoryTest::testGetDefaultEntry ( )

Definition at line 204 of file DatabaseRepositoryTest.php.

204 : void
205 {
206 $db = $this->getDBWrapper(self::ROW_DEFAULT);
207 $repo = $this->getRepo($db);
208
209 $this->assertInstanceOf(EntryInterface::class, $repo->getDefaultEntry());
210 $this->assertSame(
211 ['SELECT * FROM il_md_cpr_selections WHERE is_default = 1'],
212 $db->exposed_queries
213 );
214 }

References ILIAS\$db, ILIAS\MetaData\Copyright\DatabaseRepositoryTest\getDBWrapper(), and ILIAS\MetaData\Copyright\DatabaseRepositoryTest\getRepo().

+ Here is the call graph for this function:

◆ testGetEntry()

ILIAS\MetaData\Copyright\DatabaseRepositoryTest::testGetEntry ( )

Definition at line 154 of file DatabaseRepositoryTest.php.

154 : void
155 {
156 $db = $this->getDBWrapper(self::ROW_1);
157 $repo = $this->getRepo($db);
158
159 $entry = $repo->getEntry(5);
160 $this->assertSame(
161 ['SELECT * ' . 'FROM il_md_cpr_selections WHERE entry_id = ~5~'],
162 $db->exposed_queries
163 );
164 $this->assertSame(self::ROW_1['entry_id'], $entry->id());
165 $this->assertSame(self::ROW_1['title'], $entry->title());
166 $this->assertSame(self::ROW_1['description'], $entry->description());
167 $this->assertSame((bool) self::ROW_1['is_default'], $entry->isDefault());
168 $this->assertSame((bool) self::ROW_1['outdated'], $entry->isOutdated());
169 $this->assertSame(self::ROW_1['position'], $entry->position());
170 $this->assertSame(self::ROW_1['full_name'], $entry->copyrightData()->fullName());
171 $this->assertSame(self::ROW_1['link'], (string) $entry->copyrightData()->link());
172 $this->assertSame(self::ROW_1['image_link'], (string) $entry->copyrightData()->imageLink());
173 $this->assertSame(self::ROW_1['image_file'], $entry->copyrightData()->imageFile());
174 $this->assertSame(self::ROW_1['alt_text'], $entry->copyrightData()->altText());
175 $this->assertSame((bool) self::ROW_1['is_default'], $entry->copyrightData()->fallBackToDefaultImage());
176 }

References ILIAS\$db, ILIAS\MetaData\Copyright\DatabaseRepositoryTest\getDBWrapper(), and ILIAS\MetaData\Copyright\DatabaseRepositoryTest\getRepo().

+ Here is the call graph for this function:

◆ testGetEntryNoLinks()

ILIAS\MetaData\Copyright\DatabaseRepositoryTest::testGetEntryNoLinks ( )

Definition at line 178 of file DatabaseRepositoryTest.php.

178 : void
179 {
180 $db = $this->getDBWrapper(self::ROW_2);
181 $repo = $this->getRepo($db);
182
183 $entry = $repo->getEntry(67);
184 $this->assertSame(
185 ['SELECT * ' . 'FROM il_md_cpr_selections WHERE entry_id = ~67~'],
186 $db->exposed_queries
187 );
188 $this->assertNull($entry->copyrightData()->link());
189 $this->assertNull($entry->copyrightData()->imageLink());
190 }

References ILIAS\$db, ILIAS\MetaData\Copyright\DatabaseRepositoryTest\getDBWrapper(), and ILIAS\MetaData\Copyright\DatabaseRepositoryTest\getRepo().

+ Here is the call graph for this function:

◆ testGetEntryNoneFound()

ILIAS\MetaData\Copyright\DatabaseRepositoryTest::testGetEntryNoneFound ( )

Definition at line 192 of file DatabaseRepositoryTest.php.

192 : void
193 {
194 $db = $this->getDBWrapper();
195 $repo = $this->getRepo($db);
196
197 $this->assertEquals(new NullEntry(), $repo->getEntry(5));
198 $this->assertSame(
199 ['SELECT * ' . 'FROM il_md_cpr_selections WHERE entry_id = ~5~'],
200 $db->exposed_queries
201 );
202 }

References ILIAS\$db, ILIAS\MetaData\Copyright\DatabaseRepositoryTest\getDBWrapper(), and ILIAS\MetaData\Copyright\DatabaseRepositoryTest\getRepo().

+ Here is the call graph for this function:

◆ testReorderEntries()

ILIAS\MetaData\Copyright\DatabaseRepositoryTest::testReorderEntries ( )

Definition at line 462 of file DatabaseRepositoryTest.php.

462 : void
463 {
464 $db = $this->getDBWrapper(['entry_id' => 5]);
465 $repo = $this->getRepo($db);
466
467 $repo->reorderEntries(7, 5, 99, 1);
468 $this->assertSame(
469 ['SELECT entry_id FROM il_md_cpr_selections WHERE is_default = 1'],
470 $db->exposed_queries
471 );
472 $this->assertSame(
473 [
474 'il_md_cpr_selections',
475 'il_md_cpr_selections',
476 'il_md_cpr_selections'
477 ],
478 $db->exposed_tables,
479 );
480 $this->assertSame(
481 [
482 ['position' => [\ilDBConstants::T_INTEGER, 0]],
483 ['position' => [\ilDBConstants::T_INTEGER, 1]],
484 ['position' => [\ilDBConstants::T_INTEGER, 2]]
485 ],
486 $db->exposed_values
487 );
488 $this->assertSame(
489 [
490 ['entry_id' => [\ilDBConstants::T_INTEGER, 7]],
491 ['entry_id' => [\ilDBConstants::T_INTEGER, 99]],
492 ['entry_id' => [\ilDBConstants::T_INTEGER, 1]]
493 ],
494 $db->exposed_wheres
495 );
496 }

References ILIAS\$db, ILIAS\MetaData\Copyright\DatabaseRepositoryTest\getDBWrapper(), ILIAS\MetaData\Copyright\DatabaseRepositoryTest\getRepo(), and ilDBConstants\T_INTEGER.

+ Here is the call graph for this function:

◆ testUpdateEmptyTitleException()

ILIAS\MetaData\Copyright\DatabaseRepositoryTest::testUpdateEmptyTitleException ( )

Definition at line 454 of file DatabaseRepositoryTest.php.

454 : void
455 {
456 $repo = $this->getRepo($this->getDBWrapper());
457
458 $this->expectException(\ilMDCopyrightException::class);
459 $repo->updateEntry(21, '');
460 }

References ILIAS\MetaData\Copyright\DatabaseRepositoryTest\getDBWrapper(), and ILIAS\MetaData\Copyright\DatabaseRepositoryTest\getRepo().

+ Here is the call graph for this function:

◆ testUpdateWithFileImage()

ILIAS\MetaData\Copyright\DatabaseRepositoryTest::testUpdateWithFileImage ( )

Definition at line 412 of file DatabaseRepositoryTest.php.

412 : void
413 {
414 $db = $this->getDBWrapper();
415 $uri = $this->getMockURI();
416 $uri->method('__toString')->willReturn('new link');
417 $img_uri = $this->getMockURI();
418 $img_uri->method('__toString')->willReturn('new image link');
419
420 $repo = $this->getRepo($db);
421 $repo->updateEntry(
422 9,
423 'new title',
424 'new description',
425 false,
426 'new full name',
427 $uri,
428 'new image file',
429 'new alt text'
430 );
431 $this->assertSame(
432 ['il_md_cpr_selections'],
433 $db->exposed_tables
434 );
435 $this->assertSame(
436 [[
437 'title' => [\ilDBConstants::T_TEXT, 'new title'],
438 'description' => [\ilDBConstants::T_TEXT, 'new description'],
439 'outdated' => [\ilDBConstants::T_INTEGER, 0],
440 'full_name' => [\ilDBConstants::T_TEXT, 'new full name'],
441 'link' => [\ilDBConstants::T_TEXT, 'new link'],
442 'image_link' => [\ilDBConstants::T_TEXT, ''],
443 'image_file' => [\ilDBConstants::T_TEXT, 'new image file'],
444 'alt_text' => [\ilDBConstants::T_TEXT, 'new alt text']
445 ]],
446 $db->exposed_values
447 );
448 $this->assertSame(
449 [['entry_id' => [\ilDBConstants::T_INTEGER, 9]]],
450 $db->exposed_wheres
451 );
452 }

References ILIAS\$db, ILIAS\MetaData\Copyright\DatabaseRepositoryTest\getDBWrapper(), ILIAS\MetaData\Copyright\DatabaseRepositoryTest\getMockURI(), ILIAS\MetaData\Copyright\DatabaseRepositoryTest\getRepo(), ilDBConstants\T_INTEGER, and ilDBConstants\T_TEXT.

+ Here is the call graph for this function:

◆ testUpdateWithLinkImage()

ILIAS\MetaData\Copyright\DatabaseRepositoryTest::testUpdateWithLinkImage ( )

Definition at line 370 of file DatabaseRepositoryTest.php.

370 : void
371 {
372 $db = $this->getDBWrapper();
373 $uri = $this->getMockURI();
374 $uri->method('__toString')->willReturn('new link');
375 $img_uri = $this->getMockURI();
376 $img_uri->method('__toString')->willReturn('new image link');
377 $repo = $this->getRepo($db);
378
379 $repo->updateEntry(
380 9,
381 'new title',
382 'new description',
383 true,
384 'new full name',
385 $uri,
386 $img_uri,
387 'new alt text'
388 );
389 $this->assertSame(
390 ['il_md_cpr_selections'],
391 $db->exposed_tables
392 );
393 $this->assertSame(
394 [[
395 'title' => [\ilDBConstants::T_TEXT, 'new title'],
396 'description' => [\ilDBConstants::T_TEXT, 'new description'],
397 'outdated' => [\ilDBConstants::T_INTEGER, 1],
398 'full_name' => [\ilDBConstants::T_TEXT, 'new full name'],
399 'link' => [\ilDBConstants::T_TEXT, 'new link'],
400 'image_link' => [\ilDBConstants::T_TEXT, 'new image link'],
401 'image_file' => [\ilDBConstants::T_TEXT, ''],
402 'alt_text' => [\ilDBConstants::T_TEXT, 'new alt text']
403 ]],
404 $db->exposed_values
405 );
406 $this->assertSame(
407 [['entry_id' => [\ilDBConstants::T_INTEGER, 9]]],
408 $db->exposed_wheres
409 );
410 }

References ILIAS\$db, ILIAS\MetaData\Copyright\DatabaseRepositoryTest\getDBWrapper(), ILIAS\MetaData\Copyright\DatabaseRepositoryTest\getMockURI(), ILIAS\MetaData\Copyright\DatabaseRepositoryTest\getRepo(), ilDBConstants\T_INTEGER, and ilDBConstants\T_TEXT.

+ Here is the call graph for this function:

Field Documentation

◆ NEXT_ID

const int ILIAS\MetaData\Copyright\DatabaseRepositoryTest::NEXT_ID = 123
protected

◆ ROW_1

const array ILIAS\MetaData\Copyright\DatabaseRepositoryTest::ROW_1
protected
Initial value:
= [
'entry_id' => 5,
'title' => 'entry 1',
'description' => 'description 1',
'is_default' => 0,
'outdated' => 1,
'position' => 1,
'full_name' => 'full name 1',
'link' => 'link 1',
'image_link' => 'image link 1',
'image_file' => '',
'alt_text' => 'alt text 1'
]

Definition at line 48 of file DatabaseRepositoryTest.php.

◆ ROW_2

const array ILIAS\MetaData\Copyright\DatabaseRepositoryTest::ROW_2
protected
Initial value:
= [
'entry_id' => 67,
'title' => 'entry 2',
'description' => '',
'is_default' => 0,
'outdated' => 0,
'position' => 0,
'full_name' => 'full name 2',
'link' => '',
'image_link' => '',
'image_file' => 'image file 2',
'alt_text' => 'alt text 2'
]

Definition at line 62 of file DatabaseRepositoryTest.php.

◆ ROW_DEFAULT

const array ILIAS\MetaData\Copyright\DatabaseRepositoryTest::ROW_DEFAULT
protected
Initial value:
= [
'entry_id' => 25,
'title' => 'entry default',
'description' => 'description default',
'is_default' => 1,
'outdated' => 0,
'position' => 0,
'full_name' => 'full name default',
'link' => 'link default',
'image_link' => 'image link default',
'image_file' => '',
'alt_text' => 'alt text default'
]

Definition at line 34 of file DatabaseRepositoryTest.php.


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