File tree Expand file tree Collapse file tree 2 files changed +46
-0
lines changed
Expand file tree Collapse file tree 2 files changed +46
-0
lines changed Original file line number Diff line number Diff line change 1+ <?php
2+
3+ declare (strict_types=1 );
4+
5+ namespace Sysix \LexOffice \Clients ;
6+
7+ use Psr \Http \Message \ResponseInterface ;
8+ use Sysix \LexOffice \BaseClient ;
9+
10+ class PrintLayout extends BaseClient
11+ {
12+ protected string $ resource = 'print-layouts ' ;
13+
14+ public function getAll (): ResponseInterface
15+ {
16+ return $ this ->api ->newRequest ('GET ' , $ this ->resource )
17+ ->getResponse ();
18+ }
19+ }
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ declare (strict_types=1 );
4+
5+ namespace Sysix \LexOffice \Tests \Clients ;
6+
7+ use Psr \Http \Message \ResponseInterface ;
8+ use Sysix \LexOffice \Clients \PrintLayout ;
9+ use Sysix \LexOffice \Tests \TestClient ;
10+
11+ class PrintLayoutTest extends TestClient
12+ {
13+ public function testGetAll (): void
14+ {
15+ [$ api , $ stub ] = $ this ->createClientMockObject (PrintLayout::class);
16+
17+ $ response = $ stub ->getAll ();
18+
19+ $ this ->assertInstanceOf (ResponseInterface::class, $ response );
20+
21+ $ this ->assertEquals ('GET ' , $ api ->getRequest ()->getMethod ());
22+ $ this ->assertEquals (
23+ $ api ->apiUrl . '/v1/print-layouts ' ,
24+ $ api ->getRequest ()->getUri ()->__toString ()
25+ );
26+ }
27+ }
You can’t perform that action at this time.
0 commit comments