Skip to content

Commit

Permalink
EZP-31448: Aligned Spec to respect LocationService strict types
Browse files Browse the repository at this point in the history
  • Loading branch information
alongosz committed Mar 22, 2020
1 parent 4ad8290 commit c994051
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion spec/API/QueryFieldServiceSpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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,
]),
])
]);
}
Expand Down

0 comments on commit c994051

Please sign in to comment.