Skip to content

Commit 9e16c6b

Browse files
committed
tt
1 parent 81b5c50 commit 9e16c6b

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

src/Metadata/Resource/Factory/ParameterResourceMetadataCollectionFactory.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ final class ParameterResourceMetadataCollectionFactory implements ResourceMetada
4343
{
4444
use StateOptionsTrait;
4545

46-
private array $localPropertyCache;
46+
private array $localPropertyCache = [];
4747

4848
public function __construct(
4949
private readonly PropertyNameCollectionFactoryInterface $propertyNameCollectionFactory,

src/Metadata/Tests/Resource/Factory/ParameterResourceMetadataCollectionFactoryTest.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,10 @@ public function testParameterFactory(): void
3535
$nameCollection = $this->createStub(PropertyNameCollectionFactoryInterface::class);
3636
$nameCollection->method('create')->willReturn(new PropertyNameCollection(['id', 'hydra', 'everywhere']));
3737
$propertyMetadata = $this->createStub(PropertyMetadataFactoryInterface::class);
38-
$propertyMetadata->method('create')->willReturnOnConsecutiveCalls(new ApiProperty(identifier: true), new ApiProperty(readable: true), new ApiProperty(readable: true));
38+
$propertyMetadata->method('create')->willReturnOnConsecutiveCalls(
39+
new ApiProperty(identifier: true), new ApiProperty(readable: true), new ApiProperty(readable: true),
40+
new ApiProperty(identifier: true), new ApiProperty(readable: true), new ApiProperty(readable: true)
41+
);
3942
$filterLocator = $this->createStub(ContainerInterface::class);
4043
$filterLocator->method('has')->willReturn(true);
4144
$filterLocator->method('get')->willReturn(new class implements FilterInterface {
@@ -79,7 +82,10 @@ public function testParameterFactoryNoFilter(): void
7982
$nameCollection = $this->createStub(PropertyNameCollectionFactoryInterface::class);
8083
$nameCollection->method('create')->willReturn(new PropertyNameCollection(['id', 'hydra', 'everywhere']));
8184
$propertyMetadata = $this->createStub(PropertyMetadataFactoryInterface::class);
82-
$propertyMetadata->method('create')->willReturnOnConsecutiveCalls(new ApiProperty(identifier: true), new ApiProperty(readable: true), new ApiProperty(readable: true));
85+
$propertyMetadata->method('create')->willReturnOnConsecutiveCalls(
86+
new ApiProperty(identifier: true), new ApiProperty(readable: true), new ApiProperty(readable: true),
87+
new ApiProperty(identifier: true), new ApiProperty(readable: true), new ApiProperty(readable: true)
88+
);
8389
$filterLocator = $this->createStub(ContainerInterface::class);
8490
$filterLocator->method('has')->willReturn(false);
8591
$parameter = new ParameterResourceMetadataCollectionFactory(

0 commit comments

Comments
 (0)