Skip to content

Commit 863788f

Browse files
committed
fix(test): fix mongo partial pagination test
1 parent 1427dfa commit 863788f

File tree

2 files changed

+16
-3
lines changed

2 files changed

+16
-3
lines changed

tests/Fixtures/TestBundle/Document/Issue7349/Foo7349.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@
2121
*
2222
* @author Maxime Valin <[email protected]>
2323
*/
24-
#[ApiResource]
24+
#[ApiResource(
25+
paginationClientPartial: true,
26+
)]
2527
#[ODM\Document]
2628
class Foo7349
2729
{

tests/Functional/Issues/Issue7349Test.php

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@
1414
namespace ApiPlatform\Tests\Functional\Issues;
1515

1616
use ApiPlatform\Symfony\Bundle\Test\ApiTestCase;
17+
use ApiPlatform\Tests\Fixtures\TestBundle\Document\Issue7349\Foo7349;
1718
use ApiPlatform\Tests\RecreateSchemaTrait;
19+
use ApiPlatform\Tests\SetupClassResourcesTrait;
1820
use Illuminate\Foundation\Testing\RefreshDatabase;
1921
use Orchestra\Testbench\Concerns\WithWorkbench;
2022
use Symfony\Contracts\HttpClient\Exception\ClientExceptionInterface;
@@ -28,6 +30,15 @@ class Issue7349Test extends ApiTestCase
2830
use RecreateSchemaTrait;
2931
use RefreshDatabase;
3032
use WithWorkbench;
33+
use SetupClassResourcesTrait;
34+
35+
/**
36+
* @return class-string[]
37+
*/
38+
public static function getResources(): array
39+
{
40+
return [Foo7349::class];
41+
}
3142

3243
/**
3344
* When using partial pagination, totalItems should not be present.
@@ -38,7 +49,7 @@ public function testGetPartialNoItemCount(): void
3849
$this->markTestSkipped();
3950
}
4051

41-
$response = self::createClient()->request('GET', '/foo7349s?page=1&itemsPerPage=3', [
52+
$response = self::createClient()->request('GET', '/foo7349s?page=1&itemsPerPage=3&partial=true', [
4253
'headers' => [
4354
'Accept' => 'application/ld+json',
4455
],
@@ -62,7 +73,7 @@ public function testGetItemCount(): void
6273
$this->markTestSkipped();
6374
}
6475

65-
$response = self::createClient()->request('GET', '/foo7349s?page=1&itemsPerPage=3', [
76+
$response = self::createClient()->request('GET', '/foo7349s?page=1&itemsPerPage=3&partial=false', [
6677
'headers' => [
6778
'Accept' => 'application/ld+json',
6879
],

0 commit comments

Comments
 (0)