Skip to content

Commit

Permalink
Fixed unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ViniTou committed Oct 28, 2024
1 parent ad3f256 commit 747803e
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 43 deletions.
40 changes: 0 additions & 40 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -1015,16 +1015,6 @@ parameters:
count: 1
path: src/lib/Server/Controller/Content.php

-
message: "#^Parameter \\#3 \\$relations of class Ibexa\\\\Rest\\\\Server\\\\Values\\\\Version constructor expects array\\<Ibexa\\\\Contracts\\\\Core\\\\Repository\\\\Values\\\\Content\\\\Relation\\>, iterable\\<Ibexa\\\\Contracts\\\\Core\\\\Repository\\\\Values\\\\Content\\\\Relation\\> given\\.$#"
count: 4
path: src/lib/Server/Controller/Content.php

-
message: "#^Parameter \\#5 \\$relations of class Ibexa\\\\Rest\\\\Server\\\\Values\\\\RestContent constructor expects array\\<Ibexa\\\\Contracts\\\\Core\\\\Repository\\\\Values\\\\Content\\\\Relation\\>\\|null, iterable\\<Ibexa\\\\Contracts\\\\Core\\\\Repository\\\\Values\\\\Content\\\\Relation\\>\\|null given\\.$#"
count: 2
path: src/lib/Server/Controller/Content.php

-
message: "#^Method Ibexa\\\\Rest\\\\Server\\\\Controller\\\\ContentType\\:\\:addContentTypeDraftFieldDefinition\\(\\) has parameter \\$contentTypeId with no type specified\\.$#"
count: 1
Expand Down Expand Up @@ -1660,16 +1650,6 @@ parameters:
count: 1
path: src/lib/Server/Controller/User.php

-
message: "#^Parameter \\#5 \\$relations of class Ibexa\\\\Rest\\\\Server\\\\Values\\\\RestUser constructor expects array\\<Ibexa\\\\Contracts\\\\Core\\\\Repository\\\\Values\\\\Content\\\\Relation\\>, iterable\\<Ibexa\\\\Contracts\\\\Core\\\\Repository\\\\Values\\\\Content\\\\Relation\\> given\\.$#"
count: 5
path: src/lib/Server/Controller/User.php

-
message: "#^Parameter \\#5 \\$relations of class Ibexa\\\\Rest\\\\Server\\\\Values\\\\RestUserGroup constructor expects array\\<Ibexa\\\\Contracts\\\\Core\\\\Repository\\\\Values\\\\Content\\\\Relation\\>, iterable\\<Ibexa\\\\Contracts\\\\Core\\\\Repository\\\\Values\\\\Content\\\\Relation\\> given\\.$#"
count: 10
path: src/lib/Server/Controller/User.php

-
message: "#^Method Ibexa\\\\Rest\\\\Server\\\\Input\\\\Parser\\\\Aggregation\\\\AbstractRangeAggregationParser\\:\\:dispatchRanges\\(\\) has parameter \\$data with no value type specified in iterable type array\\.$#"
count: 1
Expand Down Expand Up @@ -2760,11 +2740,6 @@ parameters:
count: 1
path: src/lib/Server/Output/ValueObjectVisitor/Location.php

-
message: "#^Parameter \\#5 \\$relations of class Ibexa\\\\Rest\\\\Server\\\\Values\\\\RestContent constructor expects array\\<Ibexa\\\\Contracts\\\\Core\\\\Repository\\\\Values\\\\Content\\\\Relation\\>\\|null, iterable\\<Ibexa\\\\Contracts\\\\Core\\\\Repository\\\\Values\\\\Content\\\\Relation\\> given\\.$#"
count: 1
path: src/lib/Server/Output/ValueObjectVisitor/Location.php

-
message: "#^Method Ibexa\\\\Rest\\\\Server\\\\Output\\\\ValueObjectVisitor\\\\LocationList\\:\\:visit\\(\\) has no return type specified\\.$#"
count: 1
Expand Down Expand Up @@ -2920,11 +2895,6 @@ parameters:
count: 1
path: src/lib/Server/Output/ValueObjectVisitor/RestExecutedView.php

-
message: "#^Parameter \\#5 \\$relations of class Ibexa\\\\Rest\\\\Server\\\\Values\\\\RestContent constructor expects array\\<Ibexa\\\\Contracts\\\\Core\\\\Repository\\\\Values\\\\Content\\\\Relation\\>\\|null, iterable\\<Ibexa\\\\Contracts\\\\Core\\\\Repository\\\\Values\\\\Content\\\\Relation\\> given\\.$#"
count: 1
path: src/lib/Server/Output/ValueObjectVisitor/RestExecutedView.php

