fix create log

This commit is contained in:
Dennis Eichhorn 2023-09-30 02:33:44 +00:00
parent 6f0017e9b0
commit 1731a285d2
2 changed files with 6 additions and 3 deletions

View File

@ -73,7 +73,7 @@ final class ApiController extends Controller
}
// Using empty string as the data is represented by the current model
$newString = ''; //StringUtils::stringify($new, \JSON_PRETTY_PRINT);
$newString = null; //StringUtils::stringify($new, \JSON_PRETTY_PRINT);
$audit = new Audit(
new NullAccount($account),
null,

View File

@ -95,7 +95,10 @@ final class ApiControllerTest extends \PHPUnit\Framework\TestCase
public function testLogCreate() : void
{
$this->module->eventLogCreate(1, null, ['id' => 1, 'test' => true], 1, 'test-trigger', 'Auditor', 'abc', 'def');
$logs = AuditMapper::getAll()->execute();
$logs = AuditMapper::getAll()
->sort('id', 'DESC')
->limit(100)
->execute();
foreach($logs as $log) {
if ($log->id > 0
@ -105,7 +108,7 @@ final class ApiControllerTest extends \PHPUnit\Framework\TestCase
&& $log->ref === 'abc'
&& \strlen($log->content) > 0
&& $log->old === null
&& \strlen($log->new) > 0
&& $log->new === null // null because the object itself is the data, no additional logging required
) {
self::assertTrue(true);
return;