Skip to content

Commit c4614a8

Browse files
committed
chore: move test to existing file
1 parent f4375f3 commit c4614a8

File tree

2 files changed

+12
-34
lines changed

2 files changed

+12
-34
lines changed

src/State/Tests/Provider/ReadProviderTest.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
namespace ApiPlatform\State\Tests\Provider;
1515

1616
use ApiPlatform\Metadata\Get;
17+
use ApiPlatform\Metadata\GetCollection;
1718
use ApiPlatform\State\Provider\ReadProvider;
1819
use ApiPlatform\State\ProviderInterface;
1920
use ApiPlatform\State\SerializerContextBuilderInterface;
@@ -49,4 +50,15 @@ public function testShouldReadWithOutputFalse(): void
4950
$provider->provide($operation, ['id' => 1], ['request' => $request]);
5051
$this->assertEquals($data, $request->attributes->get('data'));
5152
}
53+
54+
public function testWithoutRequest(): void
55+
{
56+
$operation = new GetCollection(read: true);
57+
$provider = $this->createMock(ProviderInterface::class);
58+
$provider->method('provide')->willReturn(['ok']);
59+
$serializerContextBuilder = $this->createMock(SerializerContextBuilderInterface::class);
60+
61+
$readProvider = new ReadProvider($provider, $serializerContextBuilder);
62+
$this->assertEquals($readProvider->provide($operation), ['ok']);
63+
}
5264
}

src/State/Tests/ReadProviderTest.php

Lines changed: 0 additions & 34 deletions
This file was deleted.

0 commit comments

Comments
 (0)