Skip to content

Commit 2530b23

Browse files
authored
Merge pull request codeigniter4#8856 from kenjis/fix-cs-tests
test: fix coding style and test-coding-standards.yml
2 parents 299bb8b + 9a7cae8 commit 2530b23

File tree

314 files changed

+462
-456
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

314 files changed

+462
-456
lines changed

.github/workflows/test-coding-standards.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
matrix:
3030
php-version:
3131
- '8.1'
32-
- '8.2'
32+
- '8.3'
3333

3434
steps:
3535
- name: Checkout
@@ -60,8 +60,11 @@ jobs:
6060
- name: Run lint on `app/`, `admin/`, `public/`
6161
run: vendor/bin/php-cs-fixer fix --verbose --ansi --dry-run --config=.php-cs-fixer.no-header.php --using-cache=no --diff
6262

63-
- name: Run lint on `system/`, `tests`, `utils/`, and root PHP files
63+
- name: Run lint on `system/`, `utils/`, and root PHP files
6464
run: vendor/bin/php-cs-fixer fix --verbose --ansi --dry-run --using-cache=no --diff
6565

66+
- name: Run lint on `tests`
67+
run: vendor/bin/php-cs-fixer fix --verbose --ansi --dry-run --config=.php-cs-fixer.tests.php --using-cache=no --diff
68+
6669
- name: Run lint on `user_guide_src/source/`
6770
run: vendor/bin/php-cs-fixer fix --verbose --ansi --dry-run --config=.php-cs-fixer.user-guide.php --using-cache=no --diff

tests/system/API/ResponseTraitTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313

1414
namespace CodeIgniter\API;
1515

16-
use PHPUnit\Framework\Attributes\Group;
1716
use CodeIgniter\Config\Factories;
1817
use CodeIgniter\Format\FormatterInterface;
1918
use CodeIgniter\Format\JSONFormatter;
@@ -25,6 +24,7 @@
2524
use CodeIgniter\Test\Mock\MockResponse;
2625
use Config\App;
2726
use Config\Cookie;
27+
use PHPUnit\Framework\Attributes\Group;
2828
use stdClass;
2929

