Skip to content

Commit d5a187f

Browse files
committed
add print-layouts endpoint
1 parent 25bc9d3 commit d5a187f

File tree

2 files changed

+46
-0
lines changed

2 files changed

+46
-0
lines changed

src/Clients/PrintLayout.php

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
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+
}

tests/Clients/PrintLayoutTest.php

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
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+
}

0 commit comments

Comments
 (0)