File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -22,6 +22,7 @@ class ClientTest extends TestCase
22
22
private string $ oldKey ;
23
23
private string $ fileTypesDir ;
24
24
private string $ invoicePath ;
25
+ private string $ failedJobPath ;
25
26
26
27
27
28
protected function setUp (): void
@@ -38,6 +39,9 @@ protected function setUp(): void
38
39
$ this ->invoicePath = (
39
40
getenv ('GITHUB_WORKSPACE ' ) ?: ". "
40
41
) . "/tests/resources/products/invoices/response_v4/complete.json " ;
42
+ $ this ->failedJobPath = (
43
+ getenv ('GITHUB_WORKSPACE ' ) ?: ". "
44
+ ) . "/tests/resources/async/get_failed_job_error.json " ;
41
45
}
42
46
43
47
@@ -140,5 +144,14 @@ public function testLoadLocalResponse()
140
144
$ localResponse = new LocalResponse ($ this ->invoicePath );
141
145
$ res = $ this ->dummyClient ->loadPrediction (InvoiceV4::class, $ localResponse );
142
146
$ this ->assertNotNull ($ res );
147
+ $ this ->assertEquals (2 , $ res ->document ->nPages );
148
+ }
149
+
150
+ public function testLoadFailedLocalResponse ()
151
+ {
152
+ $ localResponse = new LocalResponse ($ this ->failedJobPath );
153
+ $ res = $ this ->dummyClient ->loadPrediction (InvoiceV4::class, $ localResponse );
154
+ $ this ->assertNotNull ($ res );
155
+ $ this ->assertEquals ("failed " , $ res ->job ->status );
143
156
}
144
157
}
You can’t perform that action at this time.
0 commit comments