3030
/**

tests/system/AutoReview/ComposerJsonTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@
1313

1414
namespace CodeIgniter\AutoReview;
1515

16-
use PHPUnit\Framework\Attributes\CoversNothing;
17-
use PHPUnit\Framework\Attributes\Group;
1816
use InvalidArgumentException;
1917
use JsonException;
18+
use PHPUnit\Framework\Attributes\CoversNothing;
19+
use PHPUnit\Framework\Attributes\Group;
2020
use PHPUnit\Framework\TestCase;
2121

2222
/**

tests/system/AutoReview/FrameworkCodeTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313

1414
namespace CodeIgniter\AutoReview;
1515

16-
use PHPUnit\Framework\Attributes\DataProvider;
1716
use FilesystemIterator;
17+
use PHPUnit\Framework\Attributes\DataProvider;
1818
use PHPUnit\Framework\Attributes\Group;
1919
use PHPUnit\Framework\TestCase;
2020
use RecursiveDirectoryIterator;

tests/system/Autoloader/AutoloaderTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,6 @@
1313

1414
namespace CodeIgniter\Autoloader;
1515

16-
use PHPUnit\Framework\Attributes\Group;
17-
use PHPUnit\Framework\Attributes\RunInSeparateProcess;
18-
use PHPUnit\Framework\Attributes\PreserveGlobalState;
1916
use App\Controllers\Home;
2017
use Closure;
2118
use CodeIgniter\Exceptions\ConfigException;
@@ -25,6 +22,9 @@
2522
use Config\Modules;
2623
use Config\Services;
2724
use InvalidArgumentException;
25+
use PHPUnit\Framework\Attributes\Group;
26+
use PHPUnit\Framework\Attributes\PreserveGlobalState;
27+
use PHPUnit\Framework\Attributes\RunInSeparateProcess;
2828
use RuntimeException;
2929
use UnnamespacedClass;
3030

tests/system/Autoloader/FileLocatorCachedTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@
1313

1414
namespace CodeIgniter\Autoloader;
1515

16-
use PHPUnit\Framework\Attributes\Group;
1716
use CodeIgniter\Cache\FactoriesCache\FileVarExportHandler;
1817
use Config\Autoload;
1918
use Config\Modules;
19+
use PHPUnit\Framework\Attributes\Group;
2020

2121
/**
2222
* @internal

tests/system/Autoloader/FileLocatorTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@
1313

1414
namespace CodeIgniter\Autoloader;
1515

16-
use PHPUnit\Framework\Attributes\Group;
1716
use CodeIgniter\HTTP\Header;
1817
use CodeIgniter\Test\CIUnitTestCase;
1918
use Config\Autoload;
2019
use Config\Modules;
20+
use PHPUnit\Framework\Attributes\Group;
2121

2222
/**
2323
* @internal

tests/system/CLI/CLITest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@
1313

1414
namespace CodeIgniter\CLI;
1515

16-
use PHPUnit\Framework\Attributes\Group;
17-
use PHPUnit\Framework\Attributes\DataProvider;
1816
use CodeIgniter\Test\CIUnitTestCase;
1917
use CodeIgniter\Test\PhpStreamWrapper;
2018
use CodeIgniter\Test\StreamFilterTrait;
19+
use PHPUnit\Framework\Attributes\DataProvider;
20+
use PHPUnit\Framework\Attributes\Group;
2121
use ReflectionProperty;
2222
use RuntimeException;
2323

tests/system/CLI/ConsoleTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,14 @@
1313

1414
namespace CodeIgniter\CLI;
1515

16-
use PHPUnit\Framework\Attributes\Group;
1716
use CodeIgniter\CodeIgniter;
1817
use CodeIgniter\Config\DotEnv;
1918
use CodeIgniter\Events\Events;
2019
use CodeIgniter\Test\CIUnitTestCase;
2120
use CodeIgniter\Test\Mock\MockCLIConfig;
2221
use CodeIgniter\Test\Mock\MockCodeIgniter;
2322
use CodeIgniter\Test\StreamFilterTrait;
23+
use PHPUnit\Framework\Attributes\Group;
2424

2525
/**
2626
* @internal

tests/system/Cache/CacheFactoryTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@
1313

1414
namespace CodeIgniter\Cache;
1515

16-
use PHPUnit\Framework\Attributes\Group;
1716
use CodeIgniter\Cache\Exceptions\CacheException;
1817
use CodeIgniter\Cache\Handlers\DummyHandler;
1918
use CodeIgniter\Test\CIUnitTestCase;
2019
use Config\Cache;
20+
use PHPUnit\Framework\Attributes\Group;
2121

2222
/**
2323
* @internal

tests/system/Cache/CacheMockTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@
1313

1414
namespace CodeIgniter\Cache;
1515

16-
use PHPUnit\Framework\Attributes\Group;
1716
use CodeIgniter\Cache\Handlers\BaseHandler;
1817
use CodeIgniter\Test\CIUnitTestCase;
1918
use CodeIgniter\Test\Mock\MockCache;
19+
use PHPUnit\Framework\Attributes\Group;
2020

2121
/**
2222
* @internal

tests/system/Cache/FactoriesCacheFileHandlerTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313

1414
namespace CodeIgniter\Cache;
1515

16-
use PHPUnit\Framework\Attributes\Group;
1716
use Config\Cache as CacheConfig;
17+
use PHPUnit\Framework\Attributes\Group;
1818

1919
/**
2020
* @internal

tests/system/Cache/FactoriesCacheFileVarExportHandlerTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@
1313

1414
namespace CodeIgniter\Cache;
1515

16-
use PHPUnit\Framework\Attributes\Group;
1716
use CodeIgniter\Cache\FactoriesCache\FileVarExportHandler;
1817
use CodeIgniter\Config\Factories;
1918
use CodeIgniter\Test\CIUnitTestCase;
2019
use Config\App;
20+
use PHPUnit\Framework\Attributes\Group;
2121

2222
/**
2323
* @internal

tests/system/Cache/Handlers/BaseHandlerTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@
1313

1414
namespace CodeIgniter\Cache\Handlers;
1515

16-
use PHPUnit\Framework\Attributes\Group;
17-
use PHPUnit\Framework\Attributes\DataProvider;
1816
use CodeIgniter\Test\CIUnitTestCase;
17+
use PHPUnit\Framework\Attributes\DataProvider;
18+
use PHPUnit\Framework\Attributes\Group;
1919
use stdClass;
2020
use Tests\Support\Cache\RestrictiveHandler;
2121

tests/system/Cache/Handlers/DummyHandlerTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313

1414
namespace CodeIgniter\Cache\Handlers;
1515

16-
use PHPUnit\Framework\Attributes\Group;
1716
use CodeIgniter\Test\CIUnitTestCase;
17+
use PHPUnit\Framework\Attributes\Group;
1818

1919
/**
2020
* @internal

tests/system/Cache/Handlers/FileHandlerTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@
1313

1414
namespace CodeIgniter\Cache\Handlers;
1515

16-
use PHPUnit\Framework\Attributes\Group;
17-
use PHPUnit\Framework\Attributes\RequiresOperatingSystem;
18-
use PHPUnit\Framework\Attributes\DataProvider;
1916
use CodeIgniter\Cache\Exceptions\CacheException;
2017
use CodeIgniter\CLI\CLI;
2118
use CodeIgniter\I18n\Time;
2219
use Config\Cache;
20+
use PHPUnit\Framework\Attributes\DataProvider;
21+
use PHPUnit\Framework\Attributes\Group;
22+
use PHPUnit\Framework\Attributes\RequiresOperatingSystem;
2323

2424
/**
2525
* @internal

tests/system/Cache/Handlers/MemcachedHandlerTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@
1313

1414
namespace CodeIgniter\Cache\Handlers;
1515

16-
use PHPUnit\Framework\Attributes\Group;
1716
use CodeIgniter\CLI\CLI;
1817
use CodeIgniter\I18n\Time;
1918
use Config\Cache;
2019
use Exception;
20+
use PHPUnit\Framework\Attributes\Group;
2121

2222
/**
2323
* @internal

tests/system/Cache/Handlers/PredisHandlerTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@
1313

1414
namespace CodeIgniter\Cache\Handlers;
1515

16-
use PHPUnit\Framework\Attributes\Group;
1716
use CodeIgniter\CLI\CLI;
1817
use CodeIgniter\I18n\Time;
1918
use Config\Cache;
19+
use PHPUnit\Framework\Attributes\Group;
2020

2121
/**
2222
* @internal

tests/system/Cache/Handlers/RedisHandlerTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@
1313

1414
namespace CodeIgniter\Cache\Handlers;
1515

16-
use PHPUnit\Framework\Attributes\Group;
1716
use CodeIgniter\CLI\CLI;
1817
use CodeIgniter\I18n\Time;
1918
use Config\Cache;
19+
use PHPUnit\Framework\Attributes\Group;
2020

2121
/**
2222
* @internal

tests/system/Cache/ResponseCacheTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@
1313

1414
namespace CodeIgniter\Cache;
1515

16-
use PHPUnit\Framework\Attributes\BackupGlobals;
17-
use PHPUnit\Framework\Attributes\Group;
1816
use CodeIgniter\HTTP\CLIRequest;
1917
use CodeIgniter\HTTP\IncomingRequest;
2018
use CodeIgniter\HTTP\Response;
@@ -26,6 +24,8 @@
2624
use Config\Cache as CacheConfig;
2725
use ErrorException;
2826
use Exception;
27+
use PHPUnit\Framework\Attributes\BackupGlobals;
28+
use PHPUnit\Framework\Attributes\Group;
2929

3030
/**
3131
* @internal

tests/system/CodeIgniterTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,6 @@
1313

1414
namespace CodeIgniter;
1515

16-
use PHPUnit\Framework\Attributes\RunTestsInSeparateProcesses;
17-
use PHPUnit\Framework\Attributes\BackupGlobals;
18-
use PHPUnit\Framework\Attributes\Group;
19-
use PHPUnit\Framework\Attributes\DataProvider;
2016
use App\Controllers\Home;
2117
use CodeIgniter\Config\Services;
2218
use CodeIgniter\Debug\Timer;
@@ -34,6 +30,10 @@
3430
use Config\Filters as FiltersConfig;
3531
use Config\Modules;
3632
use Config\Routing;
33+
use PHPUnit\Framework\Attributes\BackupGlobals;
34+
use PHPUnit\Framework\Attributes\DataProvider;
35+
use PHPUnit\Framework\Attributes\Group;
36+
use PHPUnit\Framework\Attributes\RunTestsInSeparateProcesses;
3737
use Tests\Support\Filters\Customfilter;
3838
use Tests\Support\Filters\RedirectFilter;
3939

tests/system/Commands/BaseCommandTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@
1313

1414
namespace CodeIgniter\Commands;
1515

16-
use PHPUnit\Framework\Attributes\Group;
1716
use CodeIgniter\Log\Logger;
1817
use CodeIgniter\Test\CIUnitTestCase;
1918
use Config\Services;
19+
use PHPUnit\Framework\Attributes\Group;
2020
use Tests\Support\Commands\AppInfo;
2121

2222
/**

tests/system/Commands/CellGeneratorTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@
1313

1414
namespace CodeIgniter\Commands;
1515

16-
use PHPUnit\Framework\Attributes\Group;
1716
use CodeIgniter\Test\CIUnitTestCase;
1817
use CodeIgniter\Test\StreamFilterTrait;
18+
use PHPUnit\Framework\Attributes\Group;
1919

2020
/**
2121
* @internal

tests/system/Commands/ClearCacheTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@
1313

1414
namespace CodeIgniter\Commands;
1515

16-
use PHPUnit\Framework\Attributes\Group;
1716
use CodeIgniter\Cache\CacheFactory;
1817
use CodeIgniter\Test\CIUnitTestCase;
1918
use CodeIgniter\Test\StreamFilterTrait;
2019
use Config\Services;
20+
use PHPUnit\Framework\Attributes\Group;
2121

2222
/**
2323
* @internal

tests/system/Commands/ClearDebugbarTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@
1313

1414
namespace CodeIgniter\Commands;
1515

16-
use PHPUnit\Framework\Attributes\Group;
1716
use CodeIgniter\Test\CIUnitTestCase;
1817
use CodeIgniter\Test\StreamFilterTrait;
18+
use PHPUnit\Framework\Attributes\Group;
1919

2020
/**
2121
* @internal

tests/system/Commands/ClearLogsTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@
1313

1414
namespace CodeIgniter\Commands;
1515

16-
use PHPUnit\Framework\Attributes\Group;
1716
use CodeIgniter\Test\CIUnitTestCase;
1817
use CodeIgniter\Test\StreamFilterTrait;
18+
use PHPUnit\Framework\Attributes\Group;
1919

2020
/**
2121
* @internal

tests/system/Commands/CommandGeneratorTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@
1313

1414
namespace CodeIgniter\Commands;
1515

16-
use PHPUnit\Framework\Attributes\Group;
1716
use CodeIgniter\Test\CIUnitTestCase;
1817
use CodeIgniter\Test\StreamFilterTrait;
18+
use PHPUnit\Framework\Attributes\Group;
1919

2020
/**
2121
* @internal

tests/system/Commands/CommandTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@
1313

1414
namespace CodeIgniter\Commands;
1515

16-
use PHPUnit\Framework\Attributes\Group;
17-
use PHPUnit\Framework\Attributes\DataProvider;
1816
use CodeIgniter\CLI\Commands;
1917
use CodeIgniter\Log\Logger;
2018
use CodeIgniter\Test\CIUnitTestCase;
2119
use CodeIgniter\Test\StreamFilterTrait;
2220
use Config\Services;
21+
use PHPUnit\Framework\Attributes\DataProvider;
22+
use PHPUnit\Framework\Attributes\Group;
2323
use Tests\Support\Commands\ParamsReveal;
2424

2525
/**

tests/system/Commands/ConfigGeneratorTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@
1313

1414
namespace CodeIgniter\Commands;
1515

16-
use PHPUnit\Framework\Attributes\Group;
1716
use CodeIgniter\Test\CIUnitTestCase;
1817
use CodeIgniter\Test\StreamFilterTrait;
18+
use PHPUnit\Framework\Attributes\Group;
1919

2020
/**
2121
* @internal

0 commit comments

Comments
 (0)