From c9940513e89a0add9e1a08ce0e44a95213c214c1 Mon Sep 17 00:00:00 2001 From: Andrew Longosz Date: Sun, 22 Mar 2020 16:52:32 +0100 Subject: [PATCH] EZP-31448: Aligned Spec to respect LocationService strict types --- spec/API/QueryFieldServiceSpec.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/spec/API/QueryFieldServiceSpec.php b/spec/API/QueryFieldServiceSpec.php index 57fb58a..2e15206 100644 --- a/spec/API/QueryFieldServiceSpec.php +++ b/spec/API/QueryFieldServiceSpec.php @@ -20,6 +20,7 @@ class QueryFieldServiceSpec extends ObjectBehavior { const CONTENT_TYPE_ID = 1; + const LOCATION_ID = 1; const QUERY_TYPE_IDENTIFIER = 'query_type_identifier'; const FIELD_DEFINITION_IDENTIFIER = 'test'; @@ -55,8 +56,12 @@ function let( ]), ]), ]); + $location = new Values\Content\Location([ + 'id' => self::LOCATION_ID + ]); $contentTypeService->loadContentType(self::CONTENT_TYPE_ID)->willReturn($contentType); + $locationService->loadLocation(self::LOCATION_ID)->willReturn($location); $queryTypeRegistry->getQueryType(self::QUERY_TYPE_IDENTIFIER)->willReturn($queryType); $queryType->getQuery(Argument::any())->willReturn(new ApiQuery()); // @todo this should fail. It does not. @@ -86,7 +91,10 @@ private function getContent(): Values\Content\Content { return new Values\Content\Content([ 'versionInfo' => new Values\Content\VersionInfo([ - 'contentInfo' => new ContentInfo(['contentTypeId' => self::CONTENT_TYPE_ID]), + 'contentInfo' => new ContentInfo([ + 'contentTypeId' => self::CONTENT_TYPE_ID, + 'mainLocationId' => self::LOCATION_ID, + ]), ]) ]); }