Skip to content

Commit

Permalink
removed CsrfTokenManagerTest as it brings not much value, regenerated…
Browse files Browse the repository at this point in the history
… PHPStan
  • Loading branch information
konradoboza committed May 28, 2024
1 parent ffd52bc commit 36ff001
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 113 deletions.
4 changes: 4 additions & 0 deletions dependencies.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"recipesEndpoint": "https://api.github.com/repos/ibexa/recipes-dev/contents/index.json?ref=flex/pull-121",
"packages": []
}
25 changes: 0 additions & 25 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -6315,11 +6315,6 @@ parameters:
count: 1
path: tests/integration/BasicKernelTest.php

-
message: "#^Method Ibexa\\\\Tests\\\\Integration\\\\Rest\\\\UriParser\\\\UriParserTest\\:\\:getDataForTestIsRestRequest\\(\\) return type has no value type specified in iterable type iterable\\.$#"
count: 1
path: tests/integration/UriParser/UriParserTest.php

-
message: "#^Method Ibexa\\\\Tests\\\\Rest\\\\FieldTypeProcessor\\\\AuthorProcessorTest\\:\\:fieldSettingsHashes\\(\\) has no return type specified\\.$#"
count: 1
Expand Down Expand Up @@ -10495,26 +10490,6 @@ parameters:
count: 1
path: tests/lib/Server/Output/ValueObjectVisitor/VersionTest.php

-
message: "#^Method Ibexa\\\\Tests\\\\Rest\\\\Server\\\\Security\\\\CsrfTokenManagerTest\\:\\:createCsrfTokenManager\\(\\) has no return type specified\\.$#"
count: 1
path: tests/lib/Server/Security/CsrfTokenManagerTest.php

-
message: "#^Method Ibexa\\\\Tests\\\\Rest\\\\Server\\\\Security\\\\CsrfTokenManagerTest\\:\\:createCsrfTokenManager\\(\\) has parameter \\$https with no type specified\\.$#"
count: 1
path: tests/lib/Server/Security/CsrfTokenManagerTest.php

-
message: "#^Method Ibexa\\\\Tests\\\\Rest\\\\Server\\\\Security\\\\CsrfTokenManagerTest\\:\\:testHasTokenForHttp\\(\\) has no return type specified\\.$#"
count: 1
path: tests/lib/Server/Security/CsrfTokenManagerTest.php

-
message: "#^Method Ibexa\\\\Tests\\\\Rest\\\\Server\\\\Security\\\\CsrfTokenManagerTest\\:\\:testHasTokenForHttps\\(\\) has no return type specified\\.$#"
count: 1
path: tests/lib/Server/Security/CsrfTokenManagerTest.php

-
message: "#^Method Ibexa\\\\Tests\\\\Rest\\\\UrlHandler\\\\PatternTest\\:\\:getParseValues\\(\\) return type has no value type specified in iterable type array\\.$#"
count: 1
Expand Down
21 changes: 12 additions & 9 deletions tests/integration/UriParser/UriParserTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@ public static function getDataForTestGetAttributeFromUri(): iterable
'2',
];

yield 'Get sessionId attribute from ibexa.rest.refresh_session POST route' => [
yield 'Get userId attribute from ibexa.rest.assign_user_to_user_group POST route' => [
'POST',
'/api/ibexa/v2/user/sessions/MySession/refresh',
'sessionId',
'MySession',
'/api/ibexa/v2/user/users/14/groups',
'userId',
'14',
];
}

Expand All @@ -66,19 +66,19 @@ public function testGetAttributeFromUri(
*/
public static function getDataForTestGetAttributeFromUriThrowsException(): iterable
{
$uri = '/api/ibexa/v2/user/sessions/MySession/refresh';
$uri = '/api/ibexa/v2/content/sections/1';
yield 'Invalid attribute' => [
'POST',
$uri,
'session',
'sectionId',
"No attribute 'session' in route matched from $uri",
];

yield 'Invalid method' => [
'GET',
'POST',
$uri,
'sessionId',
"Method 'GET' is not allowed for '$uri'. Allowed: [POST]",
'sectionId',
"Method 'DELETE' is not allowed for '$uri'. Allowed: [GET, PATCH, DELETE]",
];

yield 'Invalid route' => [
Expand Down Expand Up @@ -113,6 +113,9 @@ public function testGetAttributeFromUriThrowsException(
$this->uriParser->getAttributeFromUri($uri, $attributeName, $method);
}

/**
* @return iterable<string, array{\Symfony\Component\HttpFoundation\Request, bool}>
*/
public static function getDataForTestIsRestRequest(): iterable
{
yield ($uri = '/api/ibexa/v2/foo') => [
Expand Down
79 changes: 0 additions & 79 deletions tests/lib/Server/Security/CsrfTokenManagerTest.php

This file was deleted.

0 comments on commit 36ff001

Please sign in to comment.