Skip to content

Commit

Permalink
Fix and improve tests after library referesh
Browse files Browse the repository at this point in the history
  • Loading branch information
dvacca-onfido committed Jun 6, 2024
1 parent c4144a4 commit cb57ab7
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
2 changes: 1 addition & 1 deletion test/Resource/ApplicantsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}

Expand Down
16 changes: 14 additions & 2 deletions test/Resource/ReportSchemasTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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);
}
}

Expand Down

0 comments on commit cb57ab7

Please sign in to comment.