19declare(strict_types=1);
21use PHPUnit\Framework\TestCase;
30 protected function setUp(): void
36 $DIC[
'resource_storage'] = $this->createMock(Services::class);
37 $DIC[
'ilDB'] = $this->createMock(ilDBInterface::class);
40 $this->getMockBuilder(ilLanguage::class)->disableOriginalConstructor()->getMock()
52 $ilBiblEntryFactory = $this->createMock(ilBiblEntryFactoryInterface::class);
53 $ilBiblFieldFactory = $this->createMock(ilBiblFieldFactoryInterface::class);
54 $ilBiblAttributeFactory = $this->createMock(ilBiblAttributeFactoryInterface::class);
58 $ilBiblAttributeFactory
61 $content = $reader->parseContent();
62 $this->assertIsArray($content);
63 $this->assertCount(2, $content);
66 $first_item = $content[0];
67 $this->assertEquals(
'book', $first_item[
'entryType']);
68 $this->assertEquals(
'Süß, Henrik http://www.testlink.ch', $first_item[
'author']);
69 $this->assertEquals(
'Last Minute Histologie: [Fit fürs Examen in 2 Tagen!]', $first_item[
'title']);
70 $this->assertEquals(
'München', $first_item[
'address']);
71 $this->assertEquals(
'2012', $first_item[
'year']);
72 $this->assertEquals(
'Elsevier, Urban & Fischer', $first_item[
'publisher']);
73 $this->assertEquals(
'Histologie. Lehrbuch', $first_item[
'keywords']);
74 $this->assertEquals(
'XIII, 103 S.', $first_item[
'pages']);
75 $this->assertEquals(
'1. Aufl.', $first_item[
'edition']);
76 $this->assertEquals(
'3-437-43015-7', $first_item[
'isbn']);
79 $second_item = $content[1];
80 $this->assertEquals(
'journal', $second_item[
'entryType']);
81 $this->assertEquals(
'Voll, Markus http://de.wikipedia.org/wiki/a-z', $second_item[
'author']);
83 'Atlas of neuroanatomy for communication science and disorders: based on the work of Michael Schuenke, Erik Schulte, Udo Schumacher',
86 $this->assertEquals(
'New York', $second_item[
'address']);
87 $this->assertEquals(
'2012', $second_item[
'year']);
88 $this->assertEquals(
'Thieme', $second_item[
'publisher']);
90 'Sprachstörung. Zentralnervensystem. Neuroanatomie. Neuropathologie. Atlas',
91 $second_item[
'keywords']
93 $this->assertEquals(
'IX, 176 S.', $second_item[
'pages']);
94 $this->assertEquals(
'978-1-60406-649-4', $second_item[
'isbn']);
97 public function testParseBibtechAsItems(): void
99 $ilBiblEntryFactory = $this->createMock(ilBiblEntryFactoryInterface::class);
100 $ilBiblFieldFactory = $this->createMock(ilBiblFieldFactoryInterface::class);
101 $ilBiblAttributeFactory = $this->createMock(ilBiblAttributeFactoryInterface::class);
102 $ilObjBibliographic = $this->createMock(ilObjBibliographic::class);
107 $ilBiblAttributeFactory
111 $ilBiblEntryFactory->expects($this->atLeast(2))
112 ->method(
'getEmptyInstance')
116 $content = $reader->parseContentToEntries($ilObjBibliographic);
118 $this->assertIsArray($content);
119 $this->assertCount(2, $content);
120 $this->assertContainsOnlyInstancesOf(ilBiblEntry::class, $content);
124 $first_item = $content[0];
125 $this->assertEquals(
'book', $first_item->getType());
126 $this->assertSame($one, $first_item);
129 $second_item = $content[1];
130 $this->assertEquals(
'journal', $second_item->getType());
131 $this->assertSame($two, $second_item);
137author = {Süß, Henrik http://www.testlink.ch},
138title = {Last Minute Histologie: [Fit fürs Examen in 2 Tagen!]},
141publisher = {Elsevier, Urban & Fischer},
142keywords = {Histologie. Lehrbuch},
143pages = {XIII, 103 S.},
145ISBN = {978-3-437-43015-2},
146ISBN = {3-437-43015-7},
149author = {Voll, Markus http://de.wikipedia.org/wiki/a-z},
150editor = {Voll, Markus},
151title = {Atlas of neuroanatomy for communication science and disorders: based on the work of Michael Schuenke, Erik Schulte, Udo Schumacher},
155keywords = {Sprachstörung. Zentralnervensystem. Neuroanatomie. Neuropathologie. Atlas},
157ISBN = {978-1-60406-649-4},
Customizing of pimple-DIC for ILIAS.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
testParseBibtechAsArray()
Interface Observer \BackgroundTasks Contains several chained tasks and infos about them.