mirror of
https://github.com/retailcrm/mailgun-php.git
synced 2025-04-07 07:03:32 +03:00
added unmapped proeprty logLevel to Event model
This commit is contained in:
parent
b56b7dd81d
commit
3354ac3514
2 changed files with 12 additions and 0 deletions
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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());
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue