From 81a5050d412a5f966884e55df7aeb170d4073e59 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adam=20W=C3=B3js?= Date: Fri, 10 Apr 2020 09:07:48 +0200 Subject: [PATCH] EZEE-3094: Added missing int casting in the RelationProcessor::getRelatedObjectIds (#138) --- src/lib/eZ/RichText/RelationProcessor.php | 4 ++-- tests/lib/eZ/RichText/RelationProcessorTest.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/lib/eZ/RichText/RelationProcessor.php b/src/lib/eZ/RichText/RelationProcessor.php index a7e3d285..c5da16cc 100644 --- a/src/lib/eZ/RichText/RelationProcessor.php +++ b/src/lib/eZ/RichText/RelationProcessor.php @@ -80,9 +80,9 @@ private function getRelatedObjectIds(DOMDocument $xml, array $tagNames): array } if ($scheme === 'ezcontent') { - $contentIds[] = $id; + $contentIds[] = (int)$id; } elseif ($scheme === 'ezlocation') { - $locationIds[] = $id; + $locationIds[] = (int)$id; } } } diff --git a/tests/lib/eZ/RichText/RelationProcessorTest.php b/tests/lib/eZ/RichText/RelationProcessorTest.php index 354938d7..19ee4fb3 100644 --- a/tests/lib/eZ/RichText/RelationProcessorTest.php +++ b/tests/lib/eZ/RichText/RelationProcessorTest.php @@ -31,7 +31,7 @@ public function testGetRelations(DOMDocument $document, array $expectedRelations { $actualProcessor = (new RelationProcessor())->getRelations($document); - $this->assertEquals($expectedRelations, $actualProcessor); + $this->assertSame($expectedRelations, $actualProcessor); } public function dateProviderForGetRelations(): array