@@ -58,6 +58,8 @@ public function testGetVoucherListClient(): void
5858
5959 public function testDocument (): void
6060 {
61+ $ this ->expectDeprecationV1Warning ('document ' );
62+
6163 [$ api , $ stub ] = $ this ->createClientMockObject (DownPaymentInvoice::class);
6264
6365 $ response = $ stub ->document ('resource-id ' );
@@ -73,38 +75,33 @@ public function testDocument(): void
7375
7476 public function testDocumentContent (): void
7577 {
76- [$ api , $ stub ] = $ this ->createClientMultiMockObject (
77- DownPaymentInvoice::class,
78- [
79- new Response (200 , ['Content-Type ' => 'application/json ' ], '{"documentFileId": "fake-id"} ' ),
80- new Response ()
81- ]
82- );
78+ $ this ->expectDeprecationV1Warning ('document ' );
79+
80+ [$ api , $ stub ] = $ this ->createClientMockObject (DownPaymentInvoice::class);
8381
8482 $ response = $ stub ->document ('resource-id ' , true );
8583
8684 $ this ->assertInstanceOf (ResponseInterface::class, $ response );
8785
8886 $ this ->assertEquals ('GET ' , $ api ->getRequest ()->getMethod ());
8987 $ this ->assertEquals (
90- $ api ->apiUrl . '/v1/files/fake -id ' ,
88+ $ api ->apiUrl . '/v1/down-payment-invoices/resource -id/file ' ,
9189 $ api ->getRequest ()->getUri ()->__toString ()
9290 );
9391 }
9492
95- public function testFailedDocumentContent (): void
93+ public function testFileContent (): void
9694 {
97- [, $ stub ] = $ this ->createClientMultiMockObject (
98- DownPaymentInvoice::class,
99- [
100- new Response (500 ),
101- new Response ()
102- ]
103- );
95+ [$ api , $ stub ] = $ this ->createClientMockObject (DownPaymentInvoice::class);
10496
105- $ response = $ stub ->document ('resource-id ' , true );
97+ $ response = $ stub ->file ('resource-id ' );
10698
10799 $ this ->assertInstanceOf (ResponseInterface::class, $ response );
108- $ this ->assertEquals (500 , $ response ->getStatusCode ());
100+
101+ $ this ->assertEquals ('GET ' , $ api ->getRequest ()->getMethod ());
102+ $ this ->assertEquals (
103+ $ api ->apiUrl . '/v1/down-payment-invoices/resource-id/file ' ,
104+ $ api ->getRequest ()->getUri ()->__toString ()
105+ );
109106 }
110107}
0 commit comments