decouple audits log from events

This commit is contained in:
shimon
2022-09-04 17:53:37 +03:00
parent db715f3e7d
commit eabc90ec49
2 changed files with 2 additions and 4 deletions
-2
View File
@@ -342,8 +342,6 @@ App::shutdown()
$audits->setPayload($responsePayload);
}
var_dump($audits);
foreach ($events->getParams() as $key => $value) {
$audits->setParam($key, $value);
}
+2 -2
View File
@@ -341,7 +341,7 @@ trait AccountBase
$this->assertNotEmpty($response['body']['logs']);
$this->assertCount(3, $response['body']['logs']);
$this->assertIsNumeric($response['body']['total']);
$this->assertContains($response['body']['logs'][1]['event'], ["users.{$userId}.create", "users.{$userId}.sessions.{$sessionId}.create"]);
$this->assertContains($response['body']['logs'][1]['event'], ["account.session.email.create"]);
$this->assertEquals($response['body']['logs'][1]['ip'], filter_var($response['body']['logs'][1]['ip'], FILTER_VALIDATE_IP));
$this->assertEquals(true, DateTime::isValid($response['body']['logs'][1]['time']));
@@ -363,7 +363,7 @@ trait AccountBase
$this->assertEquals('--', $response['body']['logs'][1]['countryCode']);
$this->assertEquals('Unknown', $response['body']['logs'][1]['countryName']);
$this->assertContains($response['body']['logs'][2]['event'], ["users.{$userId}.create", "users.{$userId}.sessions.{$sessionId}.create"]);
$this->assertContains($response['body']['logs'][2]['event'], ["account.create"]);
$this->assertEquals($response['body']['logs'][2]['ip'], filter_var($response['body']['logs'][2]['ip'], FILTER_VALIDATE_IP));
$this->assertEquals(true, DateTime::isValid($response['body']['logs'][2]['time']));