From 4f0e2d3c4de9daadea4c69e6f6b09952038690fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Nowak?= Date: Tue, 22 Sep 2026 08:34:38 +0200 Subject: [PATCH 1/3] IBX-12654: Added ibexa/phpstan to the PHPStan configuration --- composer.json | 1 + phpstan.neon | 1 + 2 files changed, 2 insertions(+) diff --git a/composer.json b/composer.json index f8f4d8b28..863d36b79 100644 --- a/composer.json +++ b/composer.json @@ -49,6 +49,7 @@ "require-dev": { "ibexa/code-style": "~2.0.0", "ibexa/doctrine-schema": "~6.0.x-dev", + "ibexa/phpstan": "~6.0.x-dev", "ibexa/rector": "~6.0.x-dev", "ibexa/test-core": "~6.0.x-dev", "justinrainbow/json-schema": "^5.2", diff --git a/phpstan.neon b/phpstan.neon index 103be348b..25dfb6dcd 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -2,6 +2,7 @@ includes: - vendor/phpstan/phpstan-phpunit/extension.neon - vendor/phpstan/phpstan-symfony/extension.neon - vendor/phpstan/phpstan-webmozart-assert/extension.neon + - vendor/ibexa/phpstan/extension.neon - phpstan-baseline.neon parameters: From 2d5878d177003a26c8b4bdb923006d378e3bb2f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Nowak?= Date: Tue, 22 Sep 2026 08:43:45 +0200 Subject: [PATCH 2/3] IBX-12654: Fixed dynamic calls to static methods --- phpstan-baseline.neon | 222 -------------- .../bundle/EventListener/CsrfListenerTest.php | 6 +- .../EventListener/EventListenerTestCase.php | 2 +- .../EventListener/RequestListenerTest.php | 4 +- .../SupportedMediaTypesSubscriberTest.php | 2 +- tests/bundle/Functional/RootTest.php | 270 +++++++----------- .../RelationListProcessorTest.php | 10 +- tests/lib/Input/ParsingDispatcherTest.php | 10 +- tests/lib/Output/Generator/JsonTest.php | 2 +- tests/lib/Output/Generator/XmlTest.php | 2 +- .../Normalizer/ArrayListNormalizerTest.php | 4 +- .../Output/ValueObjectVisitorBaseTestCase.php | 2 +- tests/lib/Output/VisitorTest.php | 4 +- .../AuthenticationSuccessSubscriberTest.php | 10 +- ...JsonLoginHeaderReplacingSubscriberTest.php | 2 +- .../Server/Input/Parser/ContentCreateTest.php | 2 +- .../ContainsFieldDefinitionIdTest.php | 4 +- .../Criterion/ContentTypeGroupIdTest.php | 4 +- .../Criterion/ContentTypeGroupNameTest.php | 4 +- .../Criterion/ContentTypeIdTest.php | 4 +- .../Criterion/ContentTypeIdentifierTest.php | 4 +- .../ContentType/Criterion/IsSystemTest.php | 4 +- .../SortClause/SortClauseProcessorTest.php | 2 +- .../Input/Parser/Criterion/LogicalAndTest.php | 6 +- .../Input/Parser/Criterion/LogicalOrTest.php | 6 +- .../Server/Input/Parser/UserCreateTest.php | 4 +- .../Input/Parser/UserGroupCreateTest.php | 4 +- .../Input/Parser/UserGroupUpdateTest.php | 4 +- .../Server/Input/Parser/UserUpdateTest.php | 4 +- .../Server/Input/Parser/VersionUpdateTest.php | 4 +- .../ValueObjectVisitor/BookmarkListTest.php | 10 +- .../ValueObjectVisitor/ContentListTest.php | 15 +- .../ContentObjectStatesTest.php | 10 +- .../ContentTypeGroupListTest.php | 10 +- .../ContentTypeGroupTest.php | 60 ++-- .../ContentTypeInfoListTest.php | 10 +- .../ContentTypeListTest.php | 10 +- .../ValueObjectVisitor/ExceptionTest.php | 8 +- .../ValueObjectVisitor/LocationListTest.php | 10 +- .../ValueObjectVisitor/LocationTest.php | 8 +- .../ObjectStateGroupListTest.php | 10 +- .../ObjectStateGroupTest.php | 16 +- .../ObjectStateListTest.php | 10 +- .../ValueObjectVisitor/PolicyListTest.php | 10 +- .../Output/ValueObjectVisitor/PolicyTest.php | 35 +-- .../ValueObjectVisitor/RelationListTest.php | 10 +- .../RestLocationRootNodeTest.php | 35 +-- .../ValueObjectVisitor/RestLocationTest.php | 112 +++----- .../RestObjectStateTest.php | 55 ++-- .../ValueObjectVisitor/RestRelationTest.php | 30 +- .../ValueObjectVisitor/RestTrashItemTest.php | 48 ++-- .../RestUserGroupRoleAssignmentTest.php | 20 +- .../RestUserRoleAssignmentTest.php | 20 +- .../RoleAssignmentListTest.php | 15 +- .../ValueObjectVisitor/RoleListTest.php | 10 +- .../Output/ValueObjectVisitor/RoleTest.php | 40 ++- .../Output/ValueObjectVisitor/RootTest.php | 30 +- .../ValueObjectVisitor/SectionListTest.php | 10 +- .../Output/ValueObjectVisitor/SectionTest.php | 25 +- .../Output/ValueObjectVisitor/TrashTest.php | 10 +- .../ValueObjectVisitor/URLAliasListTest.php | 10 +- .../ValueObjectVisitor/URLAliasTest.php | 45 ++- .../URLWildcardListTest.php | 10 +- .../ValueObjectVisitor/URLWildcardTest.php | 25 +- .../ValueObjectVisitor/UserGroupListTest.php | 10 +- .../ValueObjectVisitor/UserListTest.php | 10 +- .../ValueObjectVisitor/UserSessionTest.php | 35 +-- .../ValueObjectVisitor/VersionInfoTest.php | 50 ++-- .../ValueObjectVisitor/VersionListTest.php | 10 +- .../Output/ValueObjectVisitor/VersionTest.php | 17 +- 70 files changed, 543 insertions(+), 993 deletions(-) diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index bdd17f209..05f24d95b 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -1110,12 +1110,6 @@ parameters: count: 1 path: tests/bundle/Functional/RootTest.php - - - message: '#^Method Ibexa\\Tests\\Bundle\\Rest\\Functional\\RootTest\:\:assertXMLTag\(\) invoked with 4 parameters, 2\-3 required\.$#' - identifier: arguments.count - count: 54 - path: tests/bundle/Functional/RootTest.php - - message: '#^Method Ibexa\\Tests\\Bundle\\Rest\\Functional\\RootTest\:\:testResultContainsContentByRemoteIdTag\(\) has parameter \$result with no type specified\.$#' identifier: missingType.parameter @@ -1950,90 +1944,18 @@ parameters: count: 1 path: tests/lib/Server/Output/ValueObjectVisitor/CachedValueTest.php - - - message: '#^Method Ibexa\\Tests\\Rest\\Output\\ValueObjectVisitorBaseTestCase\:\:assertXMLTag\(\) invoked with 4 parameters, 2\-3 required\.$#' - identifier: arguments.count - count: 3 - path: tests/lib/Server/Output/ValueObjectVisitor/ContentListTest.php - - - - message: '#^Method Ibexa\\Tests\\Rest\\Output\\ValueObjectVisitorBaseTestCase\:\:assertXMLTag\(\) invoked with 4 parameters, 2\-3 required\.$#' - identifier: arguments.count - count: 2 - path: tests/lib/Server/Output/ValueObjectVisitor/ContentObjectStatesTest.php - - - - message: '#^Method Ibexa\\Tests\\Rest\\Output\\ValueObjectVisitorBaseTestCase\:\:assertXMLTag\(\) invoked with 4 parameters, 2\-3 required\.$#' - identifier: arguments.count - count: 2 - path: tests/lib/Server/Output/ValueObjectVisitor/ContentTypeGroupListTest.php - - - - message: '#^Method Ibexa\\Tests\\Rest\\Output\\ValueObjectVisitorBaseTestCase\:\:assertXMLTag\(\) invoked with 4 parameters, 2\-3 required\.$#' - identifier: arguments.count - count: 12 - path: tests/lib/Server/Output/ValueObjectVisitor/ContentTypeGroupTest.php - - - - message: '#^Method Ibexa\\Tests\\Rest\\Output\\ValueObjectVisitorBaseTestCase\:\:assertXMLTag\(\) invoked with 4 parameters, 2\-3 required\.$#' - identifier: arguments.count - count: 2 - path: tests/lib/Server/Output/ValueObjectVisitor/ContentTypeInfoListTest.php - - - - message: '#^Method Ibexa\\Tests\\Rest\\Output\\ValueObjectVisitorBaseTestCase\:\:assertXMLTag\(\) invoked with 4 parameters, 2\-3 required\.$#' - identifier: arguments.count - count: 2 - path: tests/lib/Server/Output/ValueObjectVisitor/ContentTypeListTest.php - - - - message: '#^Method Ibexa\\Tests\\Rest\\Output\\ValueObjectVisitorBaseTestCase\:\:assertXMLTag\(\) invoked with 4 parameters, 2\-3 required\.$#' - identifier: arguments.count - count: 2 - path: tests/lib/Server/Output/ValueObjectVisitor/LocationListTest.php - - message: '#^Method Ibexa\\Tests\\Rest\\Server\\Output\\ValueObjectVisitor\\LocationTest\:\:getDataForTestVisitLocationAttributesResolvesMainLocation\(\) return type has no value type specified in iterable type iterable\.$#' identifier: missingType.iterableValue count: 1 path: tests/lib/Server/Output/ValueObjectVisitor/LocationTest.php - - - message: '#^Method Ibexa\\Tests\\Rest\\Output\\ValueObjectVisitorBaseTestCase\:\:assertXMLTag\(\) invoked with 4 parameters, 2\-3 required\.$#' - identifier: arguments.count - count: 2 - path: tests/lib/Server/Output/ValueObjectVisitor/ObjectStateGroupListTest.php - - - - message: '#^Method Ibexa\\Tests\\Rest\\Output\\ValueObjectVisitorBaseTestCase\:\:assertXMLTag\(\) invoked with 4 parameters, 2\-3 required\.$#' - identifier: arguments.count - count: 2 - path: tests/lib/Server/Output/ValueObjectVisitor/ObjectStateListTest.php - - - - message: '#^Method Ibexa\\Tests\\Rest\\Output\\ValueObjectVisitorBaseTestCase\:\:assertXMLTag\(\) invoked with 4 parameters, 2\-3 required\.$#' - identifier: arguments.count - count: 2 - path: tests/lib/Server/Output/ValueObjectVisitor/PolicyListTest.php - - message: '#^Parameter \#2 \$path of class Ibexa\\Rest\\Server\\Values\\PolicyList constructor expects string, int given\.$#' identifier: argument.type count: 1 path: tests/lib/Server/Output/ValueObjectVisitor/PolicyListTest.php - - - message: '#^Method Ibexa\\Tests\\Rest\\Output\\ValueObjectVisitorBaseTestCase\:\:assertXMLTag\(\) invoked with 4 parameters, 2\-3 required\.$#' - identifier: arguments.count - count: 7 - path: tests/lib/Server/Output/ValueObjectVisitor/PolicyTest.php - - - - message: '#^Method Ibexa\\Tests\\Rest\\Output\\ValueObjectVisitorBaseTestCase\:\:assertXMLTag\(\) invoked with 4 parameters, 2\-3 required\.$#' - identifier: arguments.count - count: 2 - path: tests/lib/Server/Output/ValueObjectVisitor/RelationListTest.php - - message: '#^Method Ibexa\\Tests\\Rest\\Server\\Output\\ValueObjectVisitor\\RestFieldDefinitionTest\:\:getXpathAssertions\(\) return type has no value type specified in iterable type array\.$#' identifier: missingType.iterableValue @@ -2064,78 +1986,12 @@ parameters: count: 1 path: tests/lib/Server/Output/ValueObjectVisitor/RestFieldDefinitionTest.php - - - message: '#^Method Ibexa\\Tests\\Rest\\Output\\ValueObjectVisitorBaseTestCase\:\:assertXMLTag\(\) invoked with 4 parameters, 2\-3 required\.$#' - identifier: arguments.count - count: 7 - path: tests/lib/Server/Output/ValueObjectVisitor/RestLocationRootNodeTest.php - - - - message: '#^Method Ibexa\\Tests\\Rest\\Output\\ValueObjectVisitorBaseTestCase\:\:assertXMLTag\(\) invoked with 4 parameters, 2\-3 required\.$#' - identifier: arguments.count - count: 22 - path: tests/lib/Server/Output/ValueObjectVisitor/RestLocationTest.php - - - - message: '#^Method Ibexa\\Tests\\Rest\\Output\\ValueObjectVisitorBaseTestCase\:\:assertXMLTag\(\) invoked with 4 parameters, 2\-3 required\.$#' - identifier: arguments.count - count: 11 - path: tests/lib/Server/Output/ValueObjectVisitor/RestObjectStateTest.php - - - - message: '#^Method Ibexa\\Tests\\Rest\\Output\\ValueObjectVisitorBaseTestCase\:\:assertXMLTag\(\) invoked with 4 parameters, 2\-3 required\.$#' - identifier: arguments.count - count: 6 - path: tests/lib/Server/Output/ValueObjectVisitor/RestRelationTest.php - - - - message: '#^Method Ibexa\\Tests\\Rest\\Output\\ValueObjectVisitorBaseTestCase\:\:assertXMLTag\(\) invoked with 4 parameters, 2\-3 required\.$#' - identifier: arguments.count - count: 4 - path: tests/lib/Server/Output/ValueObjectVisitor/RestTrashItemTest.php - - - - message: '#^Method Ibexa\\Tests\\Rest\\Output\\ValueObjectVisitorBaseTestCase\:\:assertXMLTag\(\) invoked with 4 parameters, 2\-3 required\.$#' - identifier: arguments.count - count: 4 - path: tests/lib/Server/Output/ValueObjectVisitor/RestUserGroupRoleAssignmentTest.php - - - - message: '#^Method Ibexa\\Tests\\Rest\\Output\\ValueObjectVisitorBaseTestCase\:\:assertXMLTag\(\) invoked with 4 parameters, 2\-3 required\.$#' - identifier: arguments.count - count: 4 - path: tests/lib/Server/Output/ValueObjectVisitor/RestUserRoleAssignmentTest.php - - - - message: '#^Method Ibexa\\Tests\\Rest\\Output\\ValueObjectVisitorBaseTestCase\:\:assertXMLTag\(\) invoked with 4 parameters, 2\-3 required\.$#' - identifier: arguments.count - count: 3 - path: tests/lib/Server/Output/ValueObjectVisitor/RoleAssignmentListTest.php - - - - message: '#^Method Ibexa\\Tests\\Rest\\Output\\ValueObjectVisitorBaseTestCase\:\:assertXMLTag\(\) invoked with 4 parameters, 2\-3 required\.$#' - identifier: arguments.count - count: 2 - path: tests/lib/Server/Output/ValueObjectVisitor/RoleListTest.php - - - - message: '#^Method Ibexa\\Tests\\Rest\\Output\\ValueObjectVisitorBaseTestCase\:\:assertXMLTag\(\) invoked with 4 parameters, 2\-3 required\.$#' - identifier: arguments.count - count: 5 - path: tests/lib/Server/Output/ValueObjectVisitor/RoleTest.php - - message: '#^Unreachable statement \- code above always terminates\.$#' identifier: deadCode.unreachable count: 3 path: tests/lib/Server/Output/ValueObjectVisitor/RoleTest.php - - - message: '#^Method Ibexa\\Tests\\Rest\\Output\\ValueObjectVisitorBaseTestCase\:\:assertXMLTag\(\) invoked with 4 parameters, 2\-3 required\.$#' - identifier: arguments.count - count: 6 - path: tests/lib/Server/Output/ValueObjectVisitor/RootTest.php - - message: '#^Method Ibexa\\Tests\\Rest\\Server\\Output\\ValueObjectVisitor\\RootTest\:\:testResultContainsRouterWithAttributes\(\) has parameter \$result with no type specified\.$#' identifier: missingType.parameter @@ -2153,81 +2009,3 @@ parameters: identifier: missingType.parameter count: 1 path: tests/lib/Server/Output/ValueObjectVisitor/RootTest.php - - - - message: '#^Method Ibexa\\Tests\\Rest\\Output\\ValueObjectVisitorBaseTestCase\:\:assertXMLTag\(\) invoked with 4 parameters, 2\-3 required\.$#' - identifier: arguments.count - count: 2 - path: tests/lib/Server/Output/ValueObjectVisitor/SectionListTest.php - - - - message: '#^Method Ibexa\\Tests\\Rest\\Output\\ValueObjectVisitorBaseTestCase\:\:assertXMLTag\(\) invoked with 4 parameters, 2\-3 required\.$#' - identifier: arguments.count - count: 5 - path: tests/lib/Server/Output/ValueObjectVisitor/SectionTest.php - - - - message: '#^Method Ibexa\\Tests\\Rest\\Output\\ValueObjectVisitorBaseTestCase\:\:assertXMLTag\(\) invoked with 4 parameters, 2\-3 required\.$#' - identifier: arguments.count - count: 2 - path: tests/lib/Server/Output/ValueObjectVisitor/TrashTest.php - - - - message: '#^Method Ibexa\\Tests\\Rest\\Output\\ValueObjectVisitorBaseTestCase\:\:assertXMLTag\(\) invoked with 4 parameters, 2\-3 required\.$#' - identifier: arguments.count - count: 2 - path: tests/lib/Server/Output/ValueObjectVisitor/URLAliasListTest.php - - - - message: '#^Method Ibexa\\Tests\\Rest\\Output\\ValueObjectVisitorBaseTestCase\:\:assertXMLTag\(\) invoked with 4 parameters, 2\-3 required\.$#' - identifier: arguments.count - count: 9 - path: tests/lib/Server/Output/ValueObjectVisitor/URLAliasTest.php - - - - message: '#^Method Ibexa\\Tests\\Rest\\Output\\ValueObjectVisitorBaseTestCase\:\:assertXMLTag\(\) invoked with 4 parameters, 2\-3 required\.$#' - identifier: arguments.count - count: 2 - path: tests/lib/Server/Output/ValueObjectVisitor/URLWildcardListTest.php - - - - message: '#^Method Ibexa\\Tests\\Rest\\Output\\ValueObjectVisitorBaseTestCase\:\:assertXMLTag\(\) invoked with 4 parameters, 2\-3 required\.$#' - identifier: arguments.count - count: 5 - path: tests/lib/Server/Output/ValueObjectVisitor/URLWildcardTest.php - - - - message: '#^Method Ibexa\\Tests\\Rest\\Output\\ValueObjectVisitorBaseTestCase\:\:assertXMLTag\(\) invoked with 4 parameters, 2\-3 required\.$#' - identifier: arguments.count - count: 2 - path: tests/lib/Server/Output/ValueObjectVisitor/UserGroupListTest.php - - - - message: '#^Method Ibexa\\Tests\\Rest\\Output\\ValueObjectVisitorBaseTestCase\:\:assertXMLTag\(\) invoked with 4 parameters, 2\-3 required\.$#' - identifier: arguments.count - count: 2 - path: tests/lib/Server/Output/ValueObjectVisitor/UserListTest.php - - - - message: '#^Method Ibexa\\Tests\\Rest\\Output\\ValueObjectVisitorBaseTestCase\:\:assertXMLTag\(\) invoked with 4 parameters, 2\-3 required\.$#' - identifier: arguments.count - count: 7 - path: tests/lib/Server/Output/ValueObjectVisitor/UserSessionTest.php - - - - message: '#^Method Ibexa\\Tests\\Rest\\Output\\ValueObjectVisitorBaseTestCase\:\:assertXMLTag\(\) invoked with 4 parameters, 2\-3 required\.$#' - identifier: arguments.count - count: 10 - path: tests/lib/Server/Output/ValueObjectVisitor/VersionInfoTest.php - - - - message: '#^Method Ibexa\\Tests\\Rest\\Output\\ValueObjectVisitorBaseTestCase\:\:assertXMLTag\(\) invoked with 4 parameters, 2\-3 required\.$#' - identifier: arguments.count - count: 2 - path: tests/lib/Server/Output/ValueObjectVisitor/VersionListTest.php - - - - message: '#^Method Ibexa\\Tests\\Rest\\Output\\ValueObjectVisitorBaseTestCase\:\:assertXMLTag\(\) invoked with 4 parameters, 2\-3 required\.$#' - identifier: arguments.count - count: 3 - path: tests/lib/Server/Output/ValueObjectVisitor/VersionTest.php diff --git a/tests/bundle/EventListener/CsrfListenerTest.php b/tests/bundle/EventListener/CsrfListenerTest.php index cfff0bf0b..693c5dc1b 100644 --- a/tests/bundle/EventListener/CsrfListenerTest.php +++ b/tests/bundle/EventListener/CsrfListenerTest.php @@ -37,7 +37,7 @@ public static function provideExpectedSubscribedEventTypes(): array public function testIsNotRestRequest(): void { $listener = $this->getEventListener(); - $request = $this->createStub(Request::class); + $request = self::createStub(Request::class); $request->attributes = new ParameterBag(); $listener->onKernelRequest( @@ -47,7 +47,7 @@ public function testIsNotRestRequest(): void public function testCsrfDisabled(): void { - $request = $this->createStub(Request::class); + $request = self::createStub(Request::class); $request->attributes = new ParameterBag([ 'is_rest_request' => true, ]); @@ -130,7 +130,7 @@ public function testSessionRequests(): void public function testSkipCsrfProtection(): void { - $request = $this->createStub(Request::class); + $request = self::createStub(Request::class); $request->attributes = $this->getRequestAttributesMock(); $request->headers = $this->getRequestHeadersMock(); diff --git a/tests/bundle/EventListener/EventListenerTestCase.php b/tests/bundle/EventListener/EventListenerTestCase.php index 695deb034..4beb445cd 100644 --- a/tests/bundle/EventListener/EventListenerTestCase.php +++ b/tests/bundle/EventListener/EventListenerTestCase.php @@ -34,7 +34,7 @@ public function testGetSubscribedEvents(array $expectedEventTypes): void { $eventListener = $this->getEventListener(); - $supportedEvents = $eventListener->getSubscribedEvents(); + $supportedEvents = $eventListener::getSubscribedEvents(); $supportedEventTypes = array_keys($supportedEvents); sort($supportedEventTypes); sort($expectedEventTypes); diff --git a/tests/bundle/EventListener/RequestListenerTest.php b/tests/bundle/EventListener/RequestListenerTest.php index b9ddfd8db..3c312fb3b 100644 --- a/tests/bundle/EventListener/RequestListenerTest.php +++ b/tests/bundle/EventListener/RequestListenerTest.php @@ -90,14 +90,14 @@ public function testOnKernelRequest(string $uri, bool $isExpectedRestRequest): v protected function getEventListener(?bool $csrfEnabled = null): RequestListener { return new RequestListener( - new UriParser($this->createStub(UrlMatcherInterface::class)) + new UriParser(self::createStub(UrlMatcherInterface::class)) ); } protected function performFakeRequest(string $uri, int $type = HttpKernelInterface::MAIN_REQUEST): Request { $event = new RequestEvent( - $this->createStub(HttpKernelInterface::class), + self::createStub(HttpKernelInterface::class), Request::create($uri), $type ); diff --git a/tests/bundle/EventListener/SupportedMediaTypesSubscriberTest.php b/tests/bundle/EventListener/SupportedMediaTypesSubscriberTest.php index 637b78551..b7b51f701 100644 --- a/tests/bundle/EventListener/SupportedMediaTypesSubscriberTest.php +++ b/tests/bundle/EventListener/SupportedMediaTypesSubscriberTest.php @@ -25,7 +25,7 @@ protected function setUp(): void { parent::setUp(); - $this->kernel = $this->createStub(HttpKernelInterface::class); + $this->kernel = self::createStub(HttpKernelInterface::class); } public function testDoesNothingWhenSupportedMediaTypesParameterIsNotSet(): void diff --git a/tests/bundle/Functional/RootTest.php b/tests/bundle/Functional/RootTest.php index ccf2f2d63..e3d8b4e40 100644 --- a/tests/bundle/Functional/RootTest.php +++ b/tests/bundle/Functional/RootTest.php @@ -69,11 +69,10 @@ public function testCatchAll(string $uri): void #[Depends('testLoadRootResource')] public function testResultContainsRootElement($result): void { - $this->assertXMLTag( + self::assertXMLTag( ['tag' => 'Root'], $result, - 'Invalid element.', - false + 'Invalid element.' ); } @@ -85,7 +84,7 @@ public function testResultContainsRootElement($result): void #[Depends('testLoadRootResource')] public function testResultContainsRootAttributes($result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'Root', 'attributes' => [ @@ -93,28 +92,26 @@ public function testResultContainsRootAttributes($result): void ], ], $result, - 'Invalid attributes.', - false + 'Invalid attributes.' ); } #[Depends('testLoadRootResource')] public function testResultContainsContentTag($result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'content', ], $result, - 'Invalid element.', - false + 'Invalid element.' ); } #[Depends('testLoadRootResource')] public function testResultContainsContentTagAttributes($result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'content', 'attributes' => [ @@ -123,28 +120,26 @@ public function testResultContainsContentTagAttributes($result): void ], ], $result, - 'Invalid element.', - false + 'Invalid element.' ); } #[Depends('testLoadRootResource')] public function testResultContainsContentByRemoteIdTag($result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'contentByRemoteId', ], $result, - 'Missing element.', - false + 'Missing element.' ); } #[Depends('testLoadRootResource')] public function testResultContainsContentByRemoteIdTagAttributes($result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'contentByRemoteId', 'attributes' => [ @@ -153,28 +148,26 @@ public function testResultContainsContentByRemoteIdTagAttributes($result): void ], ], $result, - 'Invalid tag attributes.', - false + 'Invalid tag attributes.' ); } #[Depends('testLoadRootResource')] public function testResultContainsContentTypesTag($result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'contentTypes', ], $result, - 'Invalid element.', - false + 'Invalid element.' ); } #[Depends('testLoadRootResource')] public function testResultContainsContentTypesTagAttributes($result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'contentTypes', 'attributes' => [ @@ -183,28 +176,26 @@ public function testResultContainsContentTypesTagAttributes($result): void ], ], $result, - 'Invalid element.', - false + 'Invalid element.' ); } #[Depends('testLoadRootResource')] public function testResultContainsContentTypeByIdentifierTag($result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'contentTypeByIdentifier', ], $result, - 'Invalid element.', - false + 'Invalid element.' ); } #[Depends('testLoadRootResource')] public function testResultContainsContentTypeByIdentifierTagAttributes($result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'contentTypeByIdentifier', 'attributes' => [ @@ -213,28 +204,26 @@ public function testResultContainsContentTypeByIdentifierTagAttributes($result): ], ], $result, - 'Invalid tag attributes.', - false + 'Invalid tag attributes.' ); } #[Depends('testLoadRootResource')] public function testResultContainsContentTypeGroupsTag($result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'contentTypeGroups', ], $result, - 'Missing element.', - false + 'Missing element.' ); } #[Depends('testLoadRootResource')] public function testResultContainsContentTypeGroupsTagAttributes($result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'contentTypeGroups', 'attributes' => [ @@ -243,28 +232,26 @@ public function testResultContainsContentTypeGroupsTagAttributes($result): void ], ], $result, - 'Invalid tag attributes.', - false + 'Invalid tag attributes.' ); } #[Depends('testLoadRootResource')] public function testResultContainsContentTypeGroupByIdentifierTag($result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'contentTypeGroupByIdentifier', ], $result, - 'Missing element.', - false + 'Missing element.' ); } #[Depends('testLoadRootResource')] public function testResultContainsContentTypeGroupByIdentifierTagAttributes($result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'contentTypeGroupByIdentifier', 'attributes' => [ @@ -273,28 +260,26 @@ public function testResultContainsContentTypeGroupByIdentifierTagAttributes($res ], ], $result, - 'Invalid tag attributes.', - false + 'Invalid tag attributes.' ); } #[Depends('testLoadRootResource')] public function testResultContainsUsersTag($result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'users', ], $result, - 'Invalid tag.', - false + 'Invalid tag.' ); } #[Depends('testLoadRootResource')] public function testResultContainsUsersTagAttributes($result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'users', 'attributes' => [ @@ -303,28 +288,26 @@ public function testResultContainsUsersTagAttributes($result): void ], ], $result, - 'Invalid tag attributes.', - false + 'Invalid tag attributes.' ); } #[Depends('testLoadRootResource')] public function testResultContainsUsersByRoleIdentifierTag($result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'usersByRoleId', ], $result, - 'Missing element.', - false + 'Missing element.' ); } #[Depends('testLoadRootResource')] public function testResultContainsUsersByRoleIdentifierTagAttributes($result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'usersByRoleId', 'attributes' => [ @@ -333,28 +316,26 @@ public function testResultContainsUsersByRoleIdentifierTagAttributes($result): v ], ], $result, - 'Invalid tag attributes.', - false + 'Invalid tag attributes.' ); } #[Depends('testLoadRootResource')] public function testResultContainsUsersByRemoteIdentifierTag($result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'usersByRemoteId', ], $result, - 'Missing element.', - false + 'Missing element.' ); } #[Depends('testLoadRootResource')] public function testResultContainsUsersByRemoteIdentifierTagAttributes($result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'usersByRemoteId', 'attributes' => [ @@ -363,28 +344,26 @@ public function testResultContainsUsersByRemoteIdentifierTagAttributes($result): ], ], $result, - 'Invalid tag attributes.', - false + 'Invalid tag attributes.' ); } #[Depends('testLoadRootResource')] public function testResultContainsUsersByEmailTag($result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'usersByEmail', ], $result, - 'Missing element.', - false + 'Missing element.' ); } #[Depends('testLoadRootResource')] public function testResultContainsUsersByEmailTagAttributes($result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'usersByEmail', 'attributes' => [ @@ -393,28 +372,26 @@ public function testResultContainsUsersByEmailTagAttributes($result): void ], ], $result, - 'Invalid tag attributes.', - false + 'Invalid tag attributes.' ); } #[Depends('testLoadRootResource')] public function testResultContainsUsersByLoginTag($result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'usersByLogin', ], $result, - 'Missing element.', - false + 'Missing element.' ); } #[Depends('testLoadRootResource')] public function testResultContainsUsersByLoginTagAttributes($result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'usersByLogin', 'attributes' => [ @@ -423,28 +400,26 @@ public function testResultContainsUsersByLoginTagAttributes($result): void ], ], $result, - 'Invalid tag attributes.', - false + 'Invalid tag attributes.' ); } #[Depends('testLoadRootResource')] public function testResultContainsRolesTag($result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'roles', ], $result, - 'Invalid tag.', - false + 'Invalid tag.' ); } #[Depends('testLoadRootResource')] public function testResultContainsRolesTagAttributes($result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'roles', 'attributes' => [ @@ -453,28 +428,26 @@ public function testResultContainsRolesTagAttributes($result): void ], ], $result, - 'Invalid tag attributes.', - false + 'Invalid tag attributes.' ); } #[Depends('testLoadRootResource')] public function testResultContainsRootLocationTag($result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'rootLocation', ], $result, - 'Invalid tag.', - false + 'Invalid tag.' ); } #[Depends('testLoadRootResource')] public function testResultContainsRootLocationTagAttributes($result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'rootLocation', 'attributes' => [ @@ -483,28 +456,26 @@ public function testResultContainsRootLocationTagAttributes($result): void ], ], $result, - 'Invalid tag attributes.', - false + 'Invalid tag attributes.' ); } #[Depends('testLoadRootResource')] public function testResultContainsRootUserGroupTag($result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'rootUserGroup', ], $result, - 'Invalid tag.', - false + 'Invalid tag.' ); } #[Depends('testLoadRootResource')] public function testResultContainsRootUserGroupTagAttributes($result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'rootUserGroup', 'attributes' => [ @@ -513,28 +484,26 @@ public function testResultContainsRootUserGroupTagAttributes($result): void ], ], $result, - 'Invalid tag attributes.', - false + 'Invalid tag attributes.' ); } #[Depends('testLoadRootResource')] public function testResultContainsRootMediaFolderTag($result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'rootMediaFolder', ], $result, - 'Invalid tag.', - false + 'Invalid tag.' ); } #[Depends('testLoadRootResource')] public function testResultContainsRootMediaFolderTagAttributes($result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'rootMediaFolder', 'attributes' => [ @@ -543,28 +512,26 @@ public function testResultContainsRootMediaFolderTagAttributes($result): void ], ], $result, - 'Invalid tag attributes.', - false + 'Invalid tag attributes.' ); } #[Depends('testLoadRootResource')] public function testResultContainsLocationByRemoteIdTag($result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'locationByRemoteId', ], $result, - 'Missing tag.', - false + 'Missing tag.' ); } #[Depends('testLoadRootResource')] public function testResultContainsLocationByRemoteIdTagAttributes($result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'locationByRemoteId', 'attributes' => [ @@ -573,28 +540,26 @@ public function testResultContainsLocationByRemoteIdTagAttributes($result): void ], ], $result, - 'Invalid tag attributes.', - false + 'Invalid tag attributes.' ); } #[Depends('testLoadRootResource')] public function testResultContainsLocationByPathTag($result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'locationByPath', ], $result, - 'Missing tag.', - false + 'Missing tag.' ); } #[Depends('testLoadRootResource')] public function testResultContainsLocationByPathTagAttributes($result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'locationByPath', 'attributes' => [ @@ -603,28 +568,26 @@ public function testResultContainsLocationByPathTagAttributes($result): void ], ], $result, - 'Invalid tag attributes.', - false + 'Invalid tag attributes.' ); } #[Depends('testLoadRootResource')] public function testResultContainsTrashTag($result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'trash', ], $result, - 'Invalid tag.', - false + 'Invalid tag.' ); } #[Depends('testLoadRootResource')] public function testResultContainsTrashTagAttributes($result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'trash', 'attributes' => [ @@ -633,28 +596,26 @@ public function testResultContainsTrashTagAttributes($result): void ], ], $result, - 'Invalid tag attributes.', - false + 'Invalid tag attributes.' ); } #[Depends('testLoadRootResource')] public function testResultContainsSectionsTag($result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'sections', ], $result, - 'Invalid tag.', - false + 'Invalid tag.' ); } #[Depends('testLoadRootResource')] public function testResultContainsSectionTagAttributes($result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'sections', 'attributes' => [ @@ -663,28 +624,26 @@ public function testResultContainsSectionTagAttributes($result): void ], ], $result, - 'Invalid tag attributes.', - false + 'Invalid tag attributes.' ); } #[Depends('testLoadRootResource')] public function testResultContainsViewsTag($result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'views', ], $result, - 'Invalid tag.', - false + 'Invalid tag.' ); } #[Depends('testLoadRootResource')] public function testResultContainsViewsTagAttributes($result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'views', 'attributes' => [ @@ -693,28 +652,26 @@ public function testResultContainsViewsTagAttributes($result): void ], ], $result, - 'Invalid tag attributes.', - false + 'Invalid tag attributes.' ); } #[Depends('testLoadRootResource')] public function testResultContainsObjectStateGroupsTag($result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'objectStateGroups', ], $result, - 'Missing tag.', - false + 'Missing tag.' ); } #[Depends('testLoadRootResource')] public function testResultContainsObjectStateGroupsTagAttributes($result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'objectStateGroups', 'attributes' => [ @@ -723,28 +680,26 @@ public function testResultContainsObjectStateGroupsTagAttributes($result): void ], ], $result, - 'Invalid tag attributes.', - false + 'Invalid tag attributes.' ); } #[Depends('testLoadRootResource')] public function testResultContainsObjectStatesTag($result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'objectStates', ], $result, - 'Missing tag.', - false + 'Missing tag.' ); } #[Depends('testLoadRootResource')] public function testResultContainsObjectStatesTagAttributes($result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'objectStates', 'attributes' => [ @@ -753,28 +708,26 @@ public function testResultContainsObjectStatesTagAttributes($result): void ], ], $result, - 'Invalid tag attributes.', - false + 'Invalid tag attributes.' ); } #[Depends('testLoadRootResource')] public function testResultContainsGlobalUrlAliasesTag($result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'globalUrlAliases', ], $result, - 'Missing tag.', - false + 'Missing tag.' ); } #[Depends('testLoadRootResource')] public function testResultContainsGlobalUrlAliasesTagAttributes($result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'globalUrlAliases', 'attributes' => [ @@ -783,28 +736,26 @@ public function testResultContainsGlobalUrlAliasesTagAttributes($result): void ], ], $result, - 'Invalid tag attributes.', - false + 'Invalid tag attributes.' ); } #[Depends('testLoadRootResource')] public function testResultContainsUrlWildcardsTag($result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'urlWildcards', ], $result, - 'Missing tag.', - false + 'Missing tag.' ); } #[Depends('testLoadRootResource')] public function testResultContainsUrlWildcardsTagAttributes($result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'urlWildcards', 'attributes' => [ @@ -813,28 +764,26 @@ public function testResultContainsUrlWildcardsTagAttributes($result): void ], ], $result, - 'Invalid tag attributes.', - false + 'Invalid tag attributes.' ); } #[Depends('testLoadRootResource')] public function testResultContainsCreateSessionTag($result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'createSession', ], $result, - 'Missing tag.', - false + 'Missing tag.' ); } #[Depends('testLoadRootResource')] public function testResultContainsCreateSessionTagAttributes($result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'createSession', 'attributes' => [ @@ -843,28 +792,26 @@ public function testResultContainsCreateSessionTagAttributes($result): void ], ], $result, - 'Invalid tag attributes.', - false + 'Invalid tag attributes.' ); } #[Depends('testLoadRootResource')] public function testResultContainsRefreshSessionTag($result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'refreshSession', ], $result, - 'Missing tag.', - false + 'Missing tag.' ); } #[Depends('testLoadRootResource')] public function testResultContainsRefreshSessionTagAttributes($result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'refreshSession', 'attributes' => [ @@ -873,8 +820,7 @@ public function testResultContainsRefreshSessionTagAttributes($result): void ], ], $result, - 'Invalid tag attributes.', - false + 'Invalid tag attributes.' ); } diff --git a/tests/lib/FieldTypeProcessor/RelationListProcessorTest.php b/tests/lib/FieldTypeProcessor/RelationListProcessorTest.php index 17a66c132..d3d84dac2 100644 --- a/tests/lib/FieldTypeProcessor/RelationListProcessorTest.php +++ b/tests/lib/FieldTypeProcessor/RelationListProcessorTest.php @@ -115,16 +115,16 @@ public function testPostProcessValueHash(): void $routerMock ->expects($matcher) - ->method('generate')->willReturnCallback(function (...$parameters) use ($matcher) { + ->method('generate')->willReturnCallback(static function (...$parameters) use ($matcher) { if ($matcher->numberOfInvocations() === 1) { - $this->assertSame('ibexa.rest.load_content', $parameters[0]); - $this->assertSame(['contentId' => 42], $parameters[1]); + self::assertSame('ibexa.rest.load_content', $parameters[0]); + self::assertSame(['contentId' => 42], $parameters[1]); return '/api/ibexa/v2/content/objects/42'; } if ($matcher->numberOfInvocations() === 2) { - $this->assertSame('ibexa.rest.load_content', $parameters[0]); - $this->assertSame(['contentId' => 300], $parameters[1]); + self::assertSame('ibexa.rest.load_content', $parameters[0]); + self::assertSame(['contentId' => 300], $parameters[1]); return '/api/ibexa/v2/content/objects/300'; } diff --git a/tests/lib/Input/ParsingDispatcherTest.php b/tests/lib/Input/ParsingDispatcherTest.php index 9ab769b10..667e792e0 100644 --- a/tests/lib/Input/ParsingDispatcherTest.php +++ b/tests/lib/Input/ParsingDispatcherTest.php @@ -22,7 +22,7 @@ public function testParseMissingContentType(): void { $this->expectException(\Ibexa\Contracts\Rest\Exceptions\Parser::class); - $dispatcher = new ParsingDispatcher($this->createStub(EventDispatcherInterface::class)); + $dispatcher = new ParsingDispatcher(self::createStub(EventDispatcherInterface::class)); $dispatcher->parse([], 'text/unknown'); } @@ -30,7 +30,7 @@ public function testParseMissingContentType(): void public function testParse(): void { $parser = $this->createParserMock(); - $dispatcher = new ParsingDispatcher($this->createStub(EventDispatcherInterface::class), ['text/html' => $parser]); + $dispatcher = new ParsingDispatcher(self::createStub(EventDispatcherInterface::class), ['text/html' => $parser]); $parser ->expects(self::once()) @@ -50,7 +50,7 @@ public function testParse(): void public function testParseCharset(): void { $parser = $this->createParserMock(); - $dispatcher = new ParsingDispatcher($this->createStub(EventDispatcherInterface::class), ['text/html' => $parser]); + $dispatcher = new ParsingDispatcher(self::createStub(EventDispatcherInterface::class), ['text/html' => $parser]); $parser ->expects(self::once()) @@ -69,7 +69,7 @@ public function testParseVersion(): void $parserVersionOne = $this->createParserMock(); $parserVersionTwo = $this->createParserMock(); $dispatcher = new ParsingDispatcher( - $this->createStub(EventDispatcherInterface::class), + self::createStub(EventDispatcherInterface::class), [ 'text/html' => $parserVersionOne, 'text/html; version=2' => $parserVersionTwo, @@ -85,7 +85,7 @@ public function testParseVersion(): void public function testParseStripFormat(): void { $parser = $this->createParserMock(); - $dispatcher = new ParsingDispatcher($this->createStub(EventDispatcherInterface::class), ['text/html' => $parser]); + $dispatcher = new ParsingDispatcher(self::createStub(EventDispatcherInterface::class), ['text/html' => $parser]); $parser ->expects(self::once()) diff --git a/tests/lib/Output/Generator/JsonTest.php b/tests/lib/Output/Generator/JsonTest.php index fd70bf4ad..81355fbfd 100644 --- a/tests/lib/Output/Generator/JsonTest.php +++ b/tests/lib/Output/Generator/JsonTest.php @@ -301,7 +301,7 @@ protected function getGenerator() { if (!isset($this->generator)) { $this->generator = new Json( - $this->createStub(FieldTypeHashGenerator::class) + self::createStub(FieldTypeHashGenerator::class) ); } diff --git a/tests/lib/Output/Generator/XmlTest.php b/tests/lib/Output/Generator/XmlTest.php index d0c3f3e5f..66d153165 100644 --- a/tests/lib/Output/Generator/XmlTest.php +++ b/tests/lib/Output/Generator/XmlTest.php @@ -273,7 +273,7 @@ protected function getGenerator(): Generator { if (!isset($this->generator)) { $fieldTypeHashGenerator = new Xml\FieldTypeHashGenerator( - $this->createStub(NormalizerInterface::class), + self::createStub(NormalizerInterface::class), ); $this->generator = new Xml( $fieldTypeHashGenerator, diff --git a/tests/lib/Output/Normalizer/ArrayListNormalizerTest.php b/tests/lib/Output/Normalizer/ArrayListNormalizerTest.php index 5ed0f9db4..0664a7f3b 100644 --- a/tests/lib/Output/Normalizer/ArrayListNormalizerTest.php +++ b/tests/lib/Output/Normalizer/ArrayListNormalizerTest.php @@ -24,7 +24,7 @@ public function testNormalize(): void $normalizer->setNormalizer($mockedInnerNormalizer); $mockedInnerNormalizer->method('normalize')->willReturnArgument(0); - $list = new ArrayList('foo', $this->createStub(DataObjectInterface::class)); + $list = new ArrayList('foo', self::createStub(DataObjectInterface::class)); $list->append('bar'); $result = $normalizer->normalize($list); @@ -40,7 +40,7 @@ public function testNormalizeWithArrayAppend(): void $normalizer->setNormalizer($mockedInnerNormalizer); $mockedInnerNormalizer->method('normalize')->willReturnArgument(0); - $list = new ArrayList('test', $this->createStub(DataObjectInterface::class)); + $list = new ArrayList('test', self::createStub(DataObjectInterface::class)); $list->append(['foo' => 'bar']); $list->append(['foo' => 'zzz']); diff --git a/tests/lib/Output/ValueObjectVisitorBaseTestCase.php b/tests/lib/Output/ValueObjectVisitorBaseTestCase.php index d0354c92d..5cb51f01c 100644 --- a/tests/lib/Output/ValueObjectVisitorBaseTestCase.php +++ b/tests/lib/Output/ValueObjectVisitorBaseTestCase.php @@ -74,7 +74,7 @@ protected function getGenerator(): Xml if (!isset($this->generator)) { $this->generator = new Generator\Xml( new Generator\Xml\FieldTypeHashGenerator( - $this->createStub(NormalizerInterface::class), + self::createStub(NormalizerInterface::class), ), ); } diff --git a/tests/lib/Output/VisitorTest.php b/tests/lib/Output/VisitorTest.php index b7cdb13e2..2f6c7b54c 100644 --- a/tests/lib/Output/VisitorTest.php +++ b/tests/lib/Output/VisitorTest.php @@ -36,10 +36,10 @@ public function setUp(): void { parent::setUp(); - $this->generator = $this->createStub(Generator::class); + $this->generator = self::createStub(Generator::class); $this->normalizer = $this->createMock(NormalizerInterface::class); $this->encoder = $this->createMock(EncoderInterface::class); - $this->valueObjectVisitorResolver = $this->createStub(ValueObjectVisitorResolverInterface::class); + $this->valueObjectVisitorResolver = self::createStub(ValueObjectVisitorResolverInterface::class); $this->visitor = new Visitor( $this->generator, diff --git a/tests/lib/Security/EventListener/JWT/AuthenticationSuccessSubscriberTest.php b/tests/lib/Security/EventListener/JWT/AuthenticationSuccessSubscriberTest.php index 2d1f51eca..f3562ad9b 100644 --- a/tests/lib/Security/EventListener/JWT/AuthenticationSuccessSubscriberTest.php +++ b/tests/lib/Security/EventListener/JWT/AuthenticationSuccessSubscriberTest.php @@ -26,15 +26,11 @@ final class AuthenticationSuccessSubscriberTest extends TestCase { public function testGetSubscribedEvents(): void { - $subscriber = new AuthenticationSuccessSubscriber( - $this->getRequestStackMock() - ); - self::assertEquals( [ Events::AUTHENTICATION_SUCCESS => ['onAuthenticationSuccess', 10], ], - $subscriber->getSubscribedEvents() + AuthenticationSuccessSubscriber::getSubscribedEvents() ); } @@ -91,7 +87,7 @@ public function testResponseIsMissingJwtToken(): void 'some_other' => 'data', 'but_no_token' => 'anywhere', ], - new User($this->createStub(ApiUser::class)), + new User(self::createStub(ApiUser::class)), new Response() ); @@ -110,7 +106,7 @@ public function testSkippingResponseNormalizingForNonRestRequest(): void [ 'token' => 'foo', ], - new User($this->createStub(ApiUser::class)), + new User(self::createStub(ApiUser::class)), new Response() ); diff --git a/tests/lib/Security/EventListener/JWT/JsonLoginHeaderReplacingSubscriberTest.php b/tests/lib/Security/EventListener/JWT/JsonLoginHeaderReplacingSubscriberTest.php index 3e13f5422..4ff88f4d3 100644 --- a/tests/lib/Security/EventListener/JWT/JsonLoginHeaderReplacingSubscriberTest.php +++ b/tests/lib/Security/EventListener/JWT/JsonLoginHeaderReplacingSubscriberTest.php @@ -31,7 +31,7 @@ public function testGetSubscribedEvents(): void [ KernelEvents::REQUEST => ['replaceJsonLoginHeader', 10], ], - $this->subscriber->getSubscribedEvents() + JsonLoginHeaderReplacingSubscriber::getSubscribedEvents() ); } diff --git a/tests/lib/Server/Input/Parser/ContentCreateTest.php b/tests/lib/Server/Input/Parser/ContentCreateTest.php index ab7057db0..a41f0b9c5 100644 --- a/tests/lib/Server/Input/Parser/ContentCreateTest.php +++ b/tests/lib/Server/Input/Parser/ContentCreateTest.php @@ -461,7 +461,7 @@ private function getFieldTypeParserMock(): FieldTypeParser & MockObject [ $this->getContentServiceMock(), $this->getContentTypeServiceMock(), - $this->createStub(FieldTypeService::class), + self::createStub(FieldTypeService::class), ] ) ->getMock(); diff --git a/tests/lib/Server/Input/Parser/ContentType/Criterion/ContainsFieldDefinitionIdTest.php b/tests/lib/Server/Input/Parser/ContentType/Criterion/ContainsFieldDefinitionIdTest.php index f6dc0861b..d6925f022 100644 --- a/tests/lib/Server/Input/Parser/ContentType/Criterion/ContainsFieldDefinitionIdTest.php +++ b/tests/lib/Server/Input/Parser/ContentType/Criterion/ContainsFieldDefinitionIdTest.php @@ -30,7 +30,7 @@ public function testValidInput(): void new ContainsFieldDefinitionIdCriterion([1, 5]), $this->parser->parse( ['ContainsFieldDefinitionIdCriterion' => [1, 5]], - $this->createStub(ParsingDispatcher::class) + self::createStub(ParsingDispatcher::class) ) ); } @@ -48,7 +48,7 @@ public function testInvalidInput(string $exceptionMessage, array $input): void $this->parser->parse( $input, - $this->createStub(ParsingDispatcher::class) + self::createStub(ParsingDispatcher::class) ); } diff --git a/tests/lib/Server/Input/Parser/ContentType/Criterion/ContentTypeGroupIdTest.php b/tests/lib/Server/Input/Parser/ContentType/Criterion/ContentTypeGroupIdTest.php index 570b1c3a0..7924f9d8f 100644 --- a/tests/lib/Server/Input/Parser/ContentType/Criterion/ContentTypeGroupIdTest.php +++ b/tests/lib/Server/Input/Parser/ContentType/Criterion/ContentTypeGroupIdTest.php @@ -30,7 +30,7 @@ public function testValidInput(): void new ContentTypeGroupIdCriterion([1, 5]), $this->parser->parse( ['ContentTypeGroupIdCriterion' => [1, 5]], - $this->createStub(ParsingDispatcher::class) + self::createStub(ParsingDispatcher::class) ) ); } @@ -48,7 +48,7 @@ public function testInvalidInput(string $exceptionMessage, array $input): void $this->parser->parse( $input, - $this->createStub(ParsingDispatcher::class) + self::createStub(ParsingDispatcher::class) ); } diff --git a/tests/lib/Server/Input/Parser/ContentType/Criterion/ContentTypeGroupNameTest.php b/tests/lib/Server/Input/Parser/ContentType/Criterion/ContentTypeGroupNameTest.php index 4bf2c2a21..e9f337e0b 100644 --- a/tests/lib/Server/Input/Parser/ContentType/Criterion/ContentTypeGroupNameTest.php +++ b/tests/lib/Server/Input/Parser/ContentType/Criterion/ContentTypeGroupNameTest.php @@ -30,7 +30,7 @@ public function testValidInput(): void new ContentTypeGroupNameCriterion(['Media', 'content']), $this->parser->parse( ['ContentTypeGroupNameCriterion' => ['Media', 'content']], - $this->createStub(ParsingDispatcher::class) + self::createStub(ParsingDispatcher::class) ) ); } @@ -48,7 +48,7 @@ public function testInvalidInput(string $exceptionMessage, array $input): void $this->parser->parse( $input, - $this->createStub(ParsingDispatcher::class) + self::createStub(ParsingDispatcher::class) ); } diff --git a/tests/lib/Server/Input/Parser/ContentType/Criterion/ContentTypeIdTest.php b/tests/lib/Server/Input/Parser/ContentType/Criterion/ContentTypeIdTest.php index e84eae931..d7ebc3473 100644 --- a/tests/lib/Server/Input/Parser/ContentType/Criterion/ContentTypeIdTest.php +++ b/tests/lib/Server/Input/Parser/ContentType/Criterion/ContentTypeIdTest.php @@ -30,7 +30,7 @@ public function testValidInput(): void new ContentTypeIdCriterion([1, 5]), $this->parser->parse( ['ContentTypeIdCriterion' => [1, 5]], - $this->createStub(ParsingDispatcher::class) + self::createStub(ParsingDispatcher::class) ) ); } @@ -48,7 +48,7 @@ public function testInvalidInput(string $exceptionMessage, array $input): void $this->parser->parse( $input, - $this->createStub(ParsingDispatcher::class) + self::createStub(ParsingDispatcher::class) ); } diff --git a/tests/lib/Server/Input/Parser/ContentType/Criterion/ContentTypeIdentifierTest.php b/tests/lib/Server/Input/Parser/ContentType/Criterion/ContentTypeIdentifierTest.php index a323b9719..d36bb66c5 100644 --- a/tests/lib/Server/Input/Parser/ContentType/Criterion/ContentTypeIdentifierTest.php +++ b/tests/lib/Server/Input/Parser/ContentType/Criterion/ContentTypeIdentifierTest.php @@ -30,7 +30,7 @@ public function testValidInput(): void new ContentTypeIdentifierCriterion(['article', 'blog_post']), $this->parser->parse( ['ContentTypeIdentifierCriterion' => ['article', 'blog_post']], - $this->createStub(ParsingDispatcher::class) + self::createStub(ParsingDispatcher::class) ) ); } @@ -48,7 +48,7 @@ public function testInvalidInput(string $exceptionMessage, array $input): void $this->parser->parse( $input, - $this->createStub(ParsingDispatcher::class) + self::createStub(ParsingDispatcher::class) ); } diff --git a/tests/lib/Server/Input/Parser/ContentType/Criterion/IsSystemTest.php b/tests/lib/Server/Input/Parser/ContentType/Criterion/IsSystemTest.php index 0022b159f..98da8d61d 100644 --- a/tests/lib/Server/Input/Parser/ContentType/Criterion/IsSystemTest.php +++ b/tests/lib/Server/Input/Parser/ContentType/Criterion/IsSystemTest.php @@ -30,7 +30,7 @@ public function testValidInput(): void new IsSystemCriterion(true), $this->parser->parse( ['IsSystemCriterion' => true], - $this->createStub(ParsingDispatcher::class) + self::createStub(ParsingDispatcher::class) ) ); } @@ -48,7 +48,7 @@ public function testInvalidInput(string $exceptionMessage, array $input): void $this->parser->parse( $input, - $this->createStub(ParsingDispatcher::class) + self::createStub(ParsingDispatcher::class) ); } diff --git a/tests/lib/Server/Input/Parser/ContentType/SortClause/SortClauseProcessorTest.php b/tests/lib/Server/Input/Parser/ContentType/SortClause/SortClauseProcessorTest.php index 3a69ab259..463d447f3 100644 --- a/tests/lib/Server/Input/Parser/ContentType/SortClause/SortClauseProcessorTest.php +++ b/tests/lib/Server/Input/Parser/ContentType/SortClause/SortClauseProcessorTest.php @@ -83,7 +83,7 @@ public static function provideForTestProcessSortClauses(): iterable private function getParsingDispatcher(): ParsingDispatcher { return new ParsingDispatcher( - $this->createStub(EventDispatcherInterface::class), + self::createStub(EventDispatcherInterface::class), [ 'application/vnd.ibexa.api.internal.sortclause.Id' => new DataKeyValueObjectClass( 'Id', diff --git a/tests/lib/Server/Input/Parser/Criterion/LogicalAndTest.php b/tests/lib/Server/Input/Parser/Criterion/LogicalAndTest.php index 8927fb2d3..2621b2e01 100644 --- a/tests/lib/Server/Input/Parser/Criterion/LogicalAndTest.php +++ b/tests/lib/Server/Input/Parser/Criterion/LogicalAndTest.php @@ -55,13 +55,13 @@ public function testParseLogicalAnd(): void ], ]; - $criterionMock = $this->createStub(Content\Query\Criterion::class); + $criterionMock = self::createStub(Content\Query\Criterion::class); $parserMock = $this->createMock(\Ibexa\Contracts\Rest\Input\Parser::class); $parserMock->method('parse')->willReturn($criterionMock); $result = $this->internalGetParser()->parse($logicalAndParsedFromXml, new ParsingDispatcher( - $this->createStub(EventDispatcherInterface::class), + self::createStub(EventDispatcherInterface::class), [ 'application/vnd.ibexa.api.internal.criterion.ContentTypeIdentifier' => $parserMock, 'application/vnd.ibexa.api.internal.criterion.Field' => $parserMock, @@ -75,7 +75,7 @@ public function testThrowsExceptionOnInvalidAndStatement(): void { $this->expectException(ParserException::class); $this->internalGetParser()->parse(['AND' => 'Should be an array'], new ParsingDispatcher( - $this->createStub(EventDispatcherInterface::class) + self::createStub(EventDispatcherInterface::class) )); } diff --git a/tests/lib/Server/Input/Parser/Criterion/LogicalOrTest.php b/tests/lib/Server/Input/Parser/Criterion/LogicalOrTest.php index 139a53c5f..bbdb7bf48 100644 --- a/tests/lib/Server/Input/Parser/Criterion/LogicalOrTest.php +++ b/tests/lib/Server/Input/Parser/Criterion/LogicalOrTest.php @@ -67,13 +67,13 @@ public function testParseLogicalOr(): void ], ]; - $criterionMock = $this->createStub(Content\Query\Criterion::class); + $criterionMock = self::createStub(Content\Query\Criterion::class); $parserMock = $this->createMock(\Ibexa\Contracts\Rest\Input\Parser::class); $parserMock->method('parse')->willReturn($criterionMock); $result = $this->internalGetParser()->parse($logicalOrParsedFromXml, new ParsingDispatcher( - $this->createStub(EventDispatcherInterface::class), + self::createStub(EventDispatcherInterface::class), [ 'application/vnd.ibexa.api.internal.criterion.ContentTypeIdentifier' => $parserMock, 'application/vnd.ibexa.api.internal.criterion.Field' => $parserMock, @@ -87,7 +87,7 @@ public function testThrowsExceptionOnInvalidAndStatement(): void { $this->expectException(ParserException::class); $this->internalGetParser()->parse(['OR' => 'Wrong type'], new ParsingDispatcher( - $this->createStub(EventDispatcherInterface::class) + self::createStub(EventDispatcherInterface::class) )); } diff --git a/tests/lib/Server/Input/Parser/UserCreateTest.php b/tests/lib/Server/Input/Parser/UserCreateTest.php index 467291504..39888379a 100644 --- a/tests/lib/Server/Input/Parser/UserCreateTest.php +++ b/tests/lib/Server/Input/Parser/UserCreateTest.php @@ -407,9 +407,9 @@ private function getFieldTypeParserMock(): FieldTypeParser & MockObject ->disableOriginalConstructor() ->setConstructorArgs( [ - $this->createStub(ContentService::class), + self::createStub(ContentService::class), $this->getContentTypeServiceMock(), - $this->createStub(FieldTypeService::class), + self::createStub(FieldTypeService::class), ] ) ->getMock(); diff --git a/tests/lib/Server/Input/Parser/UserGroupCreateTest.php b/tests/lib/Server/Input/Parser/UserGroupCreateTest.php index 11cc9e516..9954238c4 100644 --- a/tests/lib/Server/Input/Parser/UserGroupCreateTest.php +++ b/tests/lib/Server/Input/Parser/UserGroupCreateTest.php @@ -284,9 +284,9 @@ private function getFieldTypeParserMock(): FieldTypeParser & MockObject ->disableOriginalConstructor() ->setConstructorArgs( [ - $this->createStub(ContentService::class), + self::createStub(ContentService::class), $this->getContentTypeServiceMock(), - $this->createStub(FieldTypeService::class), + self::createStub(FieldTypeService::class), ] ) ->getMock(); diff --git a/tests/lib/Server/Input/Parser/UserGroupUpdateTest.php b/tests/lib/Server/Input/Parser/UserGroupUpdateTest.php index f4664f48c..b027fa6c3 100644 --- a/tests/lib/Server/Input/Parser/UserGroupUpdateTest.php +++ b/tests/lib/Server/Input/Parser/UserGroupUpdateTest.php @@ -198,8 +198,8 @@ private function getFieldTypeParserMock(): FieldTypeParser & MockObject ->setConstructorArgs( [ $this->getContentServiceMock(), - $this->createStub(ContentTypeService::class), - $this->createStub(FieldTypeService::class), + self::createStub(ContentTypeService::class), + self::createStub(FieldTypeService::class), ] ) ->getMock(); diff --git a/tests/lib/Server/Input/Parser/UserUpdateTest.php b/tests/lib/Server/Input/Parser/UserUpdateTest.php index 55ea4ac42..902bf626a 100644 --- a/tests/lib/Server/Input/Parser/UserUpdateTest.php +++ b/tests/lib/Server/Input/Parser/UserUpdateTest.php @@ -227,8 +227,8 @@ private function getFieldTypeParserMock(): FieldTypeParser & MockObject ->setConstructorArgs( [ $this->getContentServiceMock(), - $this->createStub(ContentTypeService::class), - $this->createStub(FieldTypeService::class), + self::createStub(ContentTypeService::class), + self::createStub(FieldTypeService::class), ] ) ->getMock(); diff --git a/tests/lib/Server/Input/Parser/VersionUpdateTest.php b/tests/lib/Server/Input/Parser/VersionUpdateTest.php index 7d283b6f7..187b40474 100644 --- a/tests/lib/Server/Input/Parser/VersionUpdateTest.php +++ b/tests/lib/Server/Input/Parser/VersionUpdateTest.php @@ -126,8 +126,8 @@ private function getFieldTypeParserMock(): FieldTypeParser & MockObject ->setConstructorArgs( [ $this->getContentServiceMock(), - $this->createStub(ContentTypeService::class), - $this->createStub(FieldTypeService::class), + self::createStub(ContentTypeService::class), + self::createStub(FieldTypeService::class), ] ) ->getMock(); diff --git a/tests/lib/Server/Output/ValueObjectVisitor/BookmarkListTest.php b/tests/lib/Server/Output/ValueObjectVisitor/BookmarkListTest.php index d994b1c6a..52567e46c 100644 --- a/tests/lib/Server/Output/ValueObjectVisitor/BookmarkListTest.php +++ b/tests/lib/Server/Output/ValueObjectVisitor/BookmarkListTest.php @@ -25,9 +25,9 @@ class BookmarkListTest extends ValueObjectVisitorBaseTestCase protected function setUp(): void { $this->data = new BookmarkList(10, [ - new RestLocation($this->createStub(Location::class), 0), - new RestLocation($this->createStub(Location::class), 0), - new RestLocation($this->createStub(Location::class), 0), + new RestLocation(self::createStub(Location::class), 0), + new RestLocation(self::createStub(Location::class), 0), + new RestLocation(self::createStub(Location::class), 0), ]); } @@ -54,7 +54,7 @@ public function testVisit(): string #[Depends('testVisit')] public function testResultContainsBookmarkListElement(string $result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'BookmarkList', 'attributes' => [ @@ -69,7 +69,7 @@ public function testResultContainsBookmarkListElement(string $result): void #[Depends('testVisit')] public function testResultContainsCountElement(string $result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'count', 'content' => $this->data->totalCount, diff --git a/tests/lib/Server/Output/ValueObjectVisitor/ContentListTest.php b/tests/lib/Server/Output/ValueObjectVisitor/ContentListTest.php index 8fa0053ec..ff2a383fe 100644 --- a/tests/lib/Server/Output/ValueObjectVisitor/ContentListTest.php +++ b/tests/lib/Server/Output/ValueObjectVisitor/ContentListTest.php @@ -47,20 +47,19 @@ public function testVisit(): string #[Depends('testVisit')] public function testResultContainsContentListElement(string $result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'ContentList', ], $result, - 'Invalid element.', - false + 'Invalid element.' ); } #[Depends('testVisit')] public function testResultContainsContentListAttributes(string $result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'ContentList', 'attributes' => [ @@ -69,8 +68,7 @@ public function testResultContainsContentListAttributes(string $result): void ], ], $result, - 'Invalid attributes.', - false + 'Invalid attributes.' ); } @@ -105,7 +103,7 @@ public function testContentListVisitsChildren(): string #[Depends('testContentListVisitsChildren')] public function testResultContainsTotalCountAttributes(string $result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'ContentList', 'attributes' => [ @@ -113,8 +111,7 @@ public function testResultContainsTotalCountAttributes(string $result): void ], ], $result, - 'Invalid totalCount attribute.', - false + 'Invalid totalCount attribute.' ); } diff --git a/tests/lib/Server/Output/ValueObjectVisitor/ContentObjectStatesTest.php b/tests/lib/Server/Output/ValueObjectVisitor/ContentObjectStatesTest.php index 40ee10043..7f858a49c 100644 --- a/tests/lib/Server/Output/ValueObjectVisitor/ContentObjectStatesTest.php +++ b/tests/lib/Server/Output/ValueObjectVisitor/ContentObjectStatesTest.php @@ -40,20 +40,19 @@ public function testVisit(): string #[Depends('testVisit')] public function testResultContainsContentObjectStatesElement(string $result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'ContentObjectStates', ], $result, - 'Invalid element.', - false + 'Invalid element.' ); } #[Depends('testVisit')] public function testResultContainsContentObjectStatesAttributes(string $result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'ContentObjectStates', 'attributes' => [ @@ -61,8 +60,7 @@ public function testResultContainsContentObjectStatesAttributes(string $result): ], ], $result, - 'Invalid attributes.', - false + 'Invalid attributes.' ); } diff --git a/tests/lib/Server/Output/ValueObjectVisitor/ContentTypeGroupListTest.php b/tests/lib/Server/Output/ValueObjectVisitor/ContentTypeGroupListTest.php index 5291147d2..e9d5de90c 100644 --- a/tests/lib/Server/Output/ValueObjectVisitor/ContentTypeGroupListTest.php +++ b/tests/lib/Server/Output/ValueObjectVisitor/ContentTypeGroupListTest.php @@ -43,20 +43,19 @@ public function testVisit(): string #[Depends('testVisit')] public function testResultContainsContentTypeGroupListElement(string $result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'ContentTypeGroupList', ], $result, - 'Invalid element.', - false + 'Invalid element.' ); } #[Depends('testVisit')] public function testResultContainsContentTypeGroupListAttributes(string $result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'ContentTypeGroupList', 'attributes' => [ @@ -65,8 +64,7 @@ public function testResultContainsContentTypeGroupListAttributes(string $result) ], ], $result, - 'Invalid attributes.', - false + 'Invalid attributes.' ); } diff --git a/tests/lib/Server/Output/ValueObjectVisitor/ContentTypeGroupTest.php b/tests/lib/Server/Output/ValueObjectVisitor/ContentTypeGroupTest.php index 8bbfb1c2b..59d698b58 100644 --- a/tests/lib/Server/Output/ValueObjectVisitor/ContentTypeGroupTest.php +++ b/tests/lib/Server/Output/ValueObjectVisitor/ContentTypeGroupTest.php @@ -85,7 +85,7 @@ public function testVisit(): string #[Depends('testVisit')] public function testResultContainsContentTypeGroupElement(string $result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'ContentTypeGroup', 'children' => [ @@ -93,15 +93,14 @@ public function testResultContainsContentTypeGroupElement(string $result): void ], ], $result, - 'Invalid element.', - false + 'Invalid element.' ); } #[Depends('testVisit')] public function testResultContainsContentTypeGroupAttributes(string $result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'ContentTypeGroup', 'attributes' => [ @@ -110,84 +109,78 @@ public function testResultContainsContentTypeGroupAttributes(string $result): vo ], ], $result, - 'Invalid attributes.', - false + 'Invalid attributes.' ); } #[Depends('testVisit')] public function testResultContainsIdValueElement(string $result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'id', 'content' => '42', ], $result, - 'Invalid or non-existing id value element.', - false + 'Invalid or non-existing id value element.' ); } #[Depends('testVisit')] public function testResultContainsIdentifierValueElement(string $result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'identifier', 'content' => 'some-group', ], $result, - 'Invalid or non-existing identifier value element.', - false + 'Invalid or non-existing identifier value element.' ); } #[Depends('testVisit')] public function testResultContainsCreatedValueElement(string $result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'created', 'content' => '2012-12-31T19:30:00+01:00', ], $result, - 'Invalid or non-existing created value element.', - false + 'Invalid or non-existing created value element.' ); } #[Depends('testVisit')] public function testResultContainsModifiedValueElement(string $result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'modified', 'content' => '2012-12-31T19:35:00+01:00', ], $result, - 'Invalid or non-existing modified value element.', - false + 'Invalid or non-existing modified value element.' ); } #[Depends('testVisit')] public function testResultContainsCreatorElement(string $result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'Creator', ], $result, - 'Invalid element.', - false + 'Invalid element.' ); } #[Depends('testVisit')] public function testResultContainsCreatorAttributes(string $result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'Creator', 'attributes' => [ @@ -196,28 +189,26 @@ public function testResultContainsCreatorAttributes(string $result): void ], ], $result, - 'Invalid element attributes.', - false + 'Invalid element attributes.' ); } #[Depends('testVisit')] public function testResultContainsModifierElement(string $result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'Modifier', ], $result, - 'Invalid element.', - false + 'Invalid element.' ); } #[Depends('testVisit')] public function testResultContainsModifierAttributes(string $result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'Modifier', 'attributes' => [ @@ -226,28 +217,26 @@ public function testResultContainsModifierAttributes(string $result): void ], ], $result, - 'Invalid element attributes.', - false + 'Invalid element attributes.' ); } #[Depends('testVisit')] public function testResultContainsContentTypesElement(string $result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'ContentTypes', ], $result, - 'Invalid element.', - false + 'Invalid element.' ); } #[Depends('testVisit')] public function testResultContainsContentTypesAttributes(string $result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'ContentTypes', 'attributes' => [ @@ -256,8 +245,7 @@ public function testResultContainsContentTypesAttributes(string $result): void ], ], $result, - 'Invalid attributes.', - false + 'Invalid attributes.' ); } diff --git a/tests/lib/Server/Output/ValueObjectVisitor/ContentTypeInfoListTest.php b/tests/lib/Server/Output/ValueObjectVisitor/ContentTypeInfoListTest.php index 74f560f62..fe716f0d9 100644 --- a/tests/lib/Server/Output/ValueObjectVisitor/ContentTypeInfoListTest.php +++ b/tests/lib/Server/Output/ValueObjectVisitor/ContentTypeInfoListTest.php @@ -49,13 +49,12 @@ public function testVisit(): string #[Depends('testVisit')] public function testResultContainsContentTypeInfoListElement($result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'ContentTypeInfoList', ], $result, - 'Invalid element.', - false + 'Invalid element.' ); } @@ -67,7 +66,7 @@ public function testResultContainsContentTypeInfoListElement($result): void #[Depends('testVisit')] public function testResultContainsContentTypeInfoListAttributes($result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'ContentTypeInfoList', 'attributes' => [ @@ -76,8 +75,7 @@ public function testResultContainsContentTypeInfoListAttributes($result): void ], ], $result, - 'Invalid attributes.', - false + 'Invalid attributes.' ); } diff --git a/tests/lib/Server/Output/ValueObjectVisitor/ContentTypeListTest.php b/tests/lib/Server/Output/ValueObjectVisitor/ContentTypeListTest.php index 5bb3cdcce..04abda79c 100644 --- a/tests/lib/Server/Output/ValueObjectVisitor/ContentTypeListTest.php +++ b/tests/lib/Server/Output/ValueObjectVisitor/ContentTypeListTest.php @@ -49,13 +49,12 @@ public function testVisit(): string #[Depends('testVisit')] public function testResultContainsContentTypeListElement($result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'ContentTypeList', ], $result, - 'Invalid element.', - false + 'Invalid element.' ); } @@ -67,7 +66,7 @@ public function testResultContainsContentTypeListElement($result): void #[Depends('testVisit')] public function testResultContainsContentTypeListAttributes($result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'ContentTypeList', 'attributes' => [ @@ -76,8 +75,7 @@ public function testResultContainsContentTypeListAttributes($result): void ], ], $result, - 'Invalid attributes.', - false + 'Invalid attributes.' ); } diff --git a/tests/lib/Server/Output/ValueObjectVisitor/ExceptionTest.php b/tests/lib/Server/Output/ValueObjectVisitor/ExceptionTest.php index 37cbcd43f..84c02d8be 100644 --- a/tests/lib/Server/Output/ValueObjectVisitor/ExceptionTest.php +++ b/tests/lib/Server/Output/ValueObjectVisitor/ExceptionTest.php @@ -61,7 +61,7 @@ public function testVisitNonVerbose(): string #[Depends('testVisit')] public function testResultContainsErrorCode(string $result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'ErrorMessage', 'descendant' => [ @@ -77,7 +77,7 @@ public function testResultContainsErrorCode(string $result): void #[Depends('testVisit')] public function testResultContainsErrorMessage(string $result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'ErrorMessage', 'descendant' => [ @@ -93,7 +93,7 @@ public function testResultContainsErrorMessage(string $result): void #[Depends('testVisit')] public function testResultContainsErrorDescription(string $result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'ErrorMessage', 'descendant' => [ @@ -124,7 +124,7 @@ public function testNonVerboseErrorDescription(string $result): void #[Depends('testVisit')] public function testResultContainsExceptionAttributes(string $result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'ErrorMessage', 'attributes' => [ diff --git a/tests/lib/Server/Output/ValueObjectVisitor/LocationListTest.php b/tests/lib/Server/Output/ValueObjectVisitor/LocationListTest.php index f4c06fae0..8cefd63a2 100644 --- a/tests/lib/Server/Output/ValueObjectVisitor/LocationListTest.php +++ b/tests/lib/Server/Output/ValueObjectVisitor/LocationListTest.php @@ -43,13 +43,12 @@ public function testVisit(): string #[Depends('testVisit')] public function testResultContainsLocationListElement(string $result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'LocationList', ], $result, - 'Invalid element.', - false + 'Invalid element.' ); } @@ -61,7 +60,7 @@ public function testResultContainsLocationListElement(string $result): void #[Depends('testVisit')] public function testResultContainsLocationListAttributes($result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'LocationList', 'attributes' => [ @@ -70,8 +69,7 @@ public function testResultContainsLocationListAttributes($result): void ], ], $result, - 'Invalid attributes.', - false + 'Invalid attributes.' ); } diff --git a/tests/lib/Server/Output/ValueObjectVisitor/LocationTest.php b/tests/lib/Server/Output/ValueObjectVisitor/LocationTest.php index fb1e256c6..ad5a98469 100644 --- a/tests/lib/Server/Output/ValueObjectVisitor/LocationTest.php +++ b/tests/lib/Server/Output/ValueObjectVisitor/LocationTest.php @@ -93,7 +93,7 @@ public function testVisitLocationAttributesResolvesMainLocation( self::assertNotEmpty($result); - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'id', 'content' => $location->id, @@ -102,7 +102,7 @@ public function testVisitLocationAttributesResolvesMainLocation( 'Invalid element.', ); - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'priority', 'content' => 1, @@ -111,7 +111,7 @@ public function testVisitLocationAttributesResolvesMainLocation( 'Invalid element.', ); - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'hidden', 'content' => 'false', @@ -120,7 +120,7 @@ public function testVisitLocationAttributesResolvesMainLocation( 'Invalid element.', ); - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'invisible', 'content' => 'false', diff --git a/tests/lib/Server/Output/ValueObjectVisitor/ObjectStateGroupListTest.php b/tests/lib/Server/Output/ValueObjectVisitor/ObjectStateGroupListTest.php index 8e65de96f..f3b702e13 100644 --- a/tests/lib/Server/Output/ValueObjectVisitor/ObjectStateGroupListTest.php +++ b/tests/lib/Server/Output/ValueObjectVisitor/ObjectStateGroupListTest.php @@ -42,20 +42,19 @@ public function testVisit(): string #[Depends('testVisit')] public function testResultContainsObjectStateGroupListElement(string $result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'ObjectStateGroupList', ], $result, - 'Invalid element.', - false + 'Invalid element.' ); } #[Depends('testVisit')] public function testResultContainsObjectStateGroupListAttributes(string $result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'ObjectStateGroupList', 'attributes' => [ @@ -64,8 +63,7 @@ public function testResultContainsObjectStateGroupListAttributes(string $result) ], ], $result, - 'Invalid attributes.', - false + 'Invalid attributes.' ); } diff --git a/tests/lib/Server/Output/ValueObjectVisitor/ObjectStateGroupTest.php b/tests/lib/Server/Output/ValueObjectVisitor/ObjectStateGroupTest.php index 5ee3f66e0..e5edaeec7 100644 --- a/tests/lib/Server/Output/ValueObjectVisitor/ObjectStateGroupTest.php +++ b/tests/lib/Server/Output/ValueObjectVisitor/ObjectStateGroupTest.php @@ -66,7 +66,7 @@ public function testVisit(): string #[Depends('testVisit')] public function testResultContainsObjectStateGroupElement(string $result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'ObjectStateGroup', 'children' => [ @@ -81,7 +81,7 @@ public function testResultContainsObjectStateGroupElement(string $result): void #[Depends('testVisit')] public function testResultContainsObjectStateGroupAttributes(string $result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'ObjectStateGroup', 'attributes' => [ @@ -97,7 +97,7 @@ public function testResultContainsObjectStateGroupAttributes(string $result): vo #[Depends('testVisit')] public function testResultContainsIdValueElement(string $result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'id', 'content' => '42', @@ -110,7 +110,7 @@ public function testResultContainsIdValueElement(string $result): void #[Depends('testVisit')] public function testResultContainsIdentifierValueElement(string $result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'identifier', 'content' => 'test-group', @@ -123,7 +123,7 @@ public function testResultContainsIdentifierValueElement(string $result): void #[Depends('testVisit')] public function testResultContainsDefaultLanguageCodeValueElement(string $result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'defaultLanguageCode', 'content' => 'eng-GB', @@ -136,7 +136,7 @@ public function testResultContainsDefaultLanguageCodeValueElement(string $result #[Depends('testVisit')] public function testResultContainsLanguageCodesValueElement(string $result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'languageCodes', 'content' => 'eng-GB,eng-US', @@ -149,7 +149,7 @@ public function testResultContainsLanguageCodesValueElement(string $result): voi #[Depends('testVisit')] public function testResultContainsNamesElement(string $result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'names', 'children' => [ @@ -164,7 +164,7 @@ public function testResultContainsNamesElement(string $result): void #[Depends('testVisit')] public function testResultContainsDescriptionsElement(string $result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'descriptions', 'children' => [ diff --git a/tests/lib/Server/Output/ValueObjectVisitor/ObjectStateListTest.php b/tests/lib/Server/Output/ValueObjectVisitor/ObjectStateListTest.php index f1656a56d..658172c8d 100644 --- a/tests/lib/Server/Output/ValueObjectVisitor/ObjectStateListTest.php +++ b/tests/lib/Server/Output/ValueObjectVisitor/ObjectStateListTest.php @@ -54,13 +54,12 @@ public function testVisit(): string #[Depends('testVisit')] public function testResultContainsObjectStateListElement(string $result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'ObjectStateList', ], $result, - 'Invalid element.', - false + 'Invalid element.' ); } @@ -70,7 +69,7 @@ public function testResultContainsObjectStateListElement(string $result): void #[Depends('testVisit')] public function testResultContainsObjectStateListAttributes(string $result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'ObjectStateList', 'attributes' => [ @@ -79,8 +78,7 @@ public function testResultContainsObjectStateListAttributes(string $result): voi ], ], $result, - 'Invalid attributes.', - false + 'Invalid attributes.' ); } diff --git a/tests/lib/Server/Output/ValueObjectVisitor/PolicyListTest.php b/tests/lib/Server/Output/ValueObjectVisitor/PolicyListTest.php index b0eec9291..9cda996ef 100644 --- a/tests/lib/Server/Output/ValueObjectVisitor/PolicyListTest.php +++ b/tests/lib/Server/Output/ValueObjectVisitor/PolicyListTest.php @@ -47,13 +47,12 @@ public function testVisit(): string #[Depends('testVisit')] public function testResultContainsPolicyListElement(string $result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'PolicyList', ], $result, - 'Invalid element.', - false + 'Invalid element.' ); } @@ -63,7 +62,7 @@ public function testResultContainsPolicyListElement(string $result): void #[Depends('testVisit')] public function testResultContainsPolicyListAttributes(string $result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'PolicyList', 'attributes' => [ @@ -72,8 +71,7 @@ public function testResultContainsPolicyListAttributes(string $result): void ], ], $result, - 'Invalid attributes.', - false + 'Invalid attributes.' ); } diff --git a/tests/lib/Server/Output/ValueObjectVisitor/PolicyTest.php b/tests/lib/Server/Output/ValueObjectVisitor/PolicyTest.php index e45c15749..88807a3ea 100644 --- a/tests/lib/Server/Output/ValueObjectVisitor/PolicyTest.php +++ b/tests/lib/Server/Output/ValueObjectVisitor/PolicyTest.php @@ -62,7 +62,7 @@ public function testVisit(): string #[Depends('testVisit')] public function testResultContainsPolicyElement(string $result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'Policy', 'children' => [ @@ -71,15 +71,14 @@ public function testResultContainsPolicyElement(string $result): void ], ], $result, - 'Invalid element.', - false + 'Invalid element.' ); } #[Depends('testVisit')] public function testResultContainsPolicyAttributes(string $result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'Policy', 'attributes' => [ @@ -88,76 +87,70 @@ public function testResultContainsPolicyAttributes(string $result): void ], ], $result, - 'Invalid attributes.', - false + 'Invalid attributes.' ); } #[Depends('testVisit')] public function testResultContainsIdValueElement(string $result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'id', 'content' => '42', ], $result, - 'Invalid or non-existing id value element.', - false + 'Invalid or non-existing id value element.' ); } #[Depends('testVisit')] public function testResultContainsModuleValueElement(string $result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'module', 'content' => 'content', ], $result, - 'Invalid or non-existing module value element.', - false + 'Invalid or non-existing module value element.' ); } #[Depends('testVisit')] public function testResultContainsFunctionValueElement(string $result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'function', 'content' => 'delete', ], $result, - 'Invalid or non-existing function value element.', - false + 'Invalid or non-existing function value element.' ); } #[Depends('testVisit')] public function testResultContainsLimitationsElement(string $result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'limitations', ], $result, - 'Invalid element.', - false + 'Invalid element.' ); } #[Depends('testVisit')] public function testResultContainsLimitationsAttributes(string $result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'limitations', ], $result, - 'Invalid attributes.', - false + 'Invalid attributes.' ); } diff --git a/tests/lib/Server/Output/ValueObjectVisitor/RelationListTest.php b/tests/lib/Server/Output/ValueObjectVisitor/RelationListTest.php index af79c654b..866f14025 100644 --- a/tests/lib/Server/Output/ValueObjectVisitor/RelationListTest.php +++ b/tests/lib/Server/Output/ValueObjectVisitor/RelationListTest.php @@ -50,20 +50,19 @@ public function testVisit(): string #[Depends('testVisit')] public function testResultContainsRelationsElement(string $result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'Relations', ], $result, - 'Invalid element.', - false + 'Invalid element.' ); } #[Depends('testVisit')] public function testResultContainsRelationsAttributes(string $result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'Relations', 'attributes' => [ @@ -72,8 +71,7 @@ public function testResultContainsRelationsAttributes(string $result): void ], ], $result, - 'Invalid attributes.', - false + 'Invalid attributes.' ); } diff --git a/tests/lib/Server/Output/ValueObjectVisitor/RestLocationRootNodeTest.php b/tests/lib/Server/Output/ValueObjectVisitor/RestLocationRootNodeTest.php index 22008ae83..003608053 100644 --- a/tests/lib/Server/Output/ValueObjectVisitor/RestLocationRootNodeTest.php +++ b/tests/lib/Server/Output/ValueObjectVisitor/RestLocationRootNodeTest.php @@ -103,14 +103,13 @@ public function testVisit(): string #[Depends('testVisit')] public function testResultContainsIdValueElement(string $result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'id', 'content' => '1', ], $result, - 'Invalid or non-existing id value element.', - false + 'Invalid or non-existing id value element.' ); } @@ -120,13 +119,12 @@ public function testResultContainsIdValueElement(string $result): void #[Depends('testVisit')] public function testResultContainsParentLocationElement(string $result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'ParentLocation', ], $result, - 'Invalid element.', - false + 'Invalid element.' ); } @@ -136,14 +134,13 @@ public function testResultContainsParentLocationElement(string $result): void #[Depends('testVisit')] public function testResultContainsParentLocationAttributes(string $result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'ParentLocation', 'attributes' => [], ], $result, - 'Invalid attributes.', - false + 'Invalid attributes.' ); } @@ -153,7 +150,7 @@ public function testResultContainsParentLocationAttributes(string $result): void #[Depends('testVisit')] public function testResultContainsLocationAttributes(string $result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'Location', 'attributes' => [ @@ -162,8 +159,7 @@ public function testResultContainsLocationAttributes(string $result): void ], ], $result, - 'Invalid attributes.', - false + 'Invalid attributes.' ); } @@ -173,7 +169,7 @@ public function testResultContainsLocationAttributes(string $result): void #[Depends('testVisit')] public function testResultContainsChildrenAttributes(string $result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'Children', 'attributes' => [ @@ -182,8 +178,7 @@ public function testResultContainsChildrenAttributes(string $result): void ], ], $result, - 'Invalid attributes.', - false + 'Invalid attributes.' ); } @@ -193,14 +188,13 @@ public function testResultContainsChildrenAttributes(string $result): void #[Depends('testVisit')] public function testResultContainsPathStringValueElement(string $result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'pathString', 'content' => '/1', ], $result, - 'Invalid or non-existing pathString value element.', - false + 'Invalid or non-existing pathString value element.' ); } @@ -210,7 +204,7 @@ public function testResultContainsPathStringValueElement(string $result): void #[Depends('testVisit')] public function testResultContainsUrlAliasesTagAttributes(string $result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'UrlAliases', 'attributes' => [ @@ -219,8 +213,7 @@ public function testResultContainsUrlAliasesTagAttributes(string $result): void ], ], $result, - 'Invalid attributes.', - false + 'Invalid attributes.' ); } diff --git a/tests/lib/Server/Output/ValueObjectVisitor/RestLocationTest.php b/tests/lib/Server/Output/ValueObjectVisitor/RestLocationTest.php index f004691bd..df5595e73 100644 --- a/tests/lib/Server/Output/ValueObjectVisitor/RestLocationTest.php +++ b/tests/lib/Server/Output/ValueObjectVisitor/RestLocationTest.php @@ -107,20 +107,19 @@ public function testVisit(): string #[Depends('testVisit')] public function testResultContainsLocationElement(string $result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'Location', ], $result, - 'Invalid element.', - false + 'Invalid element.' ); } #[Depends('testVisit')] public function testResultContainsLocationAttributes(string $result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'Location', 'attributes' => [ @@ -129,28 +128,26 @@ public function testResultContainsLocationAttributes(string $result): void ], ], $result, - 'Invalid attributes.', - false + 'Invalid attributes.' ); } #[Depends('testVisit')] public function testResultContainsContentInfoElement(string $result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'ContentInfo', ], $result, - 'Invalid element.', - false + 'Invalid element.' ); } #[Depends('testVisit')] public function testResultContainsContentInfoAttributes(string $result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'ContentInfo', 'attributes' => [ @@ -159,71 +156,66 @@ public function testResultContainsContentInfoAttributes(string $result): void ], ], $result, - 'Invalid attributes.', - false + 'Invalid attributes.' ); } #[Depends('testVisit')] public function testResultContainsIdValueElement(string $result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'id', 'content' => '42', ], $result, - 'Invalid or non-existing id value element.', - false + 'Invalid or non-existing id value element.' ); } #[Depends('testVisit')] public function testResultContainsPriorityValueElement(string $result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'priority', 'content' => '0', ], $result, - 'Invalid or non-existing priority value element.', - false + 'Invalid or non-existing priority value element.' ); } #[Depends('testVisit')] public function testResultContainsHiddenValueElement(string $result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'hidden', 'content' => 'false', ], $result, - 'Invalid or non-existing hidden value element.', - false + 'Invalid or non-existing hidden value element.' ); } #[Depends('testVisit')] public function testResultContainsInvisibleValueElement(string $result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'invisible', 'content' => 'true', ], $result, - 'Invalid or non-existing invisible value element.', - false + 'Invalid or non-existing invisible value element.' ); } #[Depends('testVisit')] public function testResultContainsExplicitlyHiddenValueElement(string $result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'explicitlyHidden', 'content' => 'true', @@ -236,34 +228,32 @@ public function testResultContainsExplicitlyHiddenValueElement(string $result): #[Depends('testVisit')] public function testResultContainsRemoteIdValueElement(string $result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'remoteId', 'content' => 'remote-id', ], $result, - 'Invalid or non-existing remoteId value element.', - false + 'Invalid or non-existing remoteId value element.' ); } #[Depends('testVisit')] public function testResultContainsChildrenElement(string $result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'Children', ], $result, - 'Invalid element.', - false + 'Invalid element.' ); } #[Depends('testVisit')] public function testResultContainsChildrenAttributes(string $result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'Children', 'attributes' => [ @@ -272,28 +262,26 @@ public function testResultContainsChildrenAttributes(string $result): void ], ], $result, - 'Invalid attributes.', - false + 'Invalid attributes.' ); } #[Depends('testVisit')] public function testResultContainsParentLocationElement(string $result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'ParentLocation', ], $result, - 'Invalid element.', - false + 'Invalid element.' ); } #[Depends('testVisit')] public function testResultContainsParentLocationAttributes(string $result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'ParentLocation', 'attributes' => [ @@ -302,28 +290,26 @@ public function testResultContainsParentLocationAttributes(string $result): void ], ], $result, - 'Invalid attributes.', - false + 'Invalid attributes.' ); } #[Depends('testVisit')] public function testResultContainsContentElement(string $result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'Content', ], $result, - 'Invalid element.', - false + 'Invalid element.' ); } #[Depends('testVisit')] public function testResultContainsContentAttributes(string $result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'Content', 'attributes' => [ @@ -332,98 +318,91 @@ public function testResultContainsContentAttributes(string $result): void ], ], $result, - 'Invalid attributes.', - false + 'Invalid attributes.' ); } #[Depends('testVisit')] public function testResultContainsPathStringValueElement(string $result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'pathString', 'content' => '/1/2/21/42/', ], $result, - 'Invalid or non-existing pathString value element.', - false + 'Invalid or non-existing pathString value element.' ); } #[Depends('testVisit')] public function testResultContainsDepthValueElement(string $result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'depth', 'content' => '3', ], $result, - 'Invalid or non-existing depth value element.', - false + 'Invalid or non-existing depth value element.' ); } #[Depends('testVisit')] public function testResultContainsSortFieldValueElement(string $result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'sortField', 'content' => 'PATH', ], $result, - 'Invalid or non-existing sortField value element.', - false + 'Invalid or non-existing sortField value element.' ); } #[Depends('testVisit')] public function testResultContainsSortOrderValueElement(string $result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'sortOrder', 'content' => 'ASC', ], $result, - 'Invalid or non-existing sortOrder value element.', - false + 'Invalid or non-existing sortOrder value element.' ); } #[Depends('testVisit')] public function testResultContainsChildCountValueElement(string $result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'childCount', 'content' => '0', ], $result, - 'Invalid or non-existing childCount value element.', - false + 'Invalid or non-existing childCount value element.' ); } #[Depends('testVisit')] public function testResultContainsUrlAliasesTag(string $result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'UrlAliases', ], $result, - 'Invalid element.', - false + 'Invalid element.' ); } #[Depends('testVisit')] public function testResultContainsUrlAliasesTagAttributes(string $result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'UrlAliases', 'attributes' => [ @@ -432,8 +411,7 @@ public function testResultContainsUrlAliasesTagAttributes(string $result): void ], ], $result, - 'Invalid attributes.', - false + 'Invalid attributes.' ); } diff --git a/tests/lib/Server/Output/ValueObjectVisitor/RestObjectStateTest.php b/tests/lib/Server/Output/ValueObjectVisitor/RestObjectStateTest.php index 1c2e742dd..826fe0016 100644 --- a/tests/lib/Server/Output/ValueObjectVisitor/RestObjectStateTest.php +++ b/tests/lib/Server/Output/ValueObjectVisitor/RestObjectStateTest.php @@ -70,7 +70,7 @@ public function testVisit(): string #[Depends('testVisit')] public function testResultContainsObjectStateElement(string $result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'ObjectState', 'children' => [ @@ -78,15 +78,14 @@ public function testResultContainsObjectStateElement(string $result): void ], ], $result, - 'Invalid element.', - false + 'Invalid element.' ); } #[Depends('testVisit')] public function testResultContainsObjectStateAttributes(string $result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'ObjectState', 'attributes' => [ @@ -95,28 +94,26 @@ public function testResultContainsObjectStateAttributes(string $result): void ], ], $result, - 'Invalid attributes.', - false + 'Invalid attributes.' ); } #[Depends('testVisit')] public function testResultContainsObjectStateGroupElement(string $result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'ObjectStateGroup', ], $result, - 'Invalid element.', - false + 'Invalid element.' ); } #[Depends('testVisit')] public function testResultContainsObjectStateGroupAttributes(string $result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'ObjectStateGroup', 'attributes' => [ @@ -125,85 +122,79 @@ public function testResultContainsObjectStateGroupAttributes(string $result): vo ], ], $result, - 'Invalid attributes.', - false + 'Invalid attributes.' ); } #[Depends('testVisit')] public function testResultContainsIdValueElement(string $result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'id', 'content' => '42', ], $result, - 'Invalid or non-existing id value element.', - false + 'Invalid or non-existing id value element.' ); } #[Depends('testVisit')] public function testResultContainsIdentifierValueElement(string $result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'identifier', 'content' => 'test-state', ], $result, - 'Invalid or non-existing identifier value element.', - false + 'Invalid or non-existing identifier value element.' ); } #[Depends('testVisit')] public function testResultContainsPriorityValueElement(string $result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'priority', 'content' => '0', ], $result, - 'Invalid or non-existing priority value element.', - false + 'Invalid or non-existing priority value element.' ); } #[Depends('testVisit')] public function testResultContainsDefaultLanguageCodeValueElement(string $result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'defaultLanguageCode', 'content' => 'eng-GB', ], $result, - 'Invalid or non-existing defaultLanguageCode value element.', - false + 'Invalid or non-existing defaultLanguageCode value element.' ); } #[Depends('testVisit')] public function testResultContainsLanguageCodesValueElement(string $result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'languageCodes', 'content' => 'eng-GB,eng-US', ], $result, - 'Invalid or non-existing languageCodes value element.', - false + 'Invalid or non-existing languageCodes value element.' ); } #[Depends('testVisit')] public function testResultContainsNamesElement(string $result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'names', 'children' => [ @@ -211,15 +202,14 @@ public function testResultContainsNamesElement(string $result): void ], ], $result, - 'Invalid element.', - false + 'Invalid element.' ); } #[Depends('testVisit')] public function testResultContainsDescriptionsElement(string $result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'descriptions', 'children' => [ @@ -227,8 +217,7 @@ public function testResultContainsDescriptionsElement(string $result): void ], ], $result, - 'Invalid element.', - false + 'Invalid element.' ); } diff --git a/tests/lib/Server/Output/ValueObjectVisitor/RestRelationTest.php b/tests/lib/Server/Output/ValueObjectVisitor/RestRelationTest.php index a7aa135e2..46b1ede28 100644 --- a/tests/lib/Server/Output/ValueObjectVisitor/RestRelationTest.php +++ b/tests/lib/Server/Output/ValueObjectVisitor/RestRelationTest.php @@ -87,7 +87,7 @@ public function testVisit(): string #[Depends('testVisit')] public function testResultContainsRelationElement(string $result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'Relation', 'children' => [ @@ -96,8 +96,7 @@ public function testResultContainsRelationElement(string $result): void ], ], $result, - 'Invalid element.', - false + 'Invalid element.' ); } @@ -107,7 +106,7 @@ public function testResultContainsRelationElement(string $result): void #[Depends('testVisit')] public function testResultContainsRelationAttributes(string $result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'Relation', 'attributes' => [ @@ -116,15 +115,14 @@ public function testResultContainsRelationAttributes(string $result): void ], ], $result, - 'Invalid attributes.', - false + 'Invalid attributes.' ); } #[Depends('testVisit')] public function testResultContainsSourceContentElement(string $result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'SourceContent', 'attributes' => [ @@ -133,15 +131,14 @@ public function testResultContainsSourceContentElement(string $result): void ], ], $result, - 'Invalid or non-existing SourceContent element.', - false + 'Invalid or non-existing SourceContent element.' ); } #[Depends('testVisit')] public function testResultContainsDestinationContentElement(string $result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'DestinationContent', 'attributes' => [ @@ -150,36 +147,33 @@ public function testResultContainsDestinationContentElement(string $result): voi ], ], $result, - 'Invalid or non-existing DestinationContent element.', - false + 'Invalid or non-existing DestinationContent element.' ); } #[Depends('testVisit')] public function testResultContainsSourceFieldDefinitionIdentifierElement(string $result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'SourceFieldDefinitionIdentifier', 'content' => 'relation_field', ], $result, - 'Invalid or non-existing SourceFieldDefinitionIdentifier value element.', - false + 'Invalid or non-existing SourceFieldDefinitionIdentifier value element.' ); } #[Depends('testVisit')] public function testResultContainsRelationTypeElement(string $result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'RelationType', 'content' => 'ATTRIBUTE', ], $result, - 'Invalid or non-existing RelationType value element.', - false + 'Invalid or non-existing RelationType value element.' ); } diff --git a/tests/lib/Server/Output/ValueObjectVisitor/RestTrashItemTest.php b/tests/lib/Server/Output/ValueObjectVisitor/RestTrashItemTest.php index 0fc8b98b6..bb879d08e 100644 --- a/tests/lib/Server/Output/ValueObjectVisitor/RestTrashItemTest.php +++ b/tests/lib/Server/Output/ValueObjectVisitor/RestTrashItemTest.php @@ -94,7 +94,7 @@ public function testVisit(): string #[Depends('testVisit')] public function testResultContainsTrashItemElement(string $result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'TrashItem', 'children' => [ @@ -102,15 +102,14 @@ public function testResultContainsTrashItemElement(string $result): void ], ], $result, - 'Invalid element.', - false + 'Invalid element.' ); } #[Depends('testVisit')] public function testResultContainsTrashItemAttributes(string $result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'TrashItem', 'attributes' => [ @@ -119,28 +118,26 @@ public function testResultContainsTrashItemAttributes(string $result): void ], ], $result, - 'Invalid attributes.', - false + 'Invalid attributes.' ); } #[Depends('testVisit')] public function testResultContainsContentInfoElement(string $result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'ContentInfo', ], $result, - 'Invalid element.', - false + 'Invalid element.' ); } #[Depends('testVisit')] public function testResultContainsContentInfoAttributes(string $result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'ContentInfo', 'attributes' => [ @@ -149,15 +146,14 @@ public function testResultContainsContentInfoAttributes(string $result): void ], ], $result, - 'Invalid attributes.', - false + 'Invalid attributes.' ); } #[Depends('testVisit')] public function testResultContainsIdValueElement(string $result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'id', 'content' => '42', @@ -170,7 +166,7 @@ public function testResultContainsIdValueElement(string $result): void #[Depends('testVisit')] public function testResultContainsPriorityValueElement(string $result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'priority', 'content' => '0', @@ -183,7 +179,7 @@ public function testResultContainsPriorityValueElement(string $result): void #[Depends('testVisit')] public function testResultContainsHiddenValueElement(string $result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'hidden', 'content' => 'false', @@ -196,7 +192,7 @@ public function testResultContainsHiddenValueElement(string $result): void #[Depends('testVisit')] public function testResultContainsInvisibleValueElement(string $result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'invisible', 'content' => 'true', @@ -209,7 +205,7 @@ public function testResultContainsInvisibleValueElement(string $result): void #[Depends('testVisit')] public function testResultContainsRemoteIdValueElement(string $result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'remoteId', 'content' => 'remote-id', @@ -222,7 +218,7 @@ public function testResultContainsRemoteIdValueElement(string $result): void #[Depends('testVisit')] public function testResultContainsParentLocationElement(string $result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'ParentLocation', ], @@ -234,7 +230,7 @@ public function testResultContainsParentLocationElement(string $result): void #[Depends('testVisit')] public function testResultContainsParentLocationAttributes(string $result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'ParentLocation', 'attributes' => [ @@ -250,7 +246,7 @@ public function testResultContainsParentLocationAttributes(string $result): void #[Depends('testVisit')] public function testResultContainsPathStringValueElement(string $result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'pathString', 'content' => '/1/2/21/42/', @@ -263,7 +259,7 @@ public function testResultContainsPathStringValueElement(string $result): void #[Depends('testVisit')] public function testResultContainsDepthValueElement(string $result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'depth', 'content' => '3', @@ -276,7 +272,7 @@ public function testResultContainsDepthValueElement(string $result): void #[Depends('testVisit')] public function testResultContainsChildCountValueElement(string $result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'childCount', 'content' => '0', @@ -289,7 +285,7 @@ public function testResultContainsChildCountValueElement(string $result): void #[Depends('testVisit')] public function testResultContainsContentElement(string $result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'Content', ], @@ -301,7 +297,7 @@ public function testResultContainsContentElement(string $result): void #[Depends('testVisit')] public function testResultContainsContentAttributes(string $result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'Content', 'attributes' => [ @@ -317,7 +313,7 @@ public function testResultContainsContentAttributes(string $result): void #[Depends('testVisit')] public function testResultContainsSortFieldValueElement(string $result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'sortField', 'content' => 'NAME', @@ -330,7 +326,7 @@ public function testResultContainsSortFieldValueElement(string $result): void #[Depends('testVisit')] public function testResultContainsSortOrderValueElement(string $result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'sortOrder', 'content' => 'DESC', diff --git a/tests/lib/Server/Output/ValueObjectVisitor/RestUserGroupRoleAssignmentTest.php b/tests/lib/Server/Output/ValueObjectVisitor/RestUserGroupRoleAssignmentTest.php index c7fb9782e..b16b73c1d 100644 --- a/tests/lib/Server/Output/ValueObjectVisitor/RestUserGroupRoleAssignmentTest.php +++ b/tests/lib/Server/Output/ValueObjectVisitor/RestUserGroupRoleAssignmentTest.php @@ -66,7 +66,7 @@ public function testVisit(): string #[Depends('testVisit')] public function testResultContainsRoleAssignmentElement(string $result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'RoleAssignment', 'children' => [ @@ -74,15 +74,14 @@ public function testResultContainsRoleAssignmentElement(string $result): void ], ], $result, - 'Invalid element.', - false + 'Invalid element.' ); } #[Depends('testVisit')] public function testResultContainsRoleAssignmentAttributes(string $result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'RoleAssignment', 'attributes' => [ @@ -91,28 +90,26 @@ public function testResultContainsRoleAssignmentAttributes(string $result): void ], ], $result, - 'Invalid attributes.', - false + 'Invalid attributes.' ); } #[Depends('testVisit')] public function testResultContainsRoleElement(string $result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'Role', ], $result, - 'Invalid element.', - false + 'Invalid element.' ); } #[Depends('testVisit')] public function testResultContainsRoleAttributes(string $result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'Role', 'attributes' => [ @@ -121,8 +118,7 @@ public function testResultContainsRoleAttributes(string $result): void ], ], $result, - 'Invalid attributes.', - false + 'Invalid attributes.' ); } diff --git a/tests/lib/Server/Output/ValueObjectVisitor/RestUserRoleAssignmentTest.php b/tests/lib/Server/Output/ValueObjectVisitor/RestUserRoleAssignmentTest.php index efcdf6366..9ea1aab8c 100644 --- a/tests/lib/Server/Output/ValueObjectVisitor/RestUserRoleAssignmentTest.php +++ b/tests/lib/Server/Output/ValueObjectVisitor/RestUserRoleAssignmentTest.php @@ -67,7 +67,7 @@ public function testVisit(): string #[Depends('testVisit')] public function testResultContainsRoleAssignmentElement(string $result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'RoleAssignment', 'children' => [ @@ -75,15 +75,14 @@ public function testResultContainsRoleAssignmentElement(string $result): void ], ], $result, - 'Invalid element.', - false + 'Invalid element.' ); } #[Depends('testVisit')] public function testResultContainsRoleAssignmentAttributes(string $result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'RoleAssignment', 'attributes' => [ @@ -92,28 +91,26 @@ public function testResultContainsRoleAssignmentAttributes(string $result): void ], ], $result, - 'Invalid attributes.', - false + 'Invalid attributes.' ); } #[Depends('testVisit')] public function testResultContainsRoleElement(string $result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'Role', ], $result, - 'Invalid element.', - false + 'Invalid element.' ); } #[Depends('testVisit')] public function testResultContainsRoleAttributes(string $result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'Role', 'attributes' => [ @@ -122,8 +119,7 @@ public function testResultContainsRoleAttributes(string $result): void ], ], $result, - 'Invalid attributes.', - false + 'Invalid attributes.' ); } diff --git a/tests/lib/Server/Output/ValueObjectVisitor/RoleAssignmentListTest.php b/tests/lib/Server/Output/ValueObjectVisitor/RoleAssignmentListTest.php index e90ff4211..57fcab71c 100644 --- a/tests/lib/Server/Output/ValueObjectVisitor/RoleAssignmentListTest.php +++ b/tests/lib/Server/Output/ValueObjectVisitor/RoleAssignmentListTest.php @@ -47,20 +47,19 @@ public function testVisitUserRoleAssignmentList(): string #[Depends('testVisitUserRoleAssignmentList')] public function testResultContainsRoleListElement(string $result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'RoleAssignmentList', ], $result, - 'Invalid element.', - false + 'Invalid element.' ); } #[Depends('testVisitUserRoleAssignmentList')] public function testResultContainsUserRoleAssignmentListAttributes(string $result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'RoleAssignmentList', 'attributes' => [ @@ -69,8 +68,7 @@ public function testResultContainsUserRoleAssignmentListAttributes(string $resul ], ], $result, - 'Invalid attributes.', - false + 'Invalid attributes.' ); } @@ -133,7 +131,7 @@ public function testVisitGroupRoleAssignmentList(): string #[Depends('testVisitGroupRoleAssignmentList')] public function testResultContainsGroupRoleAssignmentListAttributes(string $result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'RoleAssignmentList', 'attributes' => [ @@ -142,8 +140,7 @@ public function testResultContainsGroupRoleAssignmentListAttributes(string $resu ], ], $result, - 'Invalid attributes.', - false + 'Invalid attributes.' ); } diff --git a/tests/lib/Server/Output/ValueObjectVisitor/RoleListTest.php b/tests/lib/Server/Output/ValueObjectVisitor/RoleListTest.php index 118b5e890..5bd7e70d6 100644 --- a/tests/lib/Server/Output/ValueObjectVisitor/RoleListTest.php +++ b/tests/lib/Server/Output/ValueObjectVisitor/RoleListTest.php @@ -41,20 +41,19 @@ public function testVisit(): string #[Depends('testVisit')] public function testResultContainsRoleListElement(string $result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'RoleList', ], $result, - 'Invalid element.', - false + 'Invalid element.' ); } #[Depends('testVisit')] public function testResultContainsRoleListAttributes(string $result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'RoleList', 'attributes' => [ @@ -63,8 +62,7 @@ public function testResultContainsRoleListAttributes(string $result): void ], ], $result, - 'Invalid attributes.', - false + 'Invalid attributes.' ); } diff --git a/tests/lib/Server/Output/ValueObjectVisitor/RoleTest.php b/tests/lib/Server/Output/ValueObjectVisitor/RoleTest.php index 27b4c19eb..fc751b451 100644 --- a/tests/lib/Server/Output/ValueObjectVisitor/RoleTest.php +++ b/tests/lib/Server/Output/ValueObjectVisitor/RoleTest.php @@ -59,7 +59,7 @@ public function testVisit(): string #[Depends('testVisit')] public function testResultContainsRoleElement(string $result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'Role', 'children' => [ @@ -67,15 +67,14 @@ public function testResultContainsRoleElement(string $result): void ], ], $result, - 'Invalid element.', - false + 'Invalid element.' ); } #[Depends('testVisit')] public function testResultContainsRoleAttributes(string $result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'Role', 'attributes' => [ @@ -84,22 +83,20 @@ public function testResultContainsRoleAttributes(string $result): void ], ], $result, - 'Invalid attributes.', - false + 'Invalid attributes.' ); } #[Depends('testVisit')] public function testResultContainsIdentifierValueElement(string $result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'identifier', 'content' => 'some-role', ], $result, - 'Invalid or non-existing identifier value element.', - false + 'Invalid or non-existing identifier value element.' ); } @@ -107,14 +104,13 @@ public function testResultContainsIdentifierValueElement(string $result): void public function testResultContainsMainLanguageCodeValueElement(string $result): void { self::markTestSkipped('@todo uncomment when support for multilingual names and descriptions is added EZP-24776'); - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'mainLanguageCode', 'content' => 'eng-GB', ], $result, - 'Invalid or non-existing mainLanguageCode value element.', - false + 'Invalid or non-existing mainLanguageCode value element.' ); } @@ -122,7 +118,7 @@ public function testResultContainsMainLanguageCodeValueElement(string $result): public function testResultContainsNamesElement(string $result): void { self::markTestSkipped('@todo uncomment when support for multilingual names and descriptions is added EZP-24776'); - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'names', 'children' => [ @@ -130,8 +126,7 @@ public function testResultContainsNamesElement(string $result): void ], ], $result, - 'Invalid element.', - false + 'Invalid element.' ); } @@ -139,7 +134,7 @@ public function testResultContainsNamesElement(string $result): void public function testResultContainsDescriptionsElement(string $result): void { self::markTestSkipped('@todo uncomment when support for multilingual names and descriptions is added EZP-24776'); - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'descriptions', 'children' => [ @@ -147,28 +142,26 @@ public function testResultContainsDescriptionsElement(string $result): void ], ], $result, - 'Invalid element.', - false + 'Invalid element.' ); } #[Depends('testVisit')] public function testResultContainsPoliciesElement(string $result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'Policies', ], $result, - 'Invalid element.', - false + 'Invalid element.' ); } #[Depends('testVisit')] public function testResultContainsPoliciesAttributes(string $result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'Policies', 'attributes' => [ @@ -177,8 +170,7 @@ public function testResultContainsPoliciesAttributes(string $result): void ], ], $result, - 'Invalid attributes.', - false + 'Invalid attributes.' ); } diff --git a/tests/lib/Server/Output/ValueObjectVisitor/RootTest.php b/tests/lib/Server/Output/ValueObjectVisitor/RootTest.php index 5cca56724..dc678498c 100644 --- a/tests/lib/Server/Output/ValueObjectVisitor/RootTest.php +++ b/tests/lib/Server/Output/ValueObjectVisitor/RootTest.php @@ -78,18 +78,17 @@ public function testVisit(): string #[Depends('testVisit')] public function testResultContainsRootElement(string $result): void { - $this->assertXMLTag( + self::assertXMLTag( ['tag' => 'Root'], $result, - 'Invalid element.', - false + 'Invalid element.' ); } #[Depends('testVisit')] public function testResultContainsRootAttributes(string $result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'Root', 'attributes' => [ @@ -97,28 +96,26 @@ public function testResultContainsRootAttributes(string $result): void ], ], $result, - 'Invalid attributes.', - false + 'Invalid attributes.' ); } #[Depends('testVisit')] public function testResultContainsRouterTag(string $result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'Router', ], $result, - 'Invalid element.', - false + 'Invalid element.' ); } #[Depends('testVisit')] public function testResultContainsRouterWithAttributes($result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'RouterWithAttributes', 'attributes' => [ @@ -126,28 +123,26 @@ public function testResultContainsRouterWithAttributes($result): void ], ], $result, - 'Invalid element.', - false + 'Invalid element.' ); } #[Depends('testVisit')] public function testResultContainsTemplateRouterTag($result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'TemplateRouter', ], $result, - 'Invalid element.', - false + 'Invalid element.' ); } #[Depends('testVisit')] public function testResultContainsTemplateRouterWithAttributes($result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'TemplateRouterWithAttributes', 'attributes' => [ @@ -155,8 +150,7 @@ public function testResultContainsTemplateRouterWithAttributes($result): void ], ], $result, - 'Invalid element.', - false + 'Invalid element.' ); } diff --git a/tests/lib/Server/Output/ValueObjectVisitor/SectionListTest.php b/tests/lib/Server/Output/ValueObjectVisitor/SectionListTest.php index 7c983680d..c6cc6b942 100644 --- a/tests/lib/Server/Output/ValueObjectVisitor/SectionListTest.php +++ b/tests/lib/Server/Output/ValueObjectVisitor/SectionListTest.php @@ -40,20 +40,19 @@ public function testVisit(): string #[Depends('testVisit')] public function testResultContainsSectionListElement(string $result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'SectionList', ], $result, - 'Invalid element.', - false + 'Invalid element.' ); } #[Depends('testVisit')] public function testResultContainsSectionListAttributes(string $result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'SectionList', 'attributes' => [ @@ -62,8 +61,7 @@ public function testResultContainsSectionListAttributes(string $result): void ], ], $result, - 'Invalid attributes.', - false + 'Invalid attributes.' ); } diff --git a/tests/lib/Server/Output/ValueObjectVisitor/SectionTest.php b/tests/lib/Server/Output/ValueObjectVisitor/SectionTest.php index 90afbbaa0..3bc0360c8 100644 --- a/tests/lib/Server/Output/ValueObjectVisitor/SectionTest.php +++ b/tests/lib/Server/Output/ValueObjectVisitor/SectionTest.php @@ -51,7 +51,7 @@ public function testVisit(): string #[Depends('testVisit')] public function testResultContainsSectionElement(string $result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'Section', 'children' => [ @@ -60,15 +60,14 @@ public function testResultContainsSectionElement(string $result): void ], ], $result, - 'Invalid
element.', - false + 'Invalid
element.' ); } #[Depends('testVisit')] public function testResultContainsSectionAttributes(string $result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'Section', 'attributes' => [ @@ -77,50 +76,46 @@ public function testResultContainsSectionAttributes(string $result): void ], ], $result, - 'Invalid
attributes.', - false + 'Invalid
attributes.' ); } #[Depends('testVisit')] public function testResultContainsSectionIdValueElement(string $result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'sectionId', 'content' => '23', ], $result, - 'Invalid or non-existing
sectionId value element.', - false + 'Invalid or non-existing
sectionId value element.' ); } #[Depends('testVisit')] public function testResultContainsIdentifierValueElement(string $result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'identifier', 'content' => 'some-section', ], $result, - 'Invalid or non-existing
identifier value element.', - false + 'Invalid or non-existing
identifier value element.' ); } #[Depends('testVisit')] public function testResultContainsNameValueElement(string $result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'name', 'content' => 'Some Section', ], $result, - 'Invalid or non-existing
name value element.', - false + 'Invalid or non-existing
name value element.' ); } diff --git a/tests/lib/Server/Output/ValueObjectVisitor/TrashTest.php b/tests/lib/Server/Output/ValueObjectVisitor/TrashTest.php index 25cb87c4e..4e1bd4eae 100644 --- a/tests/lib/Server/Output/ValueObjectVisitor/TrashTest.php +++ b/tests/lib/Server/Output/ValueObjectVisitor/TrashTest.php @@ -47,13 +47,12 @@ public function testVisit(): string #[Depends('testVisit')] public function testResultContainsTrashElement(string $result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'Trash', ], $result, - 'Invalid element.', - false + 'Invalid element.' ); } @@ -63,7 +62,7 @@ public function testResultContainsTrashElement(string $result): void #[Depends('testVisit')] public function testResultContainsTrashAttributes(string $result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'Trash', 'attributes' => [ @@ -72,8 +71,7 @@ public function testResultContainsTrashAttributes(string $result): void ], ], $result, - 'Invalid attributes.', - false + 'Invalid attributes.' ); } diff --git a/tests/lib/Server/Output/ValueObjectVisitor/URLAliasListTest.php b/tests/lib/Server/Output/ValueObjectVisitor/URLAliasListTest.php index d8a07e375..99ef2d155 100644 --- a/tests/lib/Server/Output/ValueObjectVisitor/URLAliasListTest.php +++ b/tests/lib/Server/Output/ValueObjectVisitor/URLAliasListTest.php @@ -40,20 +40,19 @@ public function testVisit(): string #[Depends('testVisit')] public function testResultContainsUrlAliasListElement(string $result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'UrlAliasList', ], $result, - 'Invalid element.', - false + 'Invalid element.' ); } #[Depends('testVisit')] public function testResultContainsUrlAliasListAttributes(string $result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'UrlAliasList', 'attributes' => [ @@ -62,8 +61,7 @@ public function testResultContainsUrlAliasListAttributes(string $result): void ], ], $result, - 'Invalid attributes.', - false + 'Invalid attributes.' ); } diff --git a/tests/lib/Server/Output/ValueObjectVisitor/URLAliasTest.php b/tests/lib/Server/Output/ValueObjectVisitor/URLAliasTest.php index c12b7ea7b..a8a6aa938 100644 --- a/tests/lib/Server/Output/ValueObjectVisitor/URLAliasTest.php +++ b/tests/lib/Server/Output/ValueObjectVisitor/URLAliasTest.php @@ -57,7 +57,7 @@ public function testVisit(): string #[Depends('testVisit')] public function testResultContainsUrlAliasElement(string $result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'UrlAlias', 'children' => [ @@ -66,15 +66,14 @@ public function testResultContainsUrlAliasElement(string $result): void ], ], $result, - 'Invalid element.', - false + 'Invalid element.' ); } #[Depends('testVisit')] public function testResultContainsUrlAliasAttributes(string $result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'UrlAlias', 'attributes' => [ @@ -85,106 +84,98 @@ public function testResultContainsUrlAliasAttributes(string $result): void ], ], $result, - 'Invalid attributes.', - false + 'Invalid attributes.' ); } #[Depends('testVisit')] public function testResultContainsUrlValueElement(string $result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'resource', 'content' => '/destination/url', ], $result, - 'Invalid or non-existing url value element.', - false + 'Invalid or non-existing url value element.' ); } #[Depends('testVisit')] public function testResultContainsPathValueElement(string $result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'path', 'content' => '/some/path', ], $result, - 'Invalid or non-existing path value element.', - false + 'Invalid or non-existing path value element.' ); } #[Depends('testVisit')] public function testResultContainsLanguageCodesValueElement(string $result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'languageCodes', 'content' => 'eng-GB,eng-US', ], $result, - 'Invalid or non-existing languageCodes value element.', - false + 'Invalid or non-existing languageCodes value element.' ); } #[Depends('testVisit')] public function testResultContainsAlwaysAvailableValueElement(string $result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'alwaysAvailable', 'content' => 'true', ], $result, - 'Invalid or non-existing alwaysAvailable value element.', - false + 'Invalid or non-existing alwaysAvailable value element.' ); } #[Depends('testVisit')] public function testResultContainsIsHistoryValueElement(string $result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'isHistory', 'content' => 'true', ], $result, - 'Invalid or non-existing isHistory value element.', - false + 'Invalid or non-existing isHistory value element.' ); } #[Depends('testVisit')] public function testResultContainsForwardValueElement(string $result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'forward', 'content' => 'false', ], $result, - 'Invalid or non-existing forward value element.', - false + 'Invalid or non-existing forward value element.' ); } #[Depends('testVisit')] public function testResultContainsCustomValueElement(string $result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'custom', 'content' => 'false', ], $result, - 'Invalid or non-existing custom value element.', - false + 'Invalid or non-existing custom value element.' ); } diff --git a/tests/lib/Server/Output/ValueObjectVisitor/URLWildcardListTest.php b/tests/lib/Server/Output/ValueObjectVisitor/URLWildcardListTest.php index 4336d7744..c37dcfc06 100644 --- a/tests/lib/Server/Output/ValueObjectVisitor/URLWildcardListTest.php +++ b/tests/lib/Server/Output/ValueObjectVisitor/URLWildcardListTest.php @@ -46,20 +46,19 @@ public function testVisit(): string #[Depends('testVisit')] public function testResultContainsUrlWildcardListElement(string $result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'UrlWildcardList', ], $result, - 'Invalid element.', - false + 'Invalid element.' ); } #[Depends('testVisit')] public function testResultContainsUrlWildcardListAttributes(string $result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'UrlWildcardList', 'attributes' => [ @@ -68,8 +67,7 @@ public function testResultContainsUrlWildcardListAttributes(string $result): voi ], ], $result, - 'Invalid attributes.', - false + 'Invalid attributes.' ); } diff --git a/tests/lib/Server/Output/ValueObjectVisitor/URLWildcardTest.php b/tests/lib/Server/Output/ValueObjectVisitor/URLWildcardTest.php index 784130146..8e0133036 100644 --- a/tests/lib/Server/Output/ValueObjectVisitor/URLWildcardTest.php +++ b/tests/lib/Server/Output/ValueObjectVisitor/URLWildcardTest.php @@ -52,7 +52,7 @@ public function testVisit(): string #[Depends('testVisit')] public function testResultContainsUrlWildcardElement(string $result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'UrlWildcard', 'children' => [ @@ -61,15 +61,14 @@ public function testResultContainsUrlWildcardElement(string $result): void ], ], $result, - 'Invalid element.', - false + 'Invalid element.' ); } #[Depends('testVisit')] public function testResultContainsUrlWildcardAttributes(string $result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'UrlWildcard', 'attributes' => [ @@ -79,50 +78,46 @@ public function testResultContainsUrlWildcardAttributes(string $result): void ], ], $result, - 'Invalid attributes.', - false + 'Invalid attributes.' ); } #[Depends('testVisit')] public function testResultContainsSourceUrlValueElement(string $result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'sourceUrl', 'content' => '/source/url', ], $result, - 'Invalid or non-existing sourceUrl value element.', - false + 'Invalid or non-existing sourceUrl value element.' ); } #[Depends('testVisit')] public function testResultContainsDestinationUrlValueElement(string $result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'destinationUrl', 'content' => '/destination/url', ], $result, - 'Invalid or non-existing destinationUrl value element.', - false + 'Invalid or non-existing destinationUrl value element.' ); } #[Depends('testVisit')] public function testResultContainsForwardValueElement(string $result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'forward', 'content' => 'true', ], $result, - 'Invalid or non-existing forward value element.', - false + 'Invalid or non-existing forward value element.' ); } diff --git a/tests/lib/Server/Output/ValueObjectVisitor/UserGroupListTest.php b/tests/lib/Server/Output/ValueObjectVisitor/UserGroupListTest.php index ed169f920..aa4667508 100644 --- a/tests/lib/Server/Output/ValueObjectVisitor/UserGroupListTest.php +++ b/tests/lib/Server/Output/ValueObjectVisitor/UserGroupListTest.php @@ -44,20 +44,19 @@ public function testVisit(): string #[Depends('testVisit')] public function testResultContainsUserGroupListElement(string $result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'UserGroupList', ], $result, - 'Invalid element.', - false + 'Invalid element.' ); } #[Depends('testVisit')] public function testResultContainsUserGroupListAttributes(string $result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'UserGroupList', 'attributes' => [ @@ -66,8 +65,7 @@ public function testResultContainsUserGroupListAttributes(string $result): void ], ], $result, - 'Invalid attributes.', - false + 'Invalid attributes.' ); } diff --git a/tests/lib/Server/Output/ValueObjectVisitor/UserListTest.php b/tests/lib/Server/Output/ValueObjectVisitor/UserListTest.php index 9682d36a8..30b5b9802 100644 --- a/tests/lib/Server/Output/ValueObjectVisitor/UserListTest.php +++ b/tests/lib/Server/Output/ValueObjectVisitor/UserListTest.php @@ -44,20 +44,19 @@ public function testVisit(): string #[Depends('testVisit')] public function testResultContainsUserListElement(string $result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'UserList', ], $result, - 'Invalid element.', - false + 'Invalid element.' ); } #[Depends('testVisit')] public function testResultContainsUserListAttributes(string $result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'UserList', 'attributes' => [ @@ -66,8 +65,7 @@ public function testResultContainsUserListAttributes(string $result): void ], ], $result, - 'Invalid attributes.', - false + 'Invalid attributes.' ); } diff --git a/tests/lib/Server/Output/ValueObjectVisitor/UserSessionTest.php b/tests/lib/Server/Output/ValueObjectVisitor/UserSessionTest.php index 68b6f9475..7d039bc62 100644 --- a/tests/lib/Server/Output/ValueObjectVisitor/UserSessionTest.php +++ b/tests/lib/Server/Output/ValueObjectVisitor/UserSessionTest.php @@ -77,7 +77,7 @@ public function testVisit(): string #[Depends('testVisit')] public function testResultContainsSessionElement(string $result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'Session', 'children' => [ @@ -85,15 +85,14 @@ public function testResultContainsSessionElement(string $result): void ], ], $result, - 'Invalid element.', - false + 'Invalid element.' ); } #[Depends('testVisit')] public function testResultContainsSessionAttributes(string $result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'Session', 'attributes' => [ @@ -102,50 +101,46 @@ public function testResultContainsSessionAttributes(string $result): void ], ], $result, - 'Invalid attributes.', - false + 'Invalid attributes.' ); } #[Depends('testVisit')] public function testResultContainsNameValueElement(string $result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'name', 'content' => 'sessionName', ], $result, - 'Invalid or non-existing name value element.', - false + 'Invalid or non-existing name value element.' ); } #[Depends('testVisit')] public function testResultContainsIdentifierValueElement(string $result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'identifier', 'content' => 'sessionId', ], $result, - 'Invalid or non-existing identifier value element.', - false + 'Invalid or non-existing identifier value element.' ); } #[Depends('testVisit')] public function testResultContainsCsrfTokenValueElement(string $result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'csrfToken', 'content' => 'csrfToken', ], $result, - 'Invalid or non-existing csrf-token value element.', - false + 'Invalid or non-existing csrf-token value element.' ); } @@ -163,20 +158,19 @@ protected function getUserMock(): User & MockObject #[Depends('testVisit')] public function testResultContainsUserElement(string $result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'User', ], $result, - 'Invalid element.', - false + 'Invalid element.' ); } #[Depends('testVisit')] public function testResultContainsUserAttributes(string $result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'User', 'attributes' => [ @@ -185,8 +179,7 @@ public function testResultContainsUserAttributes(string $result): void ], ], $result, - 'Invalid element attributes.', - false + 'Invalid element attributes.' ); } diff --git a/tests/lib/Server/Output/ValueObjectVisitor/VersionInfoTest.php b/tests/lib/Server/Output/ValueObjectVisitor/VersionInfoTest.php index 09b881c38..74eeca6ed 100644 --- a/tests/lib/Server/Output/ValueObjectVisitor/VersionInfoTest.php +++ b/tests/lib/Server/Output/ValueObjectVisitor/VersionInfoTest.php @@ -78,7 +78,7 @@ public function testVisit(): string #[Depends('testVisit')] public function testResultContainsVersionInfoChildren(string $result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'VersionInfo', 'children' => [ @@ -87,113 +87,105 @@ public function testResultContainsVersionInfoChildren(string $result): void ], ], $result, - 'Invalid element.', - false + 'Invalid element.' ); } #[Depends('testVisit')] public function testVersionInfoIdElement(string $result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'id', 'content' => '23', ], $result, - 'Invalid value.', - false + 'Invalid value.' ); } #[Depends('testVisit')] public function testVersionInfoVersionNoElement(string $result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'versionNo', 'content' => '5', ], $result, - 'Invalid value.', - false + 'Invalid value.' ); } #[Depends('testVisit')] public function testVersionInfoStatusElement(string $result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'status', 'content' => 'PUBLISHED', ], $result, - 'Invalid value.', - false + 'Invalid value.' ); } #[Depends('testVisit')] public function testVersionInfoCreationDateElement(string $result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'creationDate', 'content' => $this->creationDate->format('c'), ], $result, - 'Invalid value.', - false + 'Invalid value.' ); } #[Depends('testVisit')] public function testVersionInfoModificationDateElement(string $result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'modificationDate', 'content' => $this->modificationDate->format('c'), ], $result, - 'Invalid value.', - false + 'Invalid value.' ); } #[Depends('testVisit')] public function testVersionInfoInitialLanguageCodeElement(string $result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'initialLanguageCode', 'content' => 'eng-US', ], $result, - 'Invalid value.', - false + 'Invalid value.' ); } #[Depends('testVisit')] public function testVersionInfoLanguageCodesElement(string $result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'languageCodes', 'content' => 'eng-US,ger-DE', ], $result, - 'Invalid value.', - false + 'Invalid value.' ); } #[Depends('testVisit')] public function testVersionInfoNamesElement(string $result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'names', 'children' => [ @@ -202,15 +194,14 @@ public function testVersionInfoNamesElement(string $result): void ], ], $result, - 'Invalid value.', - false + 'Invalid value.' ); } #[Depends('testVisit')] public function testVersionInfoContentElement(string $result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'Content', 'attributes' => [ @@ -219,8 +210,7 @@ public function testVersionInfoContentElement(string $result): void ], ], $result, - 'Invalid value.', - false + 'Invalid value.' ); } diff --git a/tests/lib/Server/Output/ValueObjectVisitor/VersionListTest.php b/tests/lib/Server/Output/ValueObjectVisitor/VersionListTest.php index 0b13299b1..ad5eba9f7 100644 --- a/tests/lib/Server/Output/ValueObjectVisitor/VersionListTest.php +++ b/tests/lib/Server/Output/ValueObjectVisitor/VersionListTest.php @@ -56,20 +56,19 @@ public function testVisit(): string #[Depends('testVisit')] public function testResultContainsVersionListElement(string $result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'VersionList', ], $result, - 'Invalid element.', - false + 'Invalid element.' ); } #[Depends('testVisit')] public function testResultContainsVersionListAttributes(string $result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'VersionList', 'attributes' => [ @@ -78,8 +77,7 @@ public function testResultContainsVersionListAttributes(string $result): void ], ], $result, - 'Invalid attributes.', - false + 'Invalid attributes.' ); } diff --git a/tests/lib/Server/Output/ValueObjectVisitor/VersionTest.php b/tests/lib/Server/Output/ValueObjectVisitor/VersionTest.php index 4fa9ca503..92c360f5c 100644 --- a/tests/lib/Server/Output/ValueObjectVisitor/VersionTest.php +++ b/tests/lib/Server/Output/ValueObjectVisitor/VersionTest.php @@ -23,7 +23,7 @@ class VersionTest extends ValueObjectVisitorBaseTestCase public function setUp(): void { - $this->fieldTypeSerializerMock = $this->createStub(FieldTypeSerializer::class); + $this->fieldTypeSerializerMock = self::createStub(FieldTypeSerializer::class); } public function testVisit(): string @@ -96,7 +96,7 @@ public function testVisit(): string #[Depends('testVisit')] public function testResultContainsVersionChildren(string $result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'Version', 'children' => [ @@ -105,15 +105,14 @@ public function testResultContainsVersionChildren(string $result): void ], ], $result, - 'Invalid element.', - false + 'Invalid element.' ); } #[Depends('testVisit')] public function testResultVersionAttributes(string $result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'Version', 'attributes' => [ @@ -122,15 +121,14 @@ public function testResultVersionAttributes(string $result): void ], ], $result, - 'Invalid attributes.', - false + 'Invalid attributes.' ); } #[Depends('testVisit')] public function testResultContainsFieldsChildren(string $result): void { - $this->assertXMLTag( + self::assertXMLTag( [ 'tag' => 'Fields', 'children' => [ @@ -139,8 +137,7 @@ public function testResultContainsFieldsChildren(string $result): void ], ], $result, - 'Invalid element.', - false + 'Invalid element.' ); } From c778716e1e80be04f8f01842a8544d6fe60d0a7e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Nowak?= Date: Tue, 22 Sep 2026 09:01:41 +0200 Subject: [PATCH 3/3] IBX-12654: Fixed issues reported by ibexa/phpstan rules --- .../Input/Parser/Criterion/ContentTypeIdentifier.php | 2 +- tests/lib/FieldTypeProcessor/ImageProcessorTest.php | 2 +- tests/lib/FieldTypeProcessor/RelationListProcessorTest.php | 4 +++- tests/lib/Output/ValueObjectVisitorBaseTestCase.php | 4 ++-- .../Input/Parser/ContentType/ContentTypeQueryTest.php | 3 ++- tests/lib/Server/Input/Parser/QueryParserTest.php | 4 ++-- .../Server/Output/ValueObjectVisitor/CachedValueTest.php | 7 ++++--- .../lib/Server/Output/ValueObjectVisitor/LocationTest.php | 3 ++- .../Output/ValueObjectVisitor/RestExecutedViewTest.php | 3 ++- 9 files changed, 19 insertions(+), 13 deletions(-) diff --git a/src/lib/Server/Input/Parser/Criterion/ContentTypeIdentifier.php b/src/lib/Server/Input/Parser/Criterion/ContentTypeIdentifier.php index cb47c38f5..13cc35dcd 100644 --- a/src/lib/Server/Input/Parser/Criterion/ContentTypeIdentifier.php +++ b/src/lib/Server/Input/Parser/Criterion/ContentTypeIdentifier.php @@ -42,7 +42,7 @@ public function parse(array $data, ParsingDispatcher $parsingDispatcher): Conten return new ContentTypeIdCriterion( array_map( - function ($contentTypeIdentifier) { + function ($contentTypeIdentifier): int { return $this->contentTypeService->loadContentTypeByIdentifier($contentTypeIdentifier)->id; }, $data['ContentTypeIdentifierCriterion'] diff --git a/tests/lib/FieldTypeProcessor/ImageProcessorTest.php b/tests/lib/FieldTypeProcessor/ImageProcessorTest.php index 60f174cf7..c767a7be4 100644 --- a/tests/lib/FieldTypeProcessor/ImageProcessorTest.php +++ b/tests/lib/FieldTypeProcessor/ImageProcessorTest.php @@ -37,7 +37,7 @@ public function testPostProcessValueHash(): void $routerMock ->expects($matcher) ->method('generate') - ->willReturnCallback(static function (string $route, array $parameters) use ($matcher, $variations, $inputHash, $expectedVariations) { + ->willReturnCallback(static function (string $route, array $parameters) use ($matcher, $variations, $inputHash, $expectedVariations): string { $variationIdentifier = $variations[$matcher->numberOfInvocations() - 1]; self::assertSame('ibexa.rest.binary_content.get_image_variation', $route); diff --git a/tests/lib/FieldTypeProcessor/RelationListProcessorTest.php b/tests/lib/FieldTypeProcessor/RelationListProcessorTest.php index d3d84dac2..dcd169918 100644 --- a/tests/lib/FieldTypeProcessor/RelationListProcessorTest.php +++ b/tests/lib/FieldTypeProcessor/RelationListProcessorTest.php @@ -115,7 +115,7 @@ public function testPostProcessValueHash(): void $routerMock ->expects($matcher) - ->method('generate')->willReturnCallback(static function (...$parameters) use ($matcher) { + ->method('generate')->willReturnCallback(static function (...$parameters) use ($matcher): string { if ($matcher->numberOfInvocations() === 1) { self::assertSame('ibexa.rest.load_content', $parameters[0]); self::assertSame(['contentId' => 42], $parameters[1]); @@ -128,6 +128,8 @@ public function testPostProcessValueHash(): void return '/api/ibexa/v2/content/objects/300'; } + + self::fail('Unexpected call to generate().'); }); $hash = $processor->postProcessValueHash(['destinationContentIds' => [42, 300]]); diff --git a/tests/lib/Output/ValueObjectVisitorBaseTestCase.php b/tests/lib/Output/ValueObjectVisitorBaseTestCase.php index 5cb51f01c..4be2befbf 100644 --- a/tests/lib/Output/ValueObjectVisitorBaseTestCase.php +++ b/tests/lib/Output/ValueObjectVisitorBaseTestCase.php @@ -157,7 +157,7 @@ protected function addRouteExpectation(string $routeName, array $arguments, stri $this->getRouterMock() ->expects(self::any()) ->method('generate') - ->willReturnCallback(function (string $routeName, array $arguments = []) { + ->willReturnCallback(function (string $routeName, array $arguments = []): string { static $index = 0; $callIndex = $index++; @@ -201,7 +201,7 @@ protected function addTemplatedRouteExpectation(string $routeName, array $argume $this->getTemplatedRouterMock() ->expects(self::any()) ->method('generate') - ->willReturnCallback(function (string $routeName, array $arguments = []) { + ->willReturnCallback(function (string $routeName, array $arguments = []): string { static $index = 0; $callIndex = $index++; diff --git a/tests/lib/Server/Input/Parser/ContentType/ContentTypeQueryTest.php b/tests/lib/Server/Input/Parser/ContentType/ContentTypeQueryTest.php index c65beb7b7..4a31e7ed3 100644 --- a/tests/lib/Server/Input/Parser/ContentType/ContentTypeQueryTest.php +++ b/tests/lib/Server/Input/Parser/ContentType/ContentTypeQueryTest.php @@ -15,6 +15,7 @@ use Ibexa\Contracts\Core\Repository\Values\ContentType\Query\Criterion\ContentTypeIdentifier; use Ibexa\Contracts\Core\Repository\Values\ContentType\Query\Criterion\IsSystem; use Ibexa\Contracts\Core\Repository\Values\ContentType\Query\Criterion\LogicalAnd; +use Ibexa\Contracts\Core\Repository\Values\ContentType\Query\CriterionInterface; use Ibexa\Contracts\Core\Repository\Values\ContentType\Query\SortClause; use Ibexa\Contracts\Core\Repository\Values\ContentType\Query\SortClause\Identifier; use Ibexa\Rest\Server\Input\Parser\ContentType\Criterion\CriterionProcessor; @@ -47,7 +48,7 @@ public function testParse(): void $parsingDispatcherMock ->expects($matcher) ->method('parse') - ->willReturnCallback(static function (...$parameters) use ($matcher) { + ->willReturnCallback(static function (...$parameters) use ($matcher): CriterionInterface|SortClause { return match ($matcher->numberOfInvocations()) { 1 => new ContentTypeId([1, 2]), 2 => new ContentTypeIdentifier('folder'), diff --git a/tests/lib/Server/Input/Parser/QueryParserTest.php b/tests/lib/Server/Input/Parser/QueryParserTest.php index b99ea654b..b21c7734d 100644 --- a/tests/lib/Server/Input/Parser/QueryParserTest.php +++ b/tests/lib/Server/Input/Parser/QueryParserTest.php @@ -66,7 +66,7 @@ public function testDispatchMoreThanOneFilter(): void $parsingDispatcher ->expects($matcher) ->method('parse') - ->willReturnCallback(static function (array $parameters) use ($matcher) { + ->willReturnCallback(static function (array $parameters) use ($matcher): Query\Criterion { $invocation = $matcher->numberOfInvocations(); if ($invocation === 1) { self::assertSame(['ContentTypeIdentifierCriterion' => 'article'], $parameters); @@ -131,7 +131,7 @@ public function testDispatchMoreThanOneQueryItem(): void $parsingDispatcher ->expects($matcher) ->method('parse') - ->willReturnCallback(static function (array $parameters) use ($matcher) { + ->willReturnCallback(static function (array $parameters) use ($matcher): Query\Criterion { $invocation = $matcher->numberOfInvocations(); if ($invocation === 1) { self::assertSame(['ContentTypeIdentifierCriterion' => 'article'], $parameters); diff --git a/tests/lib/Server/Output/ValueObjectVisitor/CachedValueTest.php b/tests/lib/Server/Output/ValueObjectVisitor/CachedValueTest.php index 444c62ce5..6b2a1c8dc 100644 --- a/tests/lib/Server/Output/ValueObjectVisitor/CachedValueTest.php +++ b/tests/lib/Server/Output/ValueObjectVisitor/CachedValueTest.php @@ -15,6 +15,7 @@ use stdClass; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\RequestStack; +use Symfony\Component\HttpFoundation\Response; class CachedValueTest extends ValueObjectVisitorBaseTestCase { @@ -46,7 +47,7 @@ public function testVisit(): void $setVaryMatcher = self::exactly(2); $responseMock->expects($setVaryMatcher) ->method('setVary') - ->willReturnCallback(static function (...$parameters) use ($setVaryMatcher, $responseMock) { + ->willReturnCallback(static function (...$parameters) use ($setVaryMatcher, $responseMock): Response { match ($setVaryMatcher->numberOfInvocations()) { 1 => self::assertSame(['Accept', true], $parameters), 2 => self::assertSame(['X-User-Hash', false], $parameters), @@ -70,7 +71,7 @@ public function testVisitLocationCache(): void $setVaryMatcher = self::exactly(2); $responseMock->expects($setVaryMatcher) ->method('setVary') - ->willReturnCallback(static function (...$parameters) use ($setVaryMatcher, $responseMock) { + ->willReturnCallback(static function (...$parameters) use ($setVaryMatcher, $responseMock): Response { match ($setVaryMatcher->numberOfInvocations()) { 1 => self::assertSame(['Accept', true], $parameters), 2 => self::assertSame(['X-User-Hash', false], $parameters), @@ -190,7 +191,7 @@ static function ($parameterName) use ($options): bool { ->expects(self::any()) ->method('getParameter') ->willReturnCallback( - static function ($parameterName, $defaultValue) use ($options) { + static function ($parameterName, $defaultValue) use ($options): mixed { return isset($options[$parameterName]) ? $options[$parameterName] : $defaultValue; } ); diff --git a/tests/lib/Server/Output/ValueObjectVisitor/LocationTest.php b/tests/lib/Server/Output/ValueObjectVisitor/LocationTest.php index ad5a98469..f190c5ee2 100644 --- a/tests/lib/Server/Output/ValueObjectVisitor/LocationTest.php +++ b/tests/lib/Server/Output/ValueObjectVisitor/LocationTest.php @@ -7,6 +7,7 @@ namespace Ibexa\Tests\Rest\Server\Output\ValueObjectVisitor; +use Generator; use Ibexa\Contracts\Core\Repository\ContentService; use Ibexa\Contracts\Core\Repository\LocationService; use Ibexa\Contracts\Core\Repository\Values\Content\ContentInfo; @@ -80,7 +81,7 @@ public function testVisitLocationAttributesResolvesMainLocation( ->method('getRelations') ->with($versionInfo) ->willReturnCallback( - static fn () => yield + static fn (): Generator => yield ); $visitor->visit( diff --git a/tests/lib/Server/Output/ValueObjectVisitor/RestExecutedViewTest.php b/tests/lib/Server/Output/ValueObjectVisitor/RestExecutedViewTest.php index ce2dabb85..8e4ea1018 100644 --- a/tests/lib/Server/Output/ValueObjectVisitor/RestExecutedViewTest.php +++ b/tests/lib/Server/Output/ValueObjectVisitor/RestExecutedViewTest.php @@ -8,6 +8,7 @@ namespace Ibexa\Tests\Rest\Server\Output\ValueObjectVisitor; use DOMDocument; +use Generator; use Ibexa\Contracts\Core\Repository\ContentService; use Ibexa\Contracts\Core\Repository\ContentTypeService; use Ibexa\Contracts\Core\Repository\LocationService; @@ -120,7 +121,7 @@ private function getRelationListFacadeMock(): ContentService\RelationListFacadeI { $relationListFacade = $this->createMock(ContentService\RelationListFacadeInterface::class); $relationListFacade->method('getRelations')->willReturnCallback( - static fn () => yield + static fn (): Generator => yield ); return $relationListFacade;