-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #157 from Sysix/feature/print-layouts
Feature/print layouts
- Loading branch information
Showing
6 changed files
with
60 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Sysix\LexOffice\Clients; | ||
|
||
use Psr\Http\Message\ResponseInterface; | ||
use Sysix\LexOffice\BaseClient; | ||
|
||
class PrintLayout extends BaseClient | ||
{ | ||
protected string $resource = 'print-layouts'; | ||
|
||
public function getAll(): ResponseInterface | ||
{ | ||
return $this->api->newRequest('GET', $this->resource) | ||
->getResponse(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Sysix\LexOffice\Tests\Clients; | ||
|
||
use Psr\Http\Message\ResponseInterface; | ||
use Sysix\LexOffice\Clients\PrintLayout; | ||
use Sysix\LexOffice\Tests\TestClient; | ||
|
||
class PrintLayoutTest extends TestClient | ||
{ | ||
public function testGetAll(): void | ||
{ | ||
[$api, $stub] = $this->createClientMockObject(PrintLayout::class); | ||
|
||
$response = $stub->getAll(); | ||
|
||
$this->assertInstanceOf(ResponseInterface::class, $response); | ||
|
||
$this->assertEquals('GET', $api->getRequest()->getMethod()); | ||
$this->assertEquals( | ||
$api->apiUrl . '/v1/print-layouts', | ||
$api->getRequest()->getUri()->__toString() | ||
); | ||
} | ||
} |