Skip to content

Commit e766aea

Browse files
Merge pull request #32 from beatrycze-volk/functions
[TEST] Add void return type declarations to test helpers
2 parents 7e3f7c3 + 8674e8b commit e766aea

16 files changed

Lines changed: 45 additions & 45 deletions

tests/Mods/Reader/AccessConditionReaderTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ public function getNoAccessConditionsByQueryForSerialDocument()
128128
self::assertEmpty($accessConditions);
129129
}
130130

131-
private static function assertAccessConditionForBookDocument(AccessCondition $accessCondition)
131+
private static function assertAccessConditionForBookDocument(AccessCondition $accessCondition): void
132132
{
133133
self::assertNotEmpty($accessCondition->getValue());
134134
self::assertEquals('Use of this public-domain resource is unrestricted.', $accessCondition->getValue());
@@ -138,7 +138,7 @@ private static function assertAccessConditionForBookDocument(AccessCondition $ac
138138
self::assertEmpty($accessCondition->getXlinkHref());
139139
}
140140

141-
private static function assertAccessConditionForSerialDocument(AccessCondition $accessCondition)
141+
private static function assertAccessConditionForSerialDocument(AccessCondition $accessCondition): void
142142
{
143143
self::assertNotEmpty($accessCondition->getValue());
144144
self::assertEquals('Open Access', $accessCondition->getValue());

tests/Mods/Reader/ClassificationReaderTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ public function getNoClassificationsByQueryForSerialDocument()
117117
self::assertEmpty($classifications);
118118
}
119119

120-
private static function assertFirstClassificationForBookDocument(Classification $classification)
120+
private static function assertFirstClassificationForBookDocument(Classification $classification): void
121121
{
122122
self::assertNotEmpty($classification->getValue());
123123
self::assertEquals('PN4888.P6 A48 1999', $classification->getValue());
@@ -127,7 +127,7 @@ private static function assertFirstClassificationForBookDocument(Classification
127127
self::assertEmpty($classification->getUsage());
128128
}
129129

130-
private static function assertSecondClassificationForBookDocument(Classification $classification)
130+
private static function assertSecondClassificationForBookDocument(Classification $classification): void
131131
{
132132
self::assertNotEmpty($classification->getValue());
133133
self::assertEquals('071/.3', $classification->getValue());
@@ -137,7 +137,7 @@ private static function assertSecondClassificationForBookDocument(Classification
137137
self::assertEmpty($classification->getGenerator());
138138
}
139139

140-
private static function assertClassificationForSerialDocument(Classification $classification)
140+
private static function assertClassificationForSerialDocument(Classification $classification): void
141141
{
142142
self::assertNotEmpty($classification->getValue());
143143
self::assertEquals('027.7/05', $classification->getValue());

tests/Mods/Reader/GenreReaderTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ public function getNoGenresByQueryForSerialDocument()
156156
self::assertEmpty($genres);
157157
}
158158

159-
private static function assertGenreForBookDocument(Genre $genre)
159+
private static function assertGenreForBookDocument(Genre $genre): void
160160
{
161161
self::assertNotEmpty($genre->getValue());
162162
self::assertEquals('bibliography', $genre->getValue());
@@ -166,7 +166,7 @@ private static function assertGenreForBookDocument(Genre $genre)
166166
self::assertEmpty($genre->getScript());
167167
}
168168

169-
private static function assertFirstGenreForSerialDocument(Genre $genre)
169+
private static function assertFirstGenreForSerialDocument(Genre $genre): void
170170
{
171171
self::assertNotEmpty($genre->getValue());
172172
self::assertEquals('periodical', $genre->getValue());
@@ -176,7 +176,7 @@ private static function assertFirstGenreForSerialDocument(Genre $genre)
176176
self::assertEmpty($genre->getTransliteration());
177177
}
178178

179-
private static function assertSecondGenreForSerialDocument(Genre $genre)
179+
private static function assertSecondGenreForSerialDocument(Genre $genre): void
180180
{
181181
self::assertNotEmpty($genre->getValue());
182182
self::assertEquals('series', $genre->getValue());

tests/Mods/Reader/IdentifierReaderTest.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ public function getNoLastIdentifierByQueryForSerialDocument()
198198
self::assertNull($identifier);
199199
}
200200

201-
private static function assertFirstIdentifierForBookDocument(Identifier $identifier)
201+
private static function assertFirstIdentifierForBookDocument(Identifier $identifier): void
202202
{
203203
self::assertNotEmpty($identifier->getValue());
204204
self::assertEquals('0801486394 (pbk. : acid-free, recycled paper)', $identifier->getValue());
@@ -209,7 +209,7 @@ private static function assertFirstIdentifierForBookDocument(Identifier $identif
209209
self::assertFalse($identifier->isInvalid());
210210
}
211211

212-
private static function assertSecondIdentifierForBookDocument(Identifier $identifier)
212+
private static function assertSecondIdentifierForBookDocument(Identifier $identifier): void
213213
{
214214
self::assertNotEmpty($identifier->getValue());
215215
self::assertEquals('99042030', $identifier->getValue());
@@ -220,7 +220,7 @@ private static function assertSecondIdentifierForBookDocument(Identifier $identi
220220
self::assertFalse($identifier->isInvalid());
221221
}
222222

223-
private static function assertFirstIdentifierForSerialDocument(Identifier $identifier)
223+
private static function assertFirstIdentifierForSerialDocument(Identifier $identifier): void
224224
{
225225
self::assertNotEmpty($identifier->getValue());
226226
self::assertEquals('1704-8532', $identifier->getValue());
@@ -231,7 +231,7 @@ private static function assertFirstIdentifierForSerialDocument(Identifier $ident
231231
self::assertFalse($identifier->isInvalid());
232232
}
233233

234-
private static function assertSecondIdentifierForSerialDocument(Identifier $identifier)
234+
private static function assertSecondIdentifierForSerialDocument(Identifier $identifier): void
235235
{
236236
self::assertNotEmpty($identifier->getValue());
237237
self::assertEquals('1525-321X', $identifier->getValue());
@@ -242,7 +242,7 @@ private static function assertSecondIdentifierForSerialDocument(Identifier $iden
242242
self::assertTrue($identifier->isInvalid());
243243
}
244244

245-
private static function assertThirdIdentifierForSerialDocument(Identifier $identifier)
245+
private static function assertThirdIdentifierForSerialDocument(Identifier $identifier): void
246246
{
247247
self::assertNotEmpty($identifier->getValue());
248248
self::assertEquals('cn2002301668', $identifier->getValue());
@@ -253,7 +253,7 @@ private static function assertThirdIdentifierForSerialDocument(Identifier $ident
253253
self::assertFalse($identifier->isInvalid());
254254
}
255255

256-
private static function assertFourthIdentifierForSerialDocument(Identifier $identifier)
256+
private static function assertFourthIdentifierForSerialDocument(Identifier $identifier): void
257257
{
258258
self::assertNotEmpty($identifier->getValue());
259259
self::assertEquals('ocm51090366', $identifier->getValue());

tests/Mods/Reader/LanguageReaderTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ public function getNoLanguagesByQueryForSerialDocument()
135135
self::assertEmpty($languages);
136136
}
137137

138-
private static function assertFirstLanguageForBookDocument(Language $language)
138+
private static function assertFirstLanguageForBookDocument(Language $language): void
139139
{
140140
self::assertEmpty($language->getObjectPart());
141141
self::assertNotEmpty($language->getValue());
@@ -154,7 +154,7 @@ private static function assertFirstLanguageForBookDocument(Language $language)
154154
self::assertEquals('Latn', $scriptTerms[0]->getValue());
155155
}
156156

157-
private static function assertSecondLanguageForBookDocument(Language $language)
157+
private static function assertSecondLanguageForBookDocument(Language $language): void
158158
{
159159
self::assertNotEmpty($language->getObjectPart());
160160
self::assertEquals('summary', $language->getObjectPart());
@@ -168,13 +168,13 @@ private static function assertSecondLanguageForBookDocument(Language $language)
168168
self::assertEquals('spa', $languageTerms[0]->getValue());
169169

170170
$scriptTerms = $language->getScriptTerms();
171-
self::assertNotEmpty($language->getScriptTerms());
171+
self::assertNotEmpty($scriptTerms);
172172
self::assertEquals('code', $scriptTerms[0]->getType());
173173
self::assertEquals('iso15924', $scriptTerms[0]->getAuthority());
174174
self::assertEquals('Latn', $scriptTerms[0]->getValue());
175175
}
176176

177-
private static function assertLanguageForSerialDocument(Language $language)
177+
private static function assertLanguageForSerialDocument(Language $language): void
178178
{
179179
self::assertEmpty($language->getObjectPart());
180180
self::assertNotEmpty($language->getValue());

tests/Mods/Reader/LocationReaderTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ public function getNoLocationsByQueryForSerialDocument()
139139
self::assertEmpty($locations);
140140
}
141141

142-
private static function assertFirstLocationForBookDocument(Location $location)
142+
private static function assertFirstLocationForBookDocument(Location $location): void
143143
{
144144
self::assertNotEmpty($location->getValue());
145145

@@ -161,7 +161,7 @@ private static function assertFirstLocationForBookDocument(Location $location)
161161
self::assertEquals('v.1-v.2 1999-2002', $copyInformation[0]->getEnumerationAndChronologies()[0]->getValue());
162162
}
163163

164-
private static function assertSecondLocationForBookDocument(Location $location)
164+
private static function assertSecondLocationForBookDocument(Location $location): void
165165
{
166166
self::assertNotEmpty($location->getValue());
167167

@@ -174,7 +174,7 @@ private static function assertSecondLocationForBookDocument(Location $location)
174174
self::assertEquals('http://www.slub-dresden.de/some-url/SLO-0000', $urls[1]->getValue());
175175
}
176176

177-
private static function assertLocationForSerialDocument(Location $location)
177+
private static function assertLocationForSerialDocument(Location $location): void
178178
{
179179
$urls = $location->getUrls();
180180
self::assertNotEmpty($urls);

tests/Mods/Reader/NameReaderTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ public function getNoNamesByQueryForSerialDocument()
135135
self::assertEmpty($names);
136136
}
137137

138-
private static function assertFirstNameForBookDocument(Name $name)
138+
private static function assertFirstNameForBookDocument(Name $name): void
139139
{
140140
self::assertNotEmpty($name->getType());
141141
self::assertEquals('personal', $name->getType());
@@ -157,7 +157,7 @@ private static function assertFirstNameForBookDocument(Name $name)
157157
self::assertEquals('creator', $roleTerms[0]->getValue());
158158
}
159159

160-
private static function assertSecondNameForBookDocument(Name $name)
160+
private static function assertSecondNameForBookDocument(Name $name): void
161161
{
162162
self::assertNotEmpty($name->getType());
163163
self::assertEquals('personal', $name->getType());
@@ -180,7 +180,7 @@ private static function assertSecondNameForBookDocument(Name $name)
180180
self::assertEquals('author', $roleTerms[0]->getValue());
181181
}
182182

183-
private static function assertNameForSerialDocument(Name $name)
183+
private static function assertNameForSerialDocument(Name $name): void
184184
{
185185
self::assertNotEmpty($name->getValue());
186186

tests/Mods/Reader/NoteReaderTest.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -156,39 +156,39 @@ public function getNoNotesByQueryForSerialDocument()
156156
self::assertEmpty($notes);
157157
}
158158

159-
private static function assertFirstNoteForBookDocument(Note $note)
159+
private static function assertFirstNoteForBookDocument(Note $note): void
160160
{
161161
self::assertNotEmpty($note->getValue());
162162
self::assertEquals('Eric Alterman.', $note->getValue());
163163
self::assertNotEmpty($note->getType());
164164
self::assertEquals('statement of responsibility', $note->getType());
165165
}
166166

167-
private static function assertSecondNoteForBookDocument(Note $note)
167+
private static function assertSecondNoteForBookDocument(Note $note): void
168168
{
169169
self::assertNotEmpty($note->getValue());
170170
self::assertEquals('Includes bibliographical references (p. 291-312) and index.', $note->getValue());
171171
self::assertNotEmpty($note->getType());
172172
self::assertEquals('bibliography', $note->getType());
173173
}
174174

175-
private static function assertFirstNoteForSerialDocument(Note $note)
175+
private static function assertFirstNoteForSerialDocument(Note $note): void
176176
{
177177
self::assertNotEmpty($note->getValue());
178178
self::assertEquals('V. 3, no. 1/2 (winter 2002)-', $note->getValue());
179179
self::assertNotEmpty($note->getType());
180180
self::assertEquals('date/sequential designation', $note->getType());
181181
}
182182

183-
private static function assertFifthNoteForSerialDocument(Note $note)
183+
private static function assertFifthNoteForSerialDocument(Note $note): void
184184
{
185185
self::assertNotEmpty($note->getValue());
186186
self::assertEquals('Mode of access: World Wide Web.', $note->getValue());
187187
self::assertNotEmpty($note->getType());
188188
self::assertEquals('system details', $note->getType());
189189
}
190190

191-
private static function assertSixthNoteForSerialDocument(Note $note)
191+
private static function assertSixthNoteForSerialDocument(Note $note): void
192192
{
193193
self::assertNotEmpty($note->getValue());
194194
self::assertEquals('Electronic serial in HTML format.', $note->getValue());

tests/Mods/Reader/OriginInfoReaderTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ public function getNoOriginInfosByQueryForSerialDocument()
120120
self::assertEmpty($originInfos);
121121
}
122122

123-
private static function assertFirstOriginInfoForBookDocument(OriginInfo $originInfo)
123+
private static function assertFirstOriginInfoForBookDocument(OriginInfo $originInfo): void
124124
{
125125
self::assertNotEmpty($originInfo->getValue());
126126
self::assertNotEmpty($originInfo->getEventType());
@@ -147,7 +147,7 @@ private static function assertFirstOriginInfoForBookDocument(OriginInfo $originI
147147
self::assertEquals('monographic', $issuances[0]->getValue());
148148
}
149149

150-
private static function assertSecondOriginInfoForBookDocument(OriginInfo $originInfo)
150+
private static function assertSecondOriginInfoForBookDocument(OriginInfo $originInfo): void
151151
{
152152
self::assertNotEmpty($originInfo->getValue());
153153
self::assertNotEmpty($originInfo->getEventType());
@@ -171,7 +171,7 @@ private static function assertSecondOriginInfoForBookDocument(OriginInfo $origin
171171
self::assertEmpty($originInfo->getIssuances());
172172
}
173173

174-
private static function assertOriginInfoForSerialDocument(OriginInfo $originInfo)
174+
private static function assertOriginInfoForSerialDocument(OriginInfo $originInfo): void
175175
{
176176
self::assertNotEmpty($originInfo->getValue());
177177
self::assertNotEmpty($originInfo->getEventType());

tests/Mods/Reader/PartReaderTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ public function getNoPartsForSerialDocument()
9696
self::assertEmpty($parts);
9797
}
9898

99-
private static function assertFirstPartForBookDocument(Part $part)
99+
private static function assertFirstPartForBookDocument(Part $part): void
100100
{
101101
self::assertNotEmpty($part->getValue());
102102
self::assertNotEmpty($part->getType());
@@ -127,7 +127,7 @@ private static function assertFirstPartForBookDocument(Part $part)
127127
self::assertEquals('Some random text', $texts[0]->getValue());
128128
}
129129

130-
private static function assertSecondPartForBookDocument(Part $part)
130+
private static function assertSecondPartForBookDocument(Part $part): void
131131
{
132132
self::assertNotEmpty($part->getValue());
133133
self::assertNotEmpty($part->getType());

0 commit comments

Comments
 (0)