-
message: "#^Method Ibexa\\\\Rest\\\\Server\\\\Output\\\\ValueObjectVisitor\\\\RestFieldDefinition\\:\\:visit\\(\\) has no return type specified\\.$#"
count: 1
Expand Down Expand Up @@ -3120,21 +3090,11 @@ parameters:
count: 1
path: src/lib/Server/Output/ValueObjectVisitor/User.php

-
message: "#^Parameter \\#5 \\$relations of class Ibexa\\\\Rest\\\\Server\\\\Values\\\\RestUser constructor expects array\\<Ibexa\\\\Contracts\\\\Core\\\\Repository\\\\Values\\\\Content\\\\Relation\\>, iterable\\<Ibexa\\\\Contracts\\\\Core\\\\Repository\\\\Values\\\\Content\\\\Relation\\> given\\.$#"
count: 1
path: src/lib/Server/Output/ValueObjectVisitor/User.php

-
message: "#^Parameter \\#4 \\$mainLocation of class Ibexa\\\\Rest\\\\Server\\\\Values\\\\RestUserGroup constructor expects Ibexa\\\\Contracts\\\\Core\\\\Repository\\\\Values\\\\Content\\\\Location, Ibexa\\\\Contracts\\\\Core\\\\Repository\\\\Values\\\\Content\\\\Location\\|null given\\.$#"
count: 1
path: src/lib/Server/Output/ValueObjectVisitor/UserGroup.php

-
message: "#^Parameter \\#5 \\$relations of class Ibexa\\\\Rest\\\\Server\\\\Values\\\\RestUserGroup constructor expects array\\<Ibexa\\\\Contracts\\\\Core\\\\Repository\\\\Values\\\\Content\\\\Relation\\>, iterable\\<Ibexa\\\\Contracts\\\\Core\\\\Repository\\\\Values\\\\Content\\\\Relation\\> given\\.$#"
count: 1
path: src/lib/Server/Output/ValueObjectVisitor/UserGroup.php

-
message: "#^Method Ibexa\\\\Rest\\\\Server\\\\Output\\\\ValueObjectVisitor\\\\UserGroupList\\:\\:visit\\(\\) has no return type specified\\.$#"
count: 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* @copyright Copyright (C) Ibexa AS. All rights reserved.
* @license For full copyright and license information view LICENSE file distributed with this source code.
*/

namespace Ibexa\Contracts\Rest\Output\Exceptions;

use Ibexa\Contracts\Rest\Output\Generator;
Expand Down
2 changes: 1 addition & 1 deletion src/lib/Server/Controller/Content.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
*/
class Content extends RestController
{
public function __construct(private readonly RelationListHelper $relationListHelper, private readonly RelationListHelper $relationListHelper)
public function __construct(private readonly RelationListHelper $relationListHelper)
{
}

Expand Down
6 changes: 5 additions & 1 deletion tests/lib/Server/Output/ValueObjectVisitor/LocationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
use Ibexa\Contracts\Core\Repository\Values\Content\ContentInfo;
use Ibexa\Contracts\Core\Repository\Values\Content\Location as ApiLocation;
use Ibexa\Core\Base\Exceptions\UnauthorizedException;
use Ibexa\Core\Helper\RelationListHelper;
use Ibexa\Core\Repository\Values\Content\Content;
use Ibexa\Core\Repository\Values\Content\Location;
use Ibexa\Core\Repository\Values\Content\VersionInfo;
Expand Down Expand Up @@ -139,6 +140,9 @@ public function getDataForTestVisitLocationAttributesResolvesMainLocation(): ite

protected function internalGetVisitor(): ValueObjectVisitor\Location
{
return new ValueObjectVisitor\Location($this->locationServiceMock, $this->contentServiceMock);
return new ValueObjectVisitor\Location(
$this->locationServiceMock,
new RelationListHelper($this->contentServiceMock)
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
use Ibexa\Contracts\Core\Repository\Values\Content\ContentInfo;
use Ibexa\Contracts\Core\Repository\Values\Content\Search\SearchHit;
use Ibexa\Contracts\Core\Repository\Values\Content\Search\SearchResult;
use Ibexa\Core\Helper\RelationListHelper;
use Ibexa\Core\Repository\Values\Content;
use Ibexa\Core\Repository\Values\Content as ApiValues;
use Ibexa\Core\Repository\Values\ContentType\ContentType;
Expand Down Expand Up @@ -115,7 +116,7 @@ protected function internalGetVisitor()
{
return new ValueObjectVisitor\RestExecutedView(
$this->getLocationServiceMock(),
$this->getContentServiceMock(),
new RelationListHelper($this->getContentServiceMock())
);
}

Expand Down

0 comments on commit 747803e

Please sign in to comment.