Skip to content

Commit c599419

Browse files
committed
Refactored LanguageServiceTest and added stricter validation for LanguageCreateStruct
1 parent 10703c0 commit c599419

File tree

5 files changed

+37
-262
lines changed

5 files changed

+37
-262
lines changed

phpstan-baseline.neon

Lines changed: 2 additions & 236 deletions
Original file line numberDiff line numberDiff line change
@@ -3210,18 +3210,6 @@ parameters:
32103210
count: 1
32113211
path: src/bundle/Core/Imagine/Filter/AbstractFilter.php
32123212

3213-
-
3214-
message: '#^Parameter \#2 \$configuredVariations of method Ibexa\\Bundle\\Core\\Imagine\\Filter\\FilterConfiguration\:\:getVariationFilters\(\) expects array\<string, array\{filters\: array\<mixed\>\}\>, non\-empty\-array given\.$#'
3215-
identifier: argument.type
3216-
count: 1
3217-
path: src/bundle/Core/Imagine/Filter/FilterConfiguration.php
3218-
3219-
-
3220-
message: '#^Parameter \#2 \$configuredVariations of method Ibexa\\Bundle\\Core\\Imagine\\Filter\\FilterConfiguration\:\:getVariationPostProcessors\(\) expects array\<string, array\{post_processor\: array\<mixed\>\}\>, non\-empty\-array given\.$#'
3221-
identifier: argument.type
3222-
count: 1
3223-
path: src/bundle/Core/Imagine/Filter/FilterConfiguration.php
3224-
32253213
-
32263214
message: '#^Method Ibexa\\Bundle\\Core\\Imagine\\Filter\\FilterInterface\:\:getOptions\(\) return type has no value type specified in iterable type array\.$#'
32273215
identifier: missingType.iterableValue
@@ -23310,60 +23298,6 @@ parameters:
2331023298
count: 1
2331123299
path: tests/integration/Core/Repository/BaseTestCase.php
2331223300

23313-
-
23314-
message: '#^Method Ibexa\\Tests\\Integration\\Core\\Repository\\BaseTestCase\:\:assertPropertiesCorrect\(\) has no return type specified\.$#'
23315-
identifier: missingType.return
23316-
count: 1
23317-
path: tests/integration/Core/Repository/BaseTestCase.php
23318-
23319-
-
23320-
message: '#^Method Ibexa\\Tests\\Integration\\Core\\Repository\\BaseTestCase\:\:assertPropertiesCorrectUnsorted\(\) has no return type specified\.$#'
23321-
identifier: missingType.return
23322-
count: 1
23323-
path: tests/integration/Core/Repository/BaseTestCase.php
23324-
23325-
-
23326-
message: '#^Method Ibexa\\Tests\\Integration\\Core\\Repository\\BaseTestCase\:\:assertPropertiesEqual\(\) has no return type specified\.$#'
23327-
identifier: missingType.return
23328-
count: 1
23329-
path: tests/integration/Core/Repository/BaseTestCase.php
23330-
23331-
-
23332-
message: '#^Method Ibexa\\Tests\\Integration\\Core\\Repository\\BaseTestCase\:\:assertPropertiesEqual\(\) has parameter \$actualValue with no type specified\.$#'
23333-
identifier: missingType.parameter
23334-
count: 1
23335-
path: tests/integration/Core/Repository/BaseTestCase.php
23336-
23337-
-
23338-
message: '#^Method Ibexa\\Tests\\Integration\\Core\\Repository\\BaseTestCase\:\:assertPropertiesEqual\(\) has parameter \$expectedValue with no type specified\.$#'
23339-
identifier: missingType.parameter
23340-
count: 1
23341-
path: tests/integration/Core/Repository/BaseTestCase.php
23342-
23343-
-
23344-
message: '#^Method Ibexa\\Tests\\Integration\\Core\\Repository\\BaseTestCase\:\:assertPropertiesEqual\(\) has parameter \$propertyName with no type specified\.$#'
23345-
identifier: missingType.parameter
23346-
count: 1
23347-
path: tests/integration/Core/Repository/BaseTestCase.php
23348-
23349-
-
23350-
message: '#^Method Ibexa\\Tests\\Integration\\Core\\Repository\\BaseTestCase\:\:assertPropertiesEqual\(\) has parameter \$sortArray with no type specified\.$#'
23351-
identifier: missingType.parameter
23352-
count: 1
23353-
path: tests/integration/Core/Repository/BaseTestCase.php
23354-
23355-
-
23356-
message: '#^Method Ibexa\\Tests\\Integration\\Core\\Repository\\BaseTestCase\:\:assertStructPropertiesCorrect\(\) has no return type specified\.$#'
23357-
identifier: missingType.return
23358-
count: 1
23359-
path: tests/integration/Core/Repository/BaseTestCase.php
23360-
23361-
-
23362-
message: '#^Method Ibexa\\Tests\\Integration\\Core\\Repository\\BaseTestCase\:\:assertStructPropertiesCorrect\(\) has parameter \$additionalProperties with no value type specified in iterable type array\.$#'
23363-
identifier: missingType.iterableValue
23364-
count: 1
23365-
path: tests/integration/Core/Repository/BaseTestCase.php
23366-
2336723301
-
2336823302
message: '#^Method Ibexa\\Tests\\Integration\\Core\\Repository\\BaseTestCase\:\:createFolder\(\) has parameter \$names with no value type specified in iterable type array\.$#'
2336923303
identifier: missingType.iterableValue
@@ -23406,48 +23340,18 @@ parameters:
2340623340
count: 1
2340723341
path: tests/integration/Core/Repository/BaseTestCase.php
2340823342

