From cb57ab71234ba9d13120ee6ad0737538f979a32a Mon Sep 17 00:00:00 2001 From: Davide Vacca Date: Thu, 6 Jun 2024 11:26:15 +0200 Subject: [PATCH] Fix and improve tests after library referesh --- test/Resource/ApplicantsTest.php | 2 +- test/Resource/ReportSchemasTest.php | 16 ++++++++++++++-- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/test/Resource/ApplicantsTest.php b/test/Resource/ApplicantsTest.php index 00e6185..1084253 100644 --- a/test/Resource/ApplicantsTest.php +++ b/test/Resource/ApplicantsTest.php @@ -51,7 +51,7 @@ public function testCreateApplicant() public function testListApplicants() { - $listOfApplicants = self::$onfido->listApplicants()['applicants']; + $listOfApplicants = self::$onfido->listApplicants()->getApplicants(); $this->assertGreaterThan(0, sizeOf($listOfApplicants)); } diff --git a/test/Resource/ReportSchemasTest.php b/test/Resource/ReportSchemasTest.php index 1bb85a2..13a98a2 100644 --- a/test/Resource/ReportSchemasTest.php +++ b/test/Resource/ReportSchemasTest.php @@ -36,9 +36,15 @@ public function testSchemaOfDocumentReportIsValid(): void $this->findReportFn, [$documentReportId], ReportStatus::COMPLETE - )->getActualInstance(); + ); $this->assertInstanceOf(DocumentReport::class, $documentReport); + + $this->assertSame($documentReport->getName(), "document"); + $this->assertSame($documentReport->getBreakdown()->getDataComparison() + ->getBreakdown()->getIssuingCountry()->getResult(), "clear"); + $this->assertSame($documentReport->getProperties() + ->getDateOfBirth()->format('Y-m-d'), "1990-01-01"); } public function testSchemaOfFacialSimilarityReportIsValid(): void @@ -55,12 +61,18 @@ public function testSchemaOfFacialSimilarityReportIsValid(): void $this->findReportFn, [$facialSimilarityReportId], ReportStatus::COMPLETE - )->getActualInstance(); + ); $this->assertInstanceOf( FacialSimilarityPhotoReport::class, $facialSimilarityReport ); + + $this->assertSame($facialSimilarityReport->getName(), "facial_similarity_photo"); + $this->assertSame($facialSimilarityReport->getBreakdown()->getFaceComparison() + ->getBreakdown()->getFaceMatch()->getResult(), "clear"); + $this->assertSame($facialSimilarityReport->getBreakdown()->getVisualAuthenticity() + ->getBreakdown()->getSpoofingDetection()->getProperties()->getScore(), 0.9512); } }