Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions tests/system/AutoReview/ComposerJsonTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,19 @@
#[Group('AutoReview')]
final class ComposerJsonTest extends TestCase
{
/**
* @var array<string, mixed>
*/
private array $devComposer;

/**
* @var array<string, mixed>
*/
private array $frameworkComposer;

/**
* @var array<string, mixed>
*/
private array $starterComposer;

protected function setUp(): void
Expand Down Expand Up @@ -105,6 +116,10 @@ private function checkSection(string $section, string $component): void
);
}

/**
* @param array<string, mixed> $fromMain
* @param array<string, mixed> $fromComponent
*/
private function checkConfig(array $fromMain, array $fromComponent, string $component): void
{
foreach ($fromMain as $key => $expectedValue) {
Expand All @@ -124,6 +139,9 @@ private function checkConfig(array $fromMain, array $fromComponent, string $comp
}
}

/**
* @return array<string, mixed>
*/
private function getComposerJson(string $path): array
{
try {
Expand Down
11 changes: 11 additions & 0 deletions tests/system/AutoReview/FrameworkCodeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,14 @@ final class FrameworkCodeTest extends TestCase
{
/**
* Cache of discovered test class names.
*
* @var list<class-string>
*/
private static array $testClasses = [];

/**
* @var list<string>
*/
private static array $recognizedGroupAttributeNames = [
'AutoReview',
'CacheLive',
Expand Down Expand Up @@ -79,13 +84,19 @@ public function testEachTestClassHasCorrectGroupAttributeName(string $class): vo
));
}

/**
* @return iterable<class-string, array{class-string}>
*/
public static function provideEachTestClassHasCorrectGroupAttributeName(): iterable
{
foreach (self::getTestClasses() as $class) {
yield $class => [$class];
}
}

/**
* @return list<class-string>
*/
private static function getTestClasses(): array
{
if (self::$testClasses !== []) {
Expand Down
2 changes: 1 addition & 1 deletion utils/phpstan-baseline/loader.neon
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# total 112 errors
# total 102 errors

includes:
- argument.type.neon
Expand Down
52 changes: 1 addition & 51 deletions utils/phpstan-baseline/missingType.iterableValue.neon
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# total 68 errors
# total 58 errors

parameters:
ignoreErrors:
Expand Down Expand Up @@ -172,56 +172,6 @@ parameters:
count: 1
path: ../../system/View/Cells/Cell.php

-
message: '#^Method CodeIgniter\\AutoReview\\ComposerJsonTest\:\:checkConfig\(\) has parameter \$fromComponent with no value type specified in iterable type array\.$#'
count: 1
path: ../../tests/system/AutoReview/ComposerJsonTest.php

-
message: '#^Method CodeIgniter\\AutoReview\\ComposerJsonTest\:\:checkConfig\(\) has parameter \$fromMain with no value type specified in iterable type array\.$#'
count: 1
path: ../../tests/system/AutoReview/ComposerJsonTest.php

-
message: '#^Method CodeIgniter\\AutoReview\\ComposerJsonTest\:\:getComposerJson\(\) return type has no value type specified in iterable type array\.$#'
count: 1
path: ../../tests/system/AutoReview/ComposerJsonTest.php

-
message: '#^Property CodeIgniter\\AutoReview\\ComposerJsonTest\:\:\$devComposer type has no value type specified in iterable type array\.$#'
count: 1
path: ../../tests/system/AutoReview/ComposerJsonTest.php

-
message: '#^Property CodeIgniter\\AutoReview\\ComposerJsonTest\:\:\$frameworkComposer type has no value type specified in iterable type array\.$#'
count: 1
path: ../../tests/system/AutoReview/ComposerJsonTest.php

-
message: '#^Property CodeIgniter\\AutoReview\\ComposerJsonTest\:\:\$starterComposer type has no value type specified in iterable type array\.$#'
count: 1
path: ../../tests/system/AutoReview/ComposerJsonTest.php

-
message: '#^Method CodeIgniter\\AutoReview\\FrameworkCodeTest\:\:getTestClasses\(\) return type has no value type specified in iterable type array\.$#'
count: 1
path: ../../tests/system/AutoReview/FrameworkCodeTest.php

-
message: '#^Method CodeIgniter\\AutoReview\\FrameworkCodeTest\:\:provideEachTestClassHasCorrectGroupAttributeName\(\) return type has no value type specified in iterable type iterable\.$#'
count: 1
path: ../../tests/system/AutoReview/FrameworkCodeTest.php

-
message: '#^Property CodeIgniter\\AutoReview\\FrameworkCodeTest\:\:\$recognizedGroupAttributeNames type has no value type specified in iterable type array\.$#'
count: 1
path: ../../tests/system/AutoReview/FrameworkCodeTest.php

-
message: '#^Property CodeIgniter\\AutoReview\\FrameworkCodeTest\:\:\$testClasses type has no value type specified in iterable type array\.$#'
count: 1
path: ../../tests/system/AutoReview/FrameworkCodeTest.php

-
message: '#^Method CodeIgniter\\CLI\\CLITest\:\:provideTable\(\) return type has no value type specified in iterable type iterable\.$#'
count: 1
Expand Down
Loading