23409-
-
23410-
message: '#^Method Ibexa\\Tests\\Integration\\Core\\Repository\\BaseTestCase\:\:sortItems\(\) has no return type specified\.$#'
23411-
identifier: missingType.return
23412-
count: 1
23413-
path: tests/integration/Core/Repository/BaseTestCase.php
23414-
23415-
-
23416-
message: '#^Method Ibexa\\Tests\\Integration\\Core\\Repository\\BaseTestCase\:\:sortItems\(\) has parameter \$items with no value type specified in iterable type array\.$#'
23417-
identifier: missingType.iterableValue
23418-
count: 1
23419-
path: tests/integration/Core/Repository/BaseTestCase.php
23420-
2342123343
-
2342223344
message: '#^Method Ibexa\\Tests\\Integration\\Core\\Repository\\BaseTestCase\:\:updateFolder\(\) has parameter \$names with no value type specified in iterable type array\.$#'
2342323345
identifier: missingType.iterableValue
2342423346
count: 1
2342523347
path: tests/integration/Core/Repository/BaseTestCase.php
2342623348

23427-
-
23428-
message: '#^PHPDoc tag @param references unknown parameter\: \$propertyNames$#'
23429-
identifier: parameter.notFound
23430-
count: 1
23431-
path: tests/integration/Core/Repository/BaseTestCase.php
23432-
2343323349
-
2343423350
message: '#^PHPDoc tag @var for variable \$searchHandler contains unknown class Ibexa\\Solr\\Handler\.$#'
2343523351
identifier: class.notFound
2343623352
count: 1
2343723353
path: tests/integration/Core/Repository/BaseTestCase.php
2343823354

23439-
-
23440-
message: '#^Parameter \#1 \$string1 of function strcmp expects string, bool\|float\|int\|string given\.$#'
23441-
identifier: argument.type
23442-
count: 1
23443-
path: tests/integration/Core/Repository/BaseTestCase.php
23444-
23445-
-
23446-
message: '#^Parameter \#2 \$string2 of function strcmp expects string, bool\|float\|int\|string given\.$#'
23447-
identifier: argument.type
23448-
count: 1
23449-
path: tests/integration/Core/Repository/BaseTestCase.php
23450-
2345123355
-
2345223356
message: '#^Property Ibexa\\Tests\\Integration\\Core\\Repository\\BaseTestCase\:\:\$repository \(Ibexa\\Contracts\\Core\\Repository\\Repository\) does not accept null\.$#'
2345323357
identifier: assign.propertyType
@@ -31681,146 +31585,8 @@ parameters:
3168131585
path: tests/integration/Core/Repository/LanguageServiceMaximumSupportedLanguagesTest.php
3168231586

