diff --git a/tests/Mods/Reader/AccessConditionReaderTest.php b/tests/Mods/Reader/AccessConditionReaderTest.php index 10afdbe..f77573c 100644 --- a/tests/Mods/Reader/AccessConditionReaderTest.php +++ b/tests/Mods/Reader/AccessConditionReaderTest.php @@ -28,7 +28,7 @@ public function getAccessConditionsForBookDocument() { $accessConditions = $this->bookReader->getAccessConditions(); self::assertNotEmpty($accessConditions); - self::assertEquals(1, count($accessConditions)); + self::assertCount(1, $accessConditions); self::assertAccessConditionForBookDocument($accessConditions[0]); } @@ -66,7 +66,7 @@ public function getAccessConditionsByQueryForBookDocument() { $accessConditions = $this->bookReader->getAccessConditions('[@type="use and reproduction"]'); self::assertNotEmpty($accessConditions); - self::assertEquals(1, count($accessConditions)); + self::assertCount(1, $accessConditions); self::assertAccessConditionForBookDocument($accessConditions[0]); } @@ -131,7 +131,7 @@ public function getAccessConditionsForSerialDocument() { $accessConditions = $this->serialReader->getAccessConditions(); self::assertNotEmpty($accessConditions); - self::assertEquals(1, count($accessConditions)); + self::assertCount(1, $accessConditions); self::assertAccessConditionForSerialDocument($accessConditions[0]); } @@ -142,7 +142,7 @@ public function getAccessConditionsByQueryForSerialDocument() { $accessConditions = $this->serialReader->getAccessConditions('[@type="restriction on access"]'); self::assertNotEmpty($accessConditions); - self::assertEquals(1, count($accessConditions)); + self::assertCount(1, $accessConditions); self::assertAccessConditionForSerialDocument($accessConditions[0]); } diff --git a/tests/Mods/Reader/ClassificationReaderTest.php b/tests/Mods/Reader/ClassificationReaderTest.php index 36058f1..1a10ebd 100644 --- a/tests/Mods/Reader/ClassificationReaderTest.php +++ b/tests/Mods/Reader/ClassificationReaderTest.php @@ -28,7 +28,7 @@ public function getClassificationsForBookDocument() { $classifications = $this->bookReader->getClassifications(); self::assertNotEmpty($classifications); - self::assertEquals(2, count($classifications)); + self::assertCount(2, $classifications); self::assertFirstClassificationForBookDocument($classifications[0]); } @@ -66,7 +66,7 @@ public function getClassificationsByQueryForBookDocument() { $classifications = $this->bookReader->getClassifications('[@authority="ddc"]'); self::assertNotEmpty($classifications); - self::assertEquals(1, count($classifications)); + self::assertCount(1, $classifications); self::assertSecondClassificationForBookDocument($classifications[0]); } @@ -116,7 +116,7 @@ public function getClassificationsForSerialDocument() { $classifications = $this->serialReader->getClassifications(); self::assertNotEmpty($classifications); - self::assertEquals(1, count($classifications)); + self::assertCount(1, $classifications); self::assertClassificationForSerialDocument($classifications[0]); } @@ -127,7 +127,7 @@ public function getClassificationsByQueryForSerialDocument() { $classifications = $this->serialReader->getClassifications('[@authority="ddc"]'); self::assertNotEmpty($classifications); - self::assertEquals(1, count($classifications)); + self::assertCount(1, $classifications); self::assertClassificationForSerialDocument($classifications[0]); } diff --git a/tests/Mods/Reader/GenreReaderTest.php b/tests/Mods/Reader/GenreReaderTest.php index 056092b..f4385b6 100644 --- a/tests/Mods/Reader/GenreReaderTest.php +++ b/tests/Mods/Reader/GenreReaderTest.php @@ -28,7 +28,7 @@ public function getGenresForBookDocument() { $genres = $this->bookReader->getGenres(); self::assertNotEmpty($genres); - self::assertEquals(1, count($genres)); + self::assertCount(1, $genres); self::assertGenreForBookDocument($genres[0]); } @@ -66,7 +66,7 @@ public function getGenresByQueryForBookDocument() { $genres = $this->bookReader->getGenres('[@authority="marcgt"]'); self::assertNotEmpty($genres); - self::assertEquals(1, count($genres)); + self::assertCount(1, $genres); self::assertGenreForBookDocument($genres[0]); } @@ -140,7 +140,7 @@ public function getGenresForSerialDocument() { $genres = $this->serialReader->getGenres(); self::assertNotEmpty($genres); - self::assertEquals(2, count($genres)); + self::assertCount(2, $genres); self::assertFirstGenreForSerialDocument($genres[0]); } @@ -178,7 +178,7 @@ public function getGenresByQueryForSerialDocument() { $genres = $this->serialReader->getGenres('[@usage="primary"]'); self::assertNotEmpty($genres); - self::assertEquals(1, count($genres)); + self::assertCount(1, $genres); self::assertFirstGenreForSerialDocument($genres[0]); } diff --git a/tests/Mods/Reader/IdentifierReaderTest.php b/tests/Mods/Reader/IdentifierReaderTest.php index 6977cd7..a1f83ae 100644 --- a/tests/Mods/Reader/IdentifierReaderTest.php +++ b/tests/Mods/Reader/IdentifierReaderTest.php @@ -28,7 +28,7 @@ public function getIdentifiersForBookDocument() { $identifiers = $this->bookReader->getIdentifiers(); self::assertNotEmpty($identifiers); - self::assertEquals(2, count($identifiers)); + self::assertCount(2, $identifiers); self::assertFirstIdentifierForBookDocument($identifiers[0]); } @@ -66,7 +66,7 @@ public function getIdentifiersByQueryForBookDocument() { $identifiers = $this->bookReader->getIdentifiers('[@type="lccn"]'); self::assertNotEmpty($identifiers); - self::assertEquals(1, count($identifiers)); + self::assertCount(1, $identifiers); self::assertSecondIdentifierForBookDocument($identifiers[0]); } @@ -140,7 +140,7 @@ public function getIdentifiersForSerialDocument() { $identifiers = $this->serialReader->getIdentifiers(); self::assertNotEmpty($identifiers); - self::assertEquals(4, count($identifiers)); + self::assertCount(4, $identifiers); self::assertFirstIdentifierForSerialDocument($identifiers[0]); } @@ -178,7 +178,7 @@ public function getIdentifiersByQueryForSerialDocument() { $identifiers = $this->serialReader->getIdentifiers('[@type="issn"]'); self::assertNotEmpty($identifiers); - self::assertEquals(2, count($identifiers)); + self::assertCount(2, $identifiers); self::assertSecondIdentifierForSerialDocument($identifiers[1]); } diff --git a/tests/Mods/Reader/LanguageReaderTest.php b/tests/Mods/Reader/LanguageReaderTest.php index f3dd2c4..34767db 100644 --- a/tests/Mods/Reader/LanguageReaderTest.php +++ b/tests/Mods/Reader/LanguageReaderTest.php @@ -28,7 +28,7 @@ public function getLanguagesForBookDocument() { $languages = $this->bookReader->getLanguages(); self::assertNotEmpty($languages); - self::assertEquals(2, count($languages)); + self::assertCount(2, $languages); self::assertFirstLanguageForBookDocument($languages[0]); } @@ -66,7 +66,7 @@ public function getLanguagesByQueryForBookDocument() { $languages = $this->bookReader->getLanguages('[@objectPart="summary"]'); self::assertNotEmpty($languages); - self::assertEquals(1, count($languages)); + self::assertCount(1, $languages); self::assertSecondLanguageForBookDocument($languages[0]); } @@ -140,7 +140,7 @@ public function getLanguagesForSerialDocument() { $languages = $this->serialReader->getLanguages(); self::assertNotEmpty($languages); - self::assertEquals(1, count($languages)); + self::assertCount(1, $languages); self::assertLanguageForSerialDocument($languages[0]); } @@ -151,7 +151,7 @@ public function getLanguagesByQueryForSerialDocument() { $languages = $this->serialReader->getLanguages('[./mods:languageTerm[@type="code"]]'); self::assertNotEmpty($languages); - self::assertEquals(1, count($languages)); + self::assertCount(1, $languages); self::assertLanguageForSerialDocument($languages[0]); } diff --git a/tests/Mods/Reader/LocationReaderTest.php b/tests/Mods/Reader/LocationReaderTest.php index 48101a8..25946f9 100644 --- a/tests/Mods/Reader/LocationReaderTest.php +++ b/tests/Mods/Reader/LocationReaderTest.php @@ -29,7 +29,7 @@ public function getLocationsForBookDocument() { $locations = $this->bookReader->getLocations(); self::assertNotEmpty($locations); - self::assertEquals(2, count($locations)); + self::assertCount(2, $locations); self::assertFirstLocationForBookDocument($locations[0]); } @@ -67,7 +67,7 @@ public function getLocationsByQueryForBookDocument() { $locations = $this->bookReader->getLocations('[@displayLabel="links"]'); self::assertNotEmpty($locations); - self::assertEquals(1, count($locations)); + self::assertCount(1, $locations); self::assertSecondLocationForBookDocument($locations[0]); $this->expectException(IncorrectValueInAttributeException::class); @@ -144,7 +144,7 @@ public function getLocationsForSerialDocument() { $locations = $this->serialReader->getLocations(); self::assertNotEmpty($locations); - self::assertEquals(2, count($locations)); + self::assertCount(2, $locations); self::assertLocationForSerialDocument($locations[0]); } @@ -155,7 +155,7 @@ public function getLocationsByQueryForSerialDocument() { $locations = $this->serialReader->getLocations('[./mods:url[@usage="primaryDisplay"]]'); self::assertNotEmpty($locations); - self::assertEquals(1, count($locations)); + self::assertCount(1, $locations); self::assertLocationForSerialDocument($locations[0]); } @@ -196,7 +196,7 @@ private static function assertSecondLocationForBookDocument(Location $location) $urls = $location->getUrls(); self::assertNotEmpty($urls); - self::assertEquals(4, count($urls)); + self::assertCount(4, $urls); self::assertEquals('2024-01-27', $urls[0]->getDateLastAccessed()); self::assertEquals('http://www.slub-dresden.de/some-url', $urls[0]->getValue()); self::assertEquals('preview', $urls[1]->getAccess()); diff --git a/tests/Mods/Reader/NameReaderTest.php b/tests/Mods/Reader/NameReaderTest.php index 97521e2..b0c6716 100644 --- a/tests/Mods/Reader/NameReaderTest.php +++ b/tests/Mods/Reader/NameReaderTest.php @@ -28,7 +28,7 @@ public function getNamesForBookDocument() { $names = $this->bookReader->getNames(); self::assertNotEmpty($names); - self::assertEquals(2, count($names)); + self::assertCount(2, $names); self::assertFirstNameForBookDocument($names[0]); } @@ -66,7 +66,7 @@ public function getNamesByQueryForBookDocument() { $names = $this->bookReader->getNames('[@type="personal" and not(@usage="primary")]'); self::assertNotEmpty($names); - self::assertEquals(1, count($names)); + self::assertCount(1, $names); self::assertSecondNameForBookDocument($names[0]); } @@ -140,7 +140,7 @@ public function getNamesForSerialDocument() { $names = $this->serialReader->getNames(); self::assertNotEmpty($names); - self::assertEquals(1, count($names)); + self::assertCount(1, $names); self::assertNameForSerialDocument($names[0]); } @@ -151,7 +151,7 @@ public function getNamesByQueryForSerialDocument() { $names = $this->serialReader->getNames('[@type="corporate"]'); self::assertNotEmpty($names); - self::assertEquals(1, count($names)); + self::assertCount(1, $names); self::assertNameForSerialDocument($names[0]); } @@ -194,8 +194,8 @@ private static function assertSecondNameForBookDocument(Name $name) self::assertNotEmpty($name->getValue()); $nameParts = $name->getNameParts(); - self::assertNotEmpty($name->getNameParts()); - self::assertEquals(2, count($nameParts)); + self::assertNotEmpty($nameParts); + self::assertCount(2, $nameParts); self::assertEquals('given', $nameParts[0]->getType()); self::assertEquals('Aron', $nameParts[0]->getValue()); @@ -214,8 +214,8 @@ private static function assertNameForSerialDocument(Name $name) self::assertNotEmpty($name->getValue()); $nameParts = $name->getNameParts(); - self::assertNotEmpty($name->getNameParts()); - self::assertEquals(1, count($nameParts)); + self::assertNotEmpty($nameParts); + self::assertCount(1, $nameParts); self::assertEquals('International Consortium for the Advancement of Academic Publication.', $nameParts[0]->getValue()); } } diff --git a/tests/Mods/Reader/NoteReaderTest.php b/tests/Mods/Reader/NoteReaderTest.php index 894bb75..10197b9 100644 --- a/tests/Mods/Reader/NoteReaderTest.php +++ b/tests/Mods/Reader/NoteReaderTest.php @@ -28,7 +28,7 @@ public function getNotesForBookDocument() { $notes = $this->bookReader->getNotes(); self::assertNotEmpty($notes); - self::assertEquals(2, count($notes)); + self::assertCount(2, $notes); self::assertFirstNoteForBookDocument($notes[0]); } @@ -66,7 +66,7 @@ public function getNotesByQueryForBookDocument() { $notes = $this->bookReader->getNotes('[@type="bibliography"]'); self::assertNotEmpty($notes); - self::assertEquals(1, count($notes)); + self::assertCount(1, $notes); self::assertSecondNoteForBookDocument($notes[0]); } @@ -140,7 +140,7 @@ public function getNotesForSerialDocument() { $notes = $this->serialReader->getNotes(); self::assertNotEmpty($notes); - self::assertEquals(6, count($notes)); + self::assertCount(6, $notes); self::assertFirstNoteForSerialDocument($notes[0]); } @@ -178,7 +178,7 @@ public function getNotesByQueryForSerialDocument() { $notes = $this->serialReader->getNotes('[@type="system details"]'); self::assertNotEmpty($notes); - self::assertEquals(1, count($notes)); + self::assertCount(1, $notes); self::assertFifthNoteForSerialDocument($notes[0]); } diff --git a/tests/Mods/Reader/OriginInfoReaderTest.php b/tests/Mods/Reader/OriginInfoReaderTest.php index 9fa435d..e949a46 100644 --- a/tests/Mods/Reader/OriginInfoReaderTest.php +++ b/tests/Mods/Reader/OriginInfoReaderTest.php @@ -28,7 +28,7 @@ public function getOriginInfosForBookDocument() { $originInfos = $this->bookReader->getOriginInfos(); self::assertNotEmpty($originInfos); - self::assertEquals(2, count($originInfos)); + self::assertCount(2, $originInfos); self::assertFirstOriginInfoForBookDocument($originInfos[0]); } @@ -66,7 +66,7 @@ public function getOriginInfosByQueryForBookDocument() { $originInfos = $this->bookReader->getOriginInfos('[@eventType="redaction"]'); self::assertNotEmpty($originInfos); - self::assertEquals(1, count($originInfos)); + self::assertCount(1, $originInfos); self::assertSecondOriginInfoForBookDocument($originInfos[0]); } @@ -119,7 +119,7 @@ public function getOriginInfosForSerialDocument() { $originInfos = $this->serialReader->getOriginInfos(); self::assertNotEmpty($originInfos); - self::assertEquals(1, count($originInfos)); + self::assertCount(1, $originInfos); self::assertOriginInfoForSerialDocument($originInfos[0]); } @@ -130,7 +130,7 @@ public function getOriginInfosByQueryForSerialDocument() { $originInfos = $this->serialReader->getOriginInfos('[@eventType="publication"]'); self::assertNotEmpty($originInfos); - self::assertEquals(1, count($originInfos)); + self::assertCount(1, $originInfos); self::assertOriginInfoForSerialDocument($originInfos[0]); } @@ -151,7 +151,7 @@ private static function assertFirstOriginInfoForBookDocument(OriginInfo $originI $places = $originInfo->getPlaces(); self::assertNotEmpty($places); - self::assertEquals(2, count($places)); + self::assertCount(2, $places); $placeTerms = $places[0]->getPlaceTerms(); self::assertNotEmpty($placeTerms); @@ -161,7 +161,7 @@ private static function assertFirstOriginInfoForBookDocument(OriginInfo $originI $issuedDates = $originInfo->getIssuedDates(); self::assertNotEmpty($issuedDates); - self::assertEquals(2, count($issuedDates)); + self::assertCount(2, $issuedDates); self::assertEquals('marc', $issuedDates[0]->getEncoding()); self::assertEquals('2000', $issuedDates[0]->getValue()); @@ -178,7 +178,7 @@ private static function assertSecondOriginInfoForBookDocument(OriginInfo $origin $places = $originInfo->getPlaces(); self::assertNotEmpty($places); - self::assertEquals(2, count($places)); + self::assertCount(2, $places); $placeTerms = $places[1]->getPlaceTerms(); self::assertNotEmpty($placeTerms); @@ -187,7 +187,7 @@ private static function assertSecondOriginInfoForBookDocument(OriginInfo $origin $issuedDates = $originInfo->getIssuedDates(); self::assertNotEmpty($issuedDates); - self::assertEquals(2, count($issuedDates)); + self::assertCount(2, $issuedDates); self::assertEquals('marc', $issuedDates[0]->getEncoding()); self::assertEquals('1999', $issuedDates[0]->getValue()); @@ -202,7 +202,7 @@ private static function assertOriginInfoForSerialDocument(OriginInfo $originInfo $places = $originInfo->getPlaces(); self::assertNotEmpty($places); - self::assertEquals(2, count($places)); + self::assertCount(2, $places); $placeTerms = $places[0]->getPlaceTerms(); self::assertNotEmpty($placeTerms); @@ -212,7 +212,7 @@ private static function assertOriginInfoForSerialDocument(OriginInfo $originInfo $issuedDates = $originInfo->getIssuedDates(); self::assertNotEmpty($issuedDates); - self::assertEquals(3, count($issuedDates)); + self::assertCount(3, $issuedDates); self::assertEquals('marc', $issuedDates[0]->getEncoding()); self::assertEquals('start', $issuedDates[0]->getPoint()); self::assertEquals('2002', $issuedDates[0]->getValue()); @@ -223,7 +223,7 @@ private static function assertOriginInfoForSerialDocument(OriginInfo $originInfo $frequencies = $originInfo->getFrequencies(); self::assertNotEmpty($frequencies); - self::assertEquals(2, count($frequencies)); + self::assertCount(2, $frequencies); self::assertEquals('Three times a year', $frequencies[0]->getValue()); $agents = $originInfo->getAgents(); diff --git a/tests/Mods/Reader/PartReaderTest.php b/tests/Mods/Reader/PartReaderTest.php index 7a00b4f..2d00b14 100644 --- a/tests/Mods/Reader/PartReaderTest.php +++ b/tests/Mods/Reader/PartReaderTest.php @@ -28,7 +28,7 @@ public function getPartsForBookDocument() { $parts = $this->bookReader->getParts(); self::assertNotEmpty($parts); - self::assertEquals(2, count($parts)); + self::assertCount(2, $parts); self::assertFirstPartForBookDocument($parts[0]); } @@ -66,7 +66,7 @@ public function getPartsByQueryForBookDocument() { $parts = $this->bookReader->getParts('[@order="2"]'); self::assertNotEmpty($parts); - self::assertEquals(1, count($parts)); + self::assertCount(1, $parts); self::assertSecondPartForBookDocument($parts[0]); } @@ -156,7 +156,7 @@ private static function assertSecondPartForBookDocument(Part $part) $details = $part->getDetails(); self::assertNotEmpty($details); - self::assertEquals(2, count($details)); + self::assertCount(2, $details); self::assertEquals('begin', $details[0]->getType()); self::assertEquals(1, $details[0]->getLevel()); self::assertNotEmpty($details[0]->getTitles()); diff --git a/tests/Mods/Reader/PhysicalDescriptionReaderTest.php b/tests/Mods/Reader/PhysicalDescriptionReaderTest.php index 8828825..7833bd3 100644 --- a/tests/Mods/Reader/PhysicalDescriptionReaderTest.php +++ b/tests/Mods/Reader/PhysicalDescriptionReaderTest.php @@ -28,7 +28,7 @@ public function getPhysicalDescriptionsForBookDocument() { $physicalDescriptions = $this->bookReader->getPhysicalDescriptions(); self::assertNotEmpty($physicalDescriptions); - self::assertEquals(1, count($physicalDescriptions)); + self::assertCount(1, $physicalDescriptions); self::assertPhysicalDescriptionForBookDocument($physicalDescriptions[0]); } @@ -77,7 +77,7 @@ public function getPhysicalDescriptionsByQueryForBookDocument() { $physicalDescriptions = $this->bookReader->getPhysicalDescriptions('[./mods:form[@authority="marcform"]="print"]'); self::assertNotEmpty($physicalDescriptions); - self::assertEquals(1, count($physicalDescriptions)); + self::assertCount(1, $physicalDescriptions); self::assertPhysicalDescriptionForBookDocument($physicalDescriptions[0]); } @@ -124,7 +124,7 @@ public function getPhysicalDescriptionsForSerialDocument() { $physicalDescriptions = $this->serialReader->getPhysicalDescriptions(); self::assertNotEmpty($physicalDescriptions); - self::assertEquals(1, count($physicalDescriptions)); + self::assertCount(1, $physicalDescriptions); self::assertPhysicalDescriptionForSerialDocument($physicalDescriptions[0]); } @@ -135,7 +135,7 @@ public function getPhysicalDescriptionsByQueryForSerialDocument() { $physicalDescriptions = $this->serialReader->getPhysicalDescriptions('[./mods:form[@authority="marcform"]="electronic"]'); self::assertNotEmpty($physicalDescriptions); - self::assertEquals(1, count($physicalDescriptions)); + self::assertCount(1, $physicalDescriptions); self::assertPhysicalDescriptionForSerialDocument($physicalDescriptions[0]); } @@ -171,7 +171,7 @@ private static function assertPhysicalDescriptionForSerialDocument(PhysicalDescr self::assertNotEmpty($physicalDescription->getForms()); $forms = $physicalDescription->getForms(); - self::assertEquals(2, count($forms)); + self::assertCount(2, $forms); self::assertEquals('gmd', $forms[1]->getAuthority()); self::assertEquals('electronic resource', $forms[1]->getValue()); self::assertNotEmpty($physicalDescription->getInternetMediaTypes()); diff --git a/tests/Mods/Reader/RecordInfoReaderTest.php b/tests/Mods/Reader/RecordInfoReaderTest.php index 1db2a2b..6ce6483 100644 --- a/tests/Mods/Reader/RecordInfoReaderTest.php +++ b/tests/Mods/Reader/RecordInfoReaderTest.php @@ -26,7 +26,7 @@ public function testGetRecordInfosForBookDocument() { $recordInfos = $this->bookReader->getRecordInfos(); self::assertNotEmpty($recordInfos); - self::assertEquals(1, count($recordInfos)); + self::assertCount(1, $recordInfos); self::assertRecordInfoForBookDocument($recordInfos[0]); } @@ -52,7 +52,7 @@ public function testGetRecordInfosByQueryForBookDocument() { $recordInfos = $this->bookReader->getRecordInfos('[./mods:descriptionStandard="aacr"]'); self::assertNotEmpty($recordInfos); - self::assertEquals(1, count($recordInfos)); + self::assertCount(1, $recordInfos); self::assertRecordInfoForBookDocument($recordInfos[0]); } @@ -96,7 +96,7 @@ public function testGetRecordInfosForSerialDocument() { $recordInfos = $this->serialReader->getRecordInfos(); self::assertNotEmpty($recordInfos); - self::assertEquals(1, count($recordInfos)); + self::assertCount(1, $recordInfos); self::assertRecordInfoForSerialDocument($recordInfos[0]); $this->expectException(IncorrectValueInAttributeException::class); @@ -107,7 +107,7 @@ public function testGetRecordInfosByQueryForSerialDocument() { $recordInfos = $this->serialReader->getRecordInfos('[./mods:descriptionStandard="aacr"]'); self::assertNotEmpty($recordInfos); - self::assertEquals(1, count($recordInfos)); + self::assertCount(1, $recordInfos); self::assertRecordInfoForSerialDocument($recordInfos[0]); $this->expectException(IncorrectValueInAttributeException::class); @@ -175,7 +175,7 @@ private static function assertRecordInfoForSerialDocument(RecordInfo $recordInfo $recordInfoNotes = $recordInfo->getRecordInfoNotes(); self::assertNotEmpty($recordInfo->getRecordInfoNotes()); - self::assertEquals(2, count($recordInfoNotes)); + self::assertCount(2, $recordInfoNotes); self::assertEquals('Some info', $recordInfoNotes[1]->getValue()); $languages = $recordInfo->getLanguageOfCatalogings(); diff --git a/tests/Mods/Reader/RelatedItemReaderTest.php b/tests/Mods/Reader/RelatedItemReaderTest.php index 184f0fe..c190422 100644 --- a/tests/Mods/Reader/RelatedItemReaderTest.php +++ b/tests/Mods/Reader/RelatedItemReaderTest.php @@ -64,7 +64,7 @@ public function getRelatedItemsForSerialDocument() { $relatedItems = $this->serialReader->getRelatedItems(); self::assertNotEmpty($relatedItems); - self::assertEquals(1, count($relatedItems)); + self::assertCount(1, $relatedItems); self::assertRelatedItemForSerialDocument($relatedItems[0]); } @@ -102,7 +102,7 @@ public function getRelatedItemsByQueryForSerialDocument() { $relatedItems = $this->serialReader->getRelatedItems('[./mods:identifier="1525-321X"]'); self::assertNotEmpty($relatedItems); - self::assertEquals(1, count($relatedItems)); + self::assertCount(1, $relatedItems); self::assertRelatedItemForSerialDocument($relatedItems[0]); } @@ -125,12 +125,12 @@ private static function assertRelatedItemForSerialDocument(RelatedItem $relatedI // TODO: implement back compatibility for 'publisher' element // self::assertEquals('Journal of southern academic and special librarianship', $relatedItem->getOriginInfos()[0]->getPublisher()); self::assertNotEmpty($relatedItem->getIdentifiers()); - self::assertEquals(4, count($relatedItem->getIdentifiers())); + self::assertCount(4, $relatedItem->getIdentifiers()); self::assertEquals('1525-321X', $relatedItem->getIdentifiers()[0]->getValue()); $localIdentifiers = $relatedItem->getIdentifiers('[@type="local"]'); self::assertNotEmpty($localIdentifiers); - self::assertEquals(3, count($localIdentifiers)); + self::assertCount(3, $localIdentifiers); self::assertEquals('(OCoLC)41477508', $localIdentifiers[0]->getValue()); } } diff --git a/tests/Mods/Reader/SubjectReaderTest.php b/tests/Mods/Reader/SubjectReaderTest.php index 90143ec..18426da 100644 --- a/tests/Mods/Reader/SubjectReaderTest.php +++ b/tests/Mods/Reader/SubjectReaderTest.php @@ -28,7 +28,7 @@ public function getSubjectsForBookDocument() { $subjects = $this->bookReader->getSubjects(); self::assertNotEmpty($subjects); - self::assertEquals(8, count($subjects)); + self::assertCount(8, $subjects); self::assertFirstSubjectForBookDocument($subjects[0]); } @@ -66,7 +66,7 @@ public function getSubjectsByQueryForBookDocument() { $subjects = $this->bookReader->getSubjects('[./mods:topic="Mass media"]'); self::assertNotEmpty($subjects); - self::assertEquals(1, count($subjects)); + self::assertCount(1, $subjects); self::assertFourthSubjectForBookDocument($subjects[0]); } @@ -140,7 +140,7 @@ public function getSubjectsForSerialDocument() { $subjects = $this->serialReader->getSubjects(); self::assertNotEmpty($subjects); - self::assertEquals(7, count($subjects)); + self::assertCount(7, $subjects); self::assertNotEmpty($subjects[0]->getValue()); self::assertNotEmpty($subjects[0]->getCartographics()); @@ -160,7 +160,7 @@ public function getSubjectsByQueryForSerialDocument() { $subjects = $this->serialReader->getSubjects('[./mods:genre="Directories"]'); self::assertNotEmpty($subjects); - self::assertEquals(1, count($subjects)); + self::assertCount(1, $subjects); self::assertNotEmpty($subjects[0]->getValue()); self::assertNotEmpty($subjects[0]->getTopics()); self::assertEquals('Web sites', $subjects[0]->getTopics()[0]->getValue()); @@ -186,7 +186,7 @@ private static function assertFirstSubjectForBookDocument(Subject $subject) $countries = $hierarchicalGeographics[0]->getCountries(); self::assertNotEmpty($countries); - self::assertEquals(2, count($countries)); + self::assertCount(2, $countries); self::assertEquals(1, $countries[0]->getLevel()); self::assertEquals('United Kingdom', $countries[0]->getValue()); self::assertNotEmpty($hierarchicalGeographics[0]->getRegions()); @@ -198,13 +198,14 @@ private static function assertFirstSubjectForBookDocument(Subject $subject) $citySections = $hierarchicalGeographics[0]->getCitySections(); self::assertNotEmpty($citySections); - self::assertEquals(2, count($citySections)); + self::assertCount(2, $citySections); self::assertEquals('neighborhood', $citySections[0]->getType()); self::assertEquals(1, $citySections[0]->getLevel()); self::assertEquals('East Side', $citySections[0]->getValue()); $areas = $hierarchicalGeographics[0]->getAreas(); self::assertNotEmpty($areas); + self::assertCount(1, $areas); self::assertEquals('national park', $areas[0]->getType()); self::assertEquals('Lake District', $areas[0]->getValue()); } diff --git a/tests/Mods/Reader/TableOfContentsReaderTest.php b/tests/Mods/Reader/TableOfContentsReaderTest.php index 6f1aa74..c50b268 100644 --- a/tests/Mods/Reader/TableOfContentsReaderTest.php +++ b/tests/Mods/Reader/TableOfContentsReaderTest.php @@ -28,7 +28,7 @@ public function getTablesOfContentsForBookDocument() { $tablesOfContents = $this->bookReader->getTablesOfContents(); self::assertNotEmpty($tablesOfContents); - self::assertEquals(1, count($tablesOfContents)); + self::assertCount(1, $tablesOfContents); self::assertTableOfContentsForBookDocument($tablesOfContents[0]); } @@ -66,7 +66,7 @@ public function getTablesOfContentsByQueryForBookDocument() { $tablesOfContents = $this->bookReader->getTablesOfContents('[@displayLabel="Chapters"]'); self::assertNotEmpty($tablesOfContents); - self::assertEquals(1, count($tablesOfContents)); + self::assertCount(1, $tablesOfContents); self::assertTableOfContentsForBookDocument($tablesOfContents[0]); } diff --git a/tests/Mods/Reader/TitleInfoReaderTest.php b/tests/Mods/Reader/TitleInfoReaderTest.php index 8138cba..4fc33c7 100644 --- a/tests/Mods/Reader/TitleInfoReaderTest.php +++ b/tests/Mods/Reader/TitleInfoReaderTest.php @@ -27,7 +27,7 @@ public function testGetTitleInfosForBookDocument() { $titleInfos = $this->bookReader->getTitleInfos(); self::assertNotEmpty($titleInfos); - self::assertEquals(2, count($titleInfos)); + self::assertCount(2, $titleInfos); self::assertNotEmpty($titleInfos[0]->getValue()); self::assertEquals('Sound and fury', $titleInfos[0]->getTitle()->getValue()); self::assertEquals('the making of the punditocracy', $titleInfos[0]->getSubTitle()->getValue()); @@ -40,7 +40,7 @@ public function testGetTitleInfosByQueryForBookDocument() { $titleInfos = $this->bookReader->getTitleInfos('[@xml:lang="fr"]'); self::assertNotEmpty($titleInfos); - self::assertEquals(1, count($titleInfos)); + self::assertCount(1, $titleInfos); self::assertNotEmpty($titleInfos[0]->getValue()); self::assertNotEmpty($titleInfos[0]->getType()); self::assertEquals('translated', $titleInfos[0]->getType()); @@ -59,7 +59,7 @@ public function testGetTitleInfosForSerialDocument() { $titleInfos = $this->serialReader->getTitleInfos(); self::assertNotEmpty($titleInfos); - self::assertEquals(3, count($titleInfos)); + self::assertCount(3, $titleInfos); self::assertNotEmpty($titleInfos[0]->getValue()); self::assertNotEmpty($titleInfos[0]->getTitle()); self::assertEquals('E-JASL', $titleInfos[0]->getTitle()->getValue()); @@ -74,7 +74,7 @@ public function testGetTitleInfosByQueryForSerialDocument() { $titleInfos = $this->serialReader->getTitleInfos('[@type="abbreviated"]'); self::assertNotEmpty($titleInfos); - self::assertEquals(1, count($titleInfos)); + self::assertCount(1, $titleInfos); self::assertNotEmpty($titleInfos[0]->getValue()); self::assertEquals('E-JASL', $titleInfos[0]->getTitle()->getValue()); self::assertNotEmpty($titleInfos[0]->getSubTitle());