Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
#[Map(target: MappedResourceWithRelationEntity::class)]
class MappedResourceWithRelation
{
#[Map(transform: 'intval')]
public ?string $id = null;
#[Map(if: false)]
public ?string $relationName = null;
Expand Down
8 changes: 4 additions & 4 deletions tests/Functional/JsonStreamerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ public function testJsonStreamerJsonLd(): void
$r = self::createClient()->request('GET', '/json_stream_resources/1', ['headers' => ['accept' => 'application/ld+json']]);
$res = json_decode($r->getBrowserKitResponse()->getContent(), true);
$this->assertIsInt($res['views']);
$this->assertIsInt($res['rating']);
$this->assertIsFloat($res['rating']);
$this->assertIsBool($res['isFeatured']);
$this->assertIsString($res['price']);
$this->assertEquals('/json_stream_resources/1', $res['@id']);
Expand Down Expand Up @@ -170,7 +170,7 @@ public function testJsonStreamerJson(): void
$r = self::createClient()->request('GET', '/json_stream_resources/1', ['headers' => ['accept' => 'application/json']]);
$res = json_decode($r->getBrowserKitResponse()->getContent(), true);
$this->assertIsInt($res['views']);
$this->assertIsInt($res['rating']);
$this->assertIsFloat($res['rating']);
$this->assertIsBool($res['isFeatured']);
$this->assertIsString($res['price']);
$this->assertArrayNotHasKey('@id', $res);
Expand Down Expand Up @@ -227,7 +227,7 @@ public function testJsonStreamerWriteJsonLd(): void
$this->assertResponseIsSuccessful();
$this->assertSame('asd', $res['title']);
$this->assertSame(0, $res['views']);
$this->assertSame(0, $res['rating']);
$this->assertSame(0.0, $res['rating']);
$this->assertFalse($res['isFeatured']);
$this->assertContains($res['price'], ['0', '0.00']); // Depends on DB
$this->assertStringStartsWith('/json_stream_resources/', $res['@id']);
Expand Down Expand Up @@ -276,7 +276,7 @@ public function testJsonStreamerWriteJson(): void
$this->assertResponseIsSuccessful();
$this->assertSame('asd', $res['title']);
$this->assertSame(0, $res['views']);
$this->assertSame(0, $res['rating']);
$this->assertSame(0.0, $res['rating']);
$this->assertFalse($res['isFeatured']);
$this->assertContains($res['price'], ['0', '0.00']); // Depends on DB
$this->assertArrayNotHasKey('@id', $res);
Expand Down
Loading