3168331587
-
31684-
message: '#^Call to static method PHPUnit\\Framework\\Assert\:\:assertInstanceOf\(\) with ''Ibexa\\\\Contracts\\\\Core\\\\Repository\\\\Values\\\\Content\\\\Language'' and Ibexa\\Contracts\\Core\\Repository\\Values\\Content\\Language will always evaluate to true\.$#'
31685-
identifier: staticMethod.alreadyNarrowedType
31686-
count: 3
31687-
path: tests/integration/Core/Repository/LanguageServiceTest.php
31688-
31689-
-
31690-
message: '#^Call to static method PHPUnit\\Framework\\Assert\:\:assertInstanceOf\(\) with ''Ibexa\\\\Contracts\\\\Core\\\\Repository\\\\Values\\\\Content\\\\LanguageCreateStruct'' and Ibexa\\Contracts\\Core\\Repository\\Values\\Content\\LanguageCreateStruct will always evaluate to true\.$#'
31691-
identifier: staticMethod.alreadyNarrowedType
31692-
count: 1
31693-
path: tests/integration/Core/Repository/LanguageServiceTest.php
31694-
31695-
-
31696-
message: '#^Method Ibexa\\Tests\\Integration\\Core\\Repository\\LanguageServiceTest\:\:loadLanguagesReturnsAnEmptyArrayByDefault\(\) has no return type specified\.$#'
31697-
identifier: missingType.return
31698-
count: 1
31699-
path: tests/integration/Core/Repository/LanguageServiceTest.php
31700-
31701-
-
31702-
message: '#^Method Ibexa\\Tests\\Integration\\Core\\Repository\\LanguageServiceTest\:\:testCreateLanguageInTransactionWithCommit\(\) has no return type specified\.$#'
31703-
identifier: missingType.return
31704-
count: 1
31705-
path: tests/integration/Core/Repository/LanguageServiceTest.php
31706-
31707-
-
31708-
message: '#^Method Ibexa\\Tests\\Integration\\Core\\Repository\\LanguageServiceTest\:\:testCreateLanguageInTransactionWithRollback\(\) has no return type specified\.$#'
31709-
identifier: missingType.return
31710-
count: 1
31711-
path: tests/integration/Core/Repository/LanguageServiceTest.php
31712-
31713-
-
31714-
message: '#^Method Ibexa\\Tests\\Integration\\Core\\Repository\\LanguageServiceTest\:\:testCreateLanguageSetsExpectedProperties\(\) has no return type specified\.$#'
31715-
identifier: missingType.return
31716-
count: 1
31717-
path: tests/integration/Core/Repository/LanguageServiceTest.php
31718-
31719-
-
31720-
message: '#^Method Ibexa\\Tests\\Integration\\Core\\Repository\\LanguageServiceTest\:\:testCreateLanguageSetsIdPropertyOnReturnedLanguage\(\) has no return type specified\.$#'
31721-
identifier: missingType.return
31722-
count: 1
31723-
path: tests/integration/Core/Repository/LanguageServiceTest.php
31724-
31725-
-
31726-
message: '#^Method Ibexa\\Tests\\Integration\\Core\\Repository\\LanguageServiceTest\:\:testCreateLanguageThrowsInvalidArgumentException\(\) has no return type specified\.$#'
31727-
identifier: missingType.return
31728-
count: 1
31729-
path: tests/integration/Core/Repository/LanguageServiceTest.php
31730-
31731-
-
31732-
message: '#^Method Ibexa\\Tests\\Integration\\Core\\Repository\\LanguageServiceTest\:\:testDeleteLanguage\(\) has no return type specified\.$#'
31733-
identifier: missingType.return
31734-
count: 1
31735-
path: tests/integration/Core/Repository/LanguageServiceTest.php
31736-
31737-
-
31738-
message: '#^Method Ibexa\\Tests\\Integration\\Core\\Repository\\LanguageServiceTest\:\:testDeleteLanguageThrowsInvalidArgumentException\(\) has no return type specified\.$#'
31739-
identifier: missingType.return
31740-
count: 1
31741-
path: tests/integration/Core/Repository/LanguageServiceTest.php
31742-
31743-
-
31744-
message: '#^Method Ibexa\\Tests\\Integration\\Core\\Repository\\LanguageServiceTest\:\:testDisableLanguage\(\) has no return type specified\.$#'
31745-
identifier: missingType.return
31746-
count: 1
31747-
path: tests/integration/Core/Repository/LanguageServiceTest.php
31748-
31749-
-
31750-
message: '#^Method Ibexa\\Tests\\Integration\\Core\\Repository\\LanguageServiceTest\:\:testEnableLanguage\(\) has no return type specified\.$#'
31751-
identifier: missingType.return
31752-
count: 1
31753-
path: tests/integration/Core/Repository/LanguageServiceTest.php
31754-
31755-
-
31756-
message: '#^Method Ibexa\\Tests\\Integration\\Core\\Repository\\LanguageServiceTest\:\:testGetDefaultLanguageCode\(\) has no return type specified\.$#'
31757-
identifier: missingType.return
31758-
count: 1
31759-
path: tests/integration/Core/Repository/LanguageServiceTest.php
31760-
31761-
-
31762-
message: '#^Method Ibexa\\Tests\\Integration\\Core\\Repository\\LanguageServiceTest\:\:testLoadLanguage\(\) has no return type specified\.$#'
31763-
identifier: missingType.return
31764-
count: 1
31765-
path: tests/integration/Core/Repository/LanguageServiceTest.php
31766-
31767-
-
31768-
message: '#^Method Ibexa\\Tests\\Integration\\Core\\Repository\\LanguageServiceTest\:\:testLoadLanguageById\(\) has no return type specified\.$#'
31769-
identifier: missingType.return
31770-
count: 1
31771-
path: tests/integration/Core/Repository/LanguageServiceTest.php
31772-
31773-
-
31774-
message: '#^Method Ibexa\\Tests\\Integration\\Core\\Repository\\LanguageServiceTest\:\:testLoadLanguageByIdThrowsNotFoundException\(\) has no return type specified\.$#'
31775-
identifier: missingType.return
31776-
count: 1
31777-
path: tests/integration/Core/Repository/LanguageServiceTest.php
31778-
31779-
-
31780-
message: '#^Method Ibexa\\Tests\\Integration\\Core\\Repository\\LanguageServiceTest\:\:testLoadLanguageThrowsInvalidArgumentException\(\) has no return type specified\.$#'
31781-
identifier: missingType.return
31782-
count: 1
31783-
path: tests/integration/Core/Repository/LanguageServiceTest.php
31784-
31785-
-
31786-
message: '#^Method Ibexa\\Tests\\Integration\\Core\\Repository\\LanguageServiceTest\:\:testLoadLanguageThrowsNotFoundException\(\) has no return type specified\.$#'
31787-
identifier: missingType.return
31788-
count: 1
31789-
path: tests/integration/Core/Repository/LanguageServiceTest.php
31790-
31791-
-
31792-
message: '#^Method Ibexa\\Tests\\Integration\\Core\\Repository\\LanguageServiceTest\:\:testLoadLanguages\(\) has no return type specified\.$#'
31793-
identifier: missingType.return
31794-
count: 1
31795-
path: tests/integration/Core/Repository/LanguageServiceTest.php
31796-
31797-
-
31798-
message: '#^Method Ibexa\\Tests\\Integration\\Core\\Repository\\LanguageServiceTest\:\:testNewLanguageCreateStruct\(\) has no return type specified\.$#'
31799-
identifier: missingType.return
31800-
count: 1
31801-
path: tests/integration/Core/Repository/LanguageServiceTest.php
31802-
31803-
-
31804-
message: '#^Method Ibexa\\Tests\\Integration\\Core\\Repository\\LanguageServiceTest\:\:testUpdateLanguageName\(\) has no return type specified\.$#'
31805-
identifier: missingType.return
31806-
count: 1
31807-
path: tests/integration/Core/Repository/LanguageServiceTest.php
31808-
31809-
-
31810-
message: '#^Method Ibexa\\Tests\\Integration\\Core\\Repository\\LanguageServiceTest\:\:testUpdateLanguageNameInTransactionWithCommit\(\) has no return type specified\.$#'
31811-
identifier: missingType.return
31812-
count: 1
31813-
path: tests/integration/Core/Repository/LanguageServiceTest.php
31814-
31815-
-
31816-
message: '#^Method Ibexa\\Tests\\Integration\\Core\\Repository\\LanguageServiceTest\:\:testUpdateLanguageNameInTransactionWithRollback\(\) has no return type specified\.$#'
31817-
identifier: missingType.return
31818-
count: 1
31819-
path: tests/integration/Core/Repository/LanguageServiceTest.php
31820-
31821-
-
31822-
message: '#^Method Ibexa\\Tests\\Integration\\Core\\Repository\\LanguageServiceTest\:\:testUpdateLanguageNameThrowsInvalidArgumentException\(\) has no return type specified\.$#'
31823-
identifier: missingType.return
31588+
message: '#^Argument of an invalid type Ibexa\\Contracts\\Core\\Repository\\Values\\ValueObject supplied for foreach, only iterables are supported\.$#'
31589+
identifier: foreach.nonIterable
3182431590
count: 1
3182531591
path: tests/integration/Core/Repository/LanguageServiceTest.php
3182631592

tests/integration/Core/CoreTestKernel.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
<?php
22

3+
/**
4+
* @copyright Copyright (C) Ibexa AS. All rights reserved.
5+
* @license For full copyright and license information view LICENSE file distributed with this source code.
6+
*/
7+
38
namespace Ibexa\Tests\Integration\Core;
49

510
use Ibexa\Contracts\Core\Test\IbexaTestKernel;

0 commit comments

Comments
 (0)