File tree Expand file tree Collapse file tree 6 files changed +60
-1
lines changed Expand file tree Collapse file tree 6 files changed +60
-1
lines changed Original file line number Diff line number Diff line change @@ -183,6 +183,11 @@ $response = $api->paymentCondition()->getAll();
183183$response = $api->postingCategory()->getAll();
184184```
185185
186+ ### Print Layouts Endpoint
187+ ``` php
188+ $response = $api->printLayout()->getAll();
189+ ```
190+
186191### Profile Endpoint
187192``` php
188193$response = $api->profile()->get();
Original file line number Diff line number Diff line change 2424use Sysix \LexOffice \Clients \Payment ;
2525use Sysix \LexOffice \Clients \PaymentCondition ;
2626use Sysix \LexOffice \Clients \PostingCategory ;
27+ use Sysix \LexOffice \Clients \PrintLayout ;
2728use Sysix \LexOffice \Clients \Profile ;
2829use Sysix \LexOffice \Clients \Quotation ;
2930use Sysix \LexOffice \Clients \RecurringTemplate ;
@@ -149,6 +150,11 @@ public function postingCategory(): PostingCategory
149150 return new PostingCategory ($ this );
150151 }
151152
153+ public function printLayout (): PrintLayout
154+ {
155+ return new PrintLayout ($ this );
156+ }
157+
152158 public function profile (): Profile
153159 {
154160 return new Profile ($ this );
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 @@ -86,7 +86,7 @@ public static function createStream(mixed $content): StreamInterface
8686 public static function createMultipartStream (array $ content , string $ boundary = null ): MultipartStream
8787 {
8888 $ stream = [];
89- $ boundary = $ boundary ? : '--lexoffice ' ;
89+ $ boundary = ! is_null ( $ boundary) && $ boundary !== '' ? $ boundary : '--lexoffice ' ;
9090
9191 foreach ($ content as $ key => $ value ) {
9292 $ stream [] = [
Original file line number Diff line number Diff line change 1919use Sysix \LexOffice \Clients \Payment ;
2020use Sysix \LexOffice \Clients \PaymentCondition ;
2121use Sysix \LexOffice \Clients \PostingCategory ;
22+ use Sysix \LexOffice \Clients \PrintLayout ;
2223use Sysix \LexOffice \Clients \Profile ;
2324use Sysix \LexOffice \Clients \Quotation ;
2425use Sysix \LexOffice \Clients \RecurringTemplate ;
@@ -52,6 +53,7 @@ public function testClients(): void
5253 $ this ->assertInstanceOf (Payment::class, $ stub ->payment ());
5354 $ this ->assertInstanceOf (PaymentCondition::class, $ stub ->paymentCondition ());
5455 $ this ->assertInstanceOf (PostingCategory::class, $ stub ->postingCategory ());
56+ $ this ->assertInstanceOf (PrintLayout::class, $ stub ->printLayout ());
5557 $ this ->assertInstanceOf (Profile::class, $ stub ->profile ());
5658 $ this ->assertInstanceOf (Quotation::class, $ stub ->quotation ());
5759 $ this ->assertInstanceOf (RecurringTemplate::class, $ stub ->recurringTemplate ());
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