json objects are constructed with implicit managers

This commit is contained in:
Spine
2025-12-07 19:49:11 +01:00
parent 2b11fbfad9
commit 4afc7f0e1e
66 changed files with 634 additions and 209 deletions
+30 -1
View File
@@ -626,7 +626,6 @@ class RequestTest extends TestCase {
$this->userList['user'],
new User\Bookmark($this->userList['user']),
new Comment\Request($this->request->id, 1, 0),
new Manager\User(),
);
$payload = $json->payload();
$this->assertCount(43, $payload, 'req-json-payload');
@@ -819,4 +818,34 @@ class RequestTest extends TestCase {
'request-fts-search-title'
);
}
public function testRequestJson(): void {
$this->request = Helper::makeRequestMusic(
$this->userList['admin'],
'phpunit json ' . randomString()
);
$payload = new Json\Requests(
new Search\Request(),
1,
)->payload();
$this->assertEqualsCanonicalizing(
[
'currentPage',
'pages',
'results',
],
array_keys($payload),
'request-json-payload',
);
$this->assertGreaterThan(
0,
count($payload['results']),
'request-json-total',
);
$this->assertEquals(
$this->request->id,
$payload['results'][0]['requestId'],
'request-json-id',
);
}
}