added unmapped proeprty logLevel to Event model

This commit is contained in:
Artem Bondarenko 2020-10-05 19:45:16 +03:00 committed by David Garcia
parent b56b7dd81d
commit 3354ac3514
2 changed files with 12 additions and 0 deletions

View File

@ -37,6 +37,7 @@ final class Event
private $geolocation;
private $storage;
private $method;
private $logLevel;
private function __construct()
{
@ -66,6 +67,7 @@ final class Event
$model->clientInfo = $data['client-info'] ?? [];
$model->url = $data['url'] ?? '';
$model->storage = $data['storage'] ?? [];
$model->logLevel = $data['log-level'] ?? '';
return $model;
}
@ -192,4 +194,12 @@ final class Event
{
return $this->method;
}
/**
* @return string
*/
public function getLogLevel(): string
{
return $this->logLevel;
}
}

View File

@ -37,6 +37,7 @@ class EventResponseTest extends BaseModelTest
"is-authenticated": true,
"is-test-mode": false
},
"log-level": "info",
"message": {
"headers": {
"to": "foo@example.com",
@ -69,5 +70,6 @@ JSON;
$this->assertCount(1, $events);
$event = $events[0];
$this->assertEquals('czsjqFATSlC3QtAK-C80nw', $event->getId());
$this->assertEquals('info', $event->getLogLevel());
}
}