Skip to content

Commit 633e1a5

Browse files
fix tests
1 parent 32fc36f commit 633e1a5

6 files changed

Lines changed: 19 additions & 19 deletions

File tree

tests/V2/ClientV2Test.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ public function testDocumentGetInferenceAsync(): void
7575
/** @var MindeeApiV2&MockObject $predictable */
7676
$predictable = $this->createMock(MindeeApiV2::class);
7777

78-
$jsonFile = \TestingUtilities::getV2DataDir() . '/products/financial_document/complete.json';
78+
$jsonFile = \TestingUtilities::getV2DataDir() . '/products/extraction/financial_document/complete.json';
7979
$this->assertFileExists($jsonFile, 'Test resource file must exist');
8080

8181
$json = json_decode(file_get_contents($jsonFile), true);
@@ -110,7 +110,7 @@ public function testDocumentGetInferenceAsync(): void
110110

111111
public function testInferenceLoadsLocally(): void
112112
{
113-
$jsonFile = \TestingUtilities::getV2DataDir() . '/products/financial_document/complete.json';
113+
$jsonFile = \TestingUtilities::getV2DataDir() . '/products/extraction/financial_document/complete.json';
114114
$this->assertFileExists($jsonFile, 'Test resource file must exist');
115115

116116
$localResponse = new LocalResponse($jsonFile);

tests/V2/ClientV2TestFunctional.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ public function testDataSchemaMustSucceed(): void {
183183
TestingUtilities::getFileTypesDir() . '/pdf/blank_1.pdf'
184184
);
185185
$dataSchemaReplace = file_get_contents(
186-
TestingUtilities::getV2DataDir() . '/inference/data_schema_replace_param.json'
186+
TestingUtilities::getV2DataDir() . '/products/extraction/data_schema_replace_param.json'
187187
);
188188

189189
$inferenceParams = new InferenceParameters($this->modelId, dataSchema: $dataSchemaReplace);

tests/V2/Input/InferenceParameterTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class InferenceParameterTest extends TestCase
1414
private DataSchema $expectedSchemaObject;
1515

1616
protected function setUp(): void {
17-
$fileContents = file_get_contents(\TestingUtilities::getV2DataDir() . '/inference/data_schema_replace_param.json');
17+
$fileContents = file_get_contents(\TestingUtilities::getV2DataDir() . '/products/extraction/data_schema_replace_param.json');
1818
$this->expectedSchemaString = $fileContents;
1919
$this->expectedSchemaDict = json_decode($fileContents, true);
2020
$this->expectedSchemaObject = new DataSchema($fileContents);

tests/V2/Input/LocalResponseV2Test.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@ class LocalResponseV2Test extends TestCase
1212

1313
protected function setUp(): void
1414
{
15-
$this->filePath = \TestingUtilities::getV2DataDir() . '/inference/standard_field_types.json';
15+
$this->filePath = \TestingUtilities::getV2DataDir() . '/products/extraction/standard_field_types.json';
1616
}
1717

1818
protected function assertLocalResponse(LocalResponse $localResponse): void
1919
{
2020
$fakeHMACSigning = "ogNjY44MhvKPGTtVsI8zG82JqWQa68woYQH";
21-
$signature = "1df388c992d87897fe61dfc56c444c58fc3c7369c31e2b5fd20d867695e93e85";
21+
$signature = "e51bdf80f1a08ed44ee161100fc30a25cb35b4ede671b0a575dc9064a3f5dbf1";
2222
$reflectedLocalResponse = new \ReflectionClass($localResponse);
2323
$reflectedFile = $reflectedLocalResponse->getProperty('file');
2424
$reflectedFile->setAccessible(true);

tests/V2/Parsing/InferenceResponseTest.php

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ private function readFileAsString(string $path): string
4343
*/
4444
public function testAsyncPredictWhenEmptyMustHaveValidProperties(): void
4545
{
46-
$response = $this->loadFromResource('v2/products/financial_document/blank.json');
46+
$response = $this->loadFromResource('v2/products/extraction/financial_document/blank.json');
4747
$fields = $response->inference->result->fields;
4848

4949
$this->assertCount(21, $fields, 'Expected 21 fields');
@@ -95,7 +95,7 @@ public function testAsyncPredictWhenEmptyMustHaveValidProperties(): void
9595
*/
9696
public function testAsyncPredictWhenCompleteMustExposeAllProperties(): void
9797
{
98-
$response = $this->loadFromResource('v2/products/financial_document/complete.json');
98+
$response = $this->loadFromResource('v2/products/extraction/financial_document/complete.json');
9999
$inference = $response->inference;
100100

101101
$this->assertNotNull($inference, 'Inference must not be null');
@@ -158,7 +158,7 @@ public function testAsyncPredictWhenCompleteMustExposeAllProperties(): void
158158
*/
159159
public function testDeepNestedFieldsMustExposeCorrectTypes(): void
160160
{
161-
$response = $this->loadFromResource('v2/inference/deep_nested_fields.json');
161+
$response = $this->loadFromResource('v2/products/extraction/deep_nested_fields.json');
162162
$inference = $response->inference;
163163
$this->assertNotNull($inference);
164164

@@ -202,7 +202,7 @@ public function testDeepNestedFieldsMustExposeCorrectTypes(): void
202202
*/
203203
public function testStandardFieldTypesMustExposeCorrectTypes(): void
204204
{
205-
$response = $this->loadFromResource('v2/inference/standard_field_types.json');
205+
$response = $this->loadFromResource('v2/products/extraction/standard_field_types.json');
206206
$inference = $response->inference;
207207
$this->assertNotNull($inference);
208208

@@ -283,7 +283,7 @@ public function testStandardFieldTypesMustExposeCorrectTypes(): void
283283
*/
284284
public function testRawTextsMustBeAccessible(): void
285285
{
286-
$response = $this->loadFromResource('v2/inference/raw_texts.json');
286+
$response = $this->loadFromResource('v2/products/extraction/raw_texts.json');
287287
$inference = $response->inference;
288288
$this->assertNotNull($inference);
289289

@@ -310,9 +310,9 @@ public function testRawTextsMustBeAccessible(): void
310310
*/
311311
public function testRstDisplayMustBeAccessible(): void
312312
{
313-
$response = $this->loadFromResource('v2/inference/standard_field_types.json');
313+
$response = $this->loadFromResource('v2/products/extraction/standard_field_types.json');
314314
$expectedRst = $this->readFileAsString(
315-
\TestingUtilities::getV2DataDir() . '/inference/standard_field_types.rst'
315+
\TestingUtilities::getV2DataDir() . '/products/extraction/standard_field_types.rst'
316316
);
317317
$inference = $response->inference;
318318
$this->assertNotNull($inference);
@@ -324,7 +324,7 @@ public function testRstDisplayMustBeAccessible(): void
324324
*/
325325
public function testCoordinatesAndLocationDataMustBeAccessible(): void
326326
{
327-
$response = $this->loadFromResource('v2/products/financial_document/complete_with_coordinates.json');
327+
$response = $this->loadFromResource('v2/products/extraction/financial_document/complete_with_coordinates.json');
328328
$inference = $response->inference;
329329
$this->assertNotNull($inference);
330330

@@ -383,15 +383,15 @@ public function testCoordinatesAndLocationDataMustBeAccessible(): void
383383

384384
public function testRagMetadataWhenMatched()
385385
{
386-
$response = $this->loadFromResource('v2/inference/rag_matched.json');
386+
$response = $this->loadFromResource('v2/products/extraction/rag_matched.json');
387387
$inference = $response->inference;
388388
$this->assertNotNull($inference);
389389
$this->assertEquals('12345abc-1234-1234-1234-123456789abc', $inference->result->rag->retrievedDocumentId);
390390
}
391391

392392
public function testRagMetadataWhenNotMatched()
393393
{
394-
$response = $this->loadFromResource('v2/inference/rag_not_matched.json');
394+
$response = $this->loadFromResource('v2/products/extraction/rag_not_matched.json');
395395
$inference = $response->inference;
396396
$this->assertNotNull($inference);
397397
$this->assertNull($inference->result->rag->retrievedDocumentId);
@@ -411,7 +411,7 @@ public function testShouldLoadWith422Error()
411411

412412
public function testTextContextIsTrue(): void
413413
{
414-
$response = $this->loadFromResource('v2/inference/text_context_enabled.json');
414+
$response = $this->loadFromResource('v2/products/extraction/text_context_enabled.json');
415415
$inference = $response->inference;
416416
$this->assertNotNull($inference);
417417
$activeOptions = $inference->activeOptions;
@@ -424,7 +424,7 @@ public function testTextContextIsTrue(): void
424424

425425
public function testTextContextIsFalse(): void
426426
{
427-
$response = $this->loadFromResource('v2/products/financial_document/complete.json');
427+
$response = $this->loadFromResource('v2/products/extraction/financial_document/complete.json');
428428
$inference = $response->inference;
429429
$this->assertNotNull($inference);
430430
$activeOptions = $inference->activeOptions;

tests/resources

Submodule resources updated 38 files

0 commit comments

Comments
 (0)