We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 08ef209 commit aed28dbCopy full SHA for aed28db
1 file changed
tests/Responses/NotificationTest.php
@@ -0,0 +1,32 @@
1
+<?php
2
+
3
+declare(strict_types=1);
4
5
+namespace Keboola\NotificationClient\Tests\Responses;
6
7
+use Keboola\NotificationClient\Exception\ClientException;
8
+use Keboola\NotificationClient\Responses\Notification;
9
+use PHPUnit\Framework\TestCase;
10
11
+class NotificationTest extends TestCase
12
+{
13
+ public function testAccessors(): void
14
+ {
15
+ $data = [
16
+ 'id' => '123',
17
+ ];
18
+ $notification = new Notification($data);
19
+ self::assertSame('123', $notification->getId());
20
+ }
21
22
+ public function testInvalidData(): void
23
24
25
+ 'some' => 'value',
26
27
+ $this->expectException(ClientException::class);
28
+ $this->expectExceptionMessage('Unrecognized response');
29
+ $this->expectExceptionCode(0);
30
+ new Notification($data);
31
32
+}
0 commit comments