Skip to content

Commit d7e41ad

Browse files
committed
add "event subscription get" endpoint
1 parent 8a51519 commit d7e41ad

File tree

3 files changed

+21
-4
lines changed

3 files changed

+21
-4
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -115,10 +115,10 @@ $response = $api->downPaymentInvoice()->document($entityId, true, 'application/x
115115

116116
### Event Subscriptions Endpooint
117117
```php
118-
// TODO: get
119-
$response = $api->voucher()->create($data);
120-
$response = $api->voucher()->delete($entityId);
121-
$response = $api->voucher()->getAll();
118+
$response = $api->event()->get($entityId);
119+
$response = $api->event()->create($data);
120+
$response = $api->event()->delete($entityId);
121+
$response = $api->event()->getAll();
122122
```
123123

124124
### File Endpoint

src/Clients/Event.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,12 @@
88
use Sysix\LexOffice\BaseClient;
99
use Sysix\LexOffice\Clients\Traits\CreateTrait;
1010
use Sysix\LexOffice\Clients\Traits\DeleteTrait;
11+
use Sysix\LexOffice\Clients\Traits\GetTrait;
1112

1213
class Event extends BaseClient
1314
{
1415
use CreateTrait;
16+
use GetTrait;
1517
use DeleteTrait;
1618

1719
protected string $resource = 'event-subscriptions';

tests/Clients/EventTest.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,21 @@ public function testCreate(): void
2727
);
2828
}
2929

30+
public function testGet(): void
31+
{
32+
[$api, $stub] = $this->createClientMockObject(Event::class);
33+
34+
$response = $stub->get('resource-id');
35+
36+
$this->assertInstanceOf(ResponseInterface::class, $response);
37+
38+
$this->assertEquals('GET', $api->getRequest()->getMethod());
39+
$this->assertEquals(
40+
$api->apiUrl . '/v1/event-subscriptions/resource-id',
41+
$api->getRequest()->getUri()->__toString()
42+
);
43+
}
44+
3045
public function testDelete(): void
3146
{
3247
[$api, $stub] = $this->createClientMockObject(Event::class);

0 commit comments

Comments
 (0)