Skip to content

Commit

Permalink
TASK: Adjust PropertyCollectionTest
Browse files Browse the repository at this point in the history
  • Loading branch information
mhsdesign committed Sep 4, 2023
1 parent e59ce53 commit 359e8da
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,31 +43,31 @@ public function emptyPropertyCollectionReturnsEmptyArray(): void
/**
* @test
*/
public function offsetGetReturnsNullIfPropertyDoesNotExist(): void
public function getPropertyReturnsNullIfPropertyDoesNotExist(): void
{
$this->mockSerializer->expects($this->never())->method($this->anything());
$collection = new PropertyCollection(SerializedPropertyValues::fromArray(['someProperty' => ['value' => 'some string', 'type' => 'string']]), $this->mockPropertyConverter);
self::assertNull($collection['non-existing']);
self::assertNull($collection->get('non-existing'));
}

/**
* @test
*/
public function offsetGetReturnsNullIfSerializedPropertyValueIsNull(): void
public function getPropertyReturnsNullIfSerializedPropertyValueIsNull(): void
{
$this->mockSerializer->expects($this->never())->method($this->anything());
$collection = new PropertyCollection(SerializedPropertyValues::fromArray(['someProperty' => ['value' => null, 'type' => 'string']]), $this->mockPropertyConverter);
self::assertNull($collection['someProperty']);
self::assertNull($collection->get('someProperty'));
}

/**
* @test
*/
public function offsetGetReturnsDeserializedValue(): void
public function getPropertyReturnsDeserializedValue(): void
{
$this->mockSerializer->expects($this->once())->method('denormalize')->with('some string', 'string', null, [])->willReturn('some deserialized value');
$collection = new PropertyCollection(SerializedPropertyValues::fromArray(['someProperty' => ['value' => 'some string', 'type' => 'string']]), $this->mockPropertyConverter);
self::assertSame('some deserialized value', $collection['someProperty']);
self::assertSame('some deserialized value', $collection->get('someProperty'));
}

/**
Expand Down

0 comments on commit 359e8da

Please sign in to comment.