Skip to content

Commit

Permalink
Merge pull request #8856 from kenjis/fix-cs-tests
Browse files Browse the repository at this point in the history
test: fix coding style and test-coding-standards.yml
  • Loading branch information
kenjis authored May 6, 2024
2 parents 299bb8b + 9a7cae8 commit 2530b23
Show file tree
Hide file tree
Showing 314 changed files with 462 additions and 456 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/test-coding-standards.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
matrix:
php-version:
- '8.1'
- '8.2'
- '8.3'

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

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

- name: Run lint on `tests`
run: vendor/bin/php-cs-fixer fix --verbose --ansi --dry-run --config=.php-cs-fixer.tests.php --using-cache=no --diff

- name: Run lint on `user_guide_src/source/`
run: vendor/bin/php-cs-fixer fix --verbose --ansi --dry-run --config=.php-cs-fixer.user-guide.php --using-cache=no --diff
2 changes: 1 addition & 1 deletion tests/system/API/ResponseTraitTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@

namespace CodeIgniter\API;

use PHPUnit\Framework\Attributes\Group;
use CodeIgniter\Config\Factories;
use CodeIgniter\Format\FormatterInterface;
use CodeIgniter\Format\JSONFormatter;
Expand All @@ -25,6 +24,7 @@
use CodeIgniter\Test\Mock\MockResponse;
use Config\App;
use Config\Cookie;
use PHPUnit\Framework\Attributes\Group;
use stdClass;

/**
Expand Down
4 changes: 2 additions & 2 deletions tests/system/AutoReview/ComposerJsonTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@

namespace CodeIgniter\AutoReview;

use PHPUnit\Framework\Attributes\CoversNothing;
use PHPUnit\Framework\Attributes\Group;
use InvalidArgumentException;
use JsonException;
use PHPUnit\Framework\Attributes\CoversNothing;
use PHPUnit\Framework\Attributes\Group;
use PHPUnit\Framework\TestCase;

/**
Expand Down
2 changes: 1 addition & 1 deletion tests/system/AutoReview/FrameworkCodeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@

namespace CodeIgniter\AutoReview;

use PHPUnit\Framework\Attributes\DataProvider;
use FilesystemIterator;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\Attributes\Group;
use PHPUnit\Framework\TestCase;
use RecursiveDirectoryIterator;
Expand Down
6 changes: 3 additions & 3 deletions tests/system/Autoloader/AutoloaderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@

namespace CodeIgniter\Autoloader;

use PHPUnit\Framework\Attributes\Group;
use PHPUnit\Framework\Attributes\RunInSeparateProcess;
use PHPUnit\Framework\Attributes\PreserveGlobalState;
use App\Controllers\Home;
use Closure;
use CodeIgniter\Exceptions\ConfigException;
Expand All @@ -25,6 +22,9 @@
use Config\Modules;
use Config\Services;
use InvalidArgumentException;
use PHPUnit\Framework\Attributes\Group;
use PHPUnit\Framework\Attributes\PreserveGlobalState;
use PHPUnit\Framework\Attributes\RunInSeparateProcess;
use RuntimeException;
use UnnamespacedClass;

Expand Down
2 changes: 1 addition & 1 deletion tests/system/Autoloader/FileLocatorCachedTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@

namespace CodeIgniter\Autoloader;

use PHPUnit\Framework\Attributes\Group;
use CodeIgniter\Cache\FactoriesCache\FileVarExportHandler;
use Config\Autoload;
use Config\Modules;
use PHPUnit\Framework\Attributes\Group;

/**
* @internal
Expand Down
2 changes: 1 addition & 1 deletion tests/system/Autoloader/FileLocatorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@

namespace CodeIgniter\Autoloader;

use PHPUnit\Framework\Attributes\Group;
use CodeIgniter\HTTP\Header;
use CodeIgniter\Test\CIUnitTestCase;
use Config\Autoload;
use Config\Modules;
use PHPUnit\Framework\Attributes\Group;

/**
* @internal
Expand Down
4 changes: 2 additions & 2 deletions tests/system/CLI/CLITest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@

namespace CodeIgniter\CLI;

use PHPUnit\Framework\Attributes\Group;
use PHPUnit\Framework\Attributes\DataProvider;
use CodeIgniter\Test\CIUnitTestCase;
use CodeIgniter\Test\PhpStreamWrapper;
use CodeIgniter\Test\StreamFilterTrait;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\Attributes\Group;
use ReflectionProperty;
use RuntimeException;

Expand Down
2 changes: 1 addition & 1 deletion tests/system/CLI/ConsoleTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@

namespace CodeIgniter\CLI;

use PHPUnit\Framework\Attributes\Group;
use CodeIgniter\CodeIgniter;
use CodeIgniter\Config\DotEnv;
use CodeIgniter\Events\Events;
use CodeIgniter\Test\CIUnitTestCase;
use CodeIgniter\Test\Mock\MockCLIConfig;
use CodeIgniter\Test\Mock\MockCodeIgniter;
use CodeIgniter\Test\StreamFilterTrait;
use PHPUnit\Framework\Attributes\Group;

/**
* @internal
Expand Down
2 changes: 1 addition & 1 deletion tests/system/Cache/CacheFactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@

namespace CodeIgniter\Cache;

use PHPUnit\Framework\Attributes\Group;
use CodeIgniter\Cache\Exceptions\CacheException;
use CodeIgniter\Cache\Handlers\DummyHandler;
use CodeIgniter\Test\CIUnitTestCase;
use Config\Cache;
use PHPUnit\Framework\Attributes\Group;

/**
* @internal
Expand Down
2 changes: 1 addition & 1 deletion tests/system/Cache/CacheMockTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@

namespace CodeIgniter\Cache;

use PHPUnit\Framework\Attributes\Group;
use CodeIgniter\Cache\Handlers\BaseHandler;
use CodeIgniter\Test\CIUnitTestCase;
use CodeIgniter\Test\Mock\MockCache;
use PHPUnit\Framework\Attributes\Group;

/**
* @internal
Expand Down
2 changes: 1 addition & 1 deletion tests/system/Cache/FactoriesCacheFileHandlerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@

namespace CodeIgniter\Cache;

use PHPUnit\Framework\Attributes\Group;
use Config\Cache as CacheConfig;
use PHPUnit\Framework\Attributes\Group;

/**
* @internal
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@

namespace CodeIgniter\Cache;

use PHPUnit\Framework\Attributes\Group;
use CodeIgniter\Cache\FactoriesCache\FileVarExportHandler;
use CodeIgniter\Config\Factories;
use CodeIgniter\Test\CIUnitTestCase;
use Config\App;
use PHPUnit\Framework\Attributes\Group;

/**
* @internal
Expand Down
4 changes: 2 additions & 2 deletions tests/system/Cache/Handlers/BaseHandlerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@

namespace CodeIgniter\Cache\Handlers;

use PHPUnit\Framework\Attributes\Group;
use PHPUnit\Framework\Attributes\DataProvider;
use CodeIgniter\Test\CIUnitTestCase;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\Attributes\Group;
use stdClass;
use Tests\Support\Cache\RestrictiveHandler;

Expand Down
2 changes: 1 addition & 1 deletion tests/system/Cache/Handlers/DummyHandlerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@

namespace CodeIgniter\Cache\Handlers;

use PHPUnit\Framework\Attributes\Group;
use CodeIgniter\Test\CIUnitTestCase;
use PHPUnit\Framework\Attributes\Group;

/**
* @internal
Expand Down
6 changes: 3 additions & 3 deletions tests/system/Cache/Handlers/FileHandlerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@

namespace CodeIgniter\Cache\Handlers;

use PHPUnit\Framework\Attributes\Group;
use PHPUnit\Framework\Attributes\RequiresOperatingSystem;
use PHPUnit\Framework\Attributes\DataProvider;
use CodeIgniter\Cache\Exceptions\CacheException;
use CodeIgniter\CLI\CLI;
use CodeIgniter\I18n\Time;
use Config\Cache;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\Attributes\Group;
use PHPUnit\Framework\Attributes\RequiresOperatingSystem;

/**
* @internal
Expand Down
2 changes: 1 addition & 1 deletion tests/system/Cache/Handlers/MemcachedHandlerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@

namespace CodeIgniter\Cache\Handlers;

use PHPUnit\Framework\Attributes\Group;
use CodeIgniter\CLI\CLI;
use CodeIgniter\I18n\Time;
use Config\Cache;
use Exception;
use PHPUnit\Framework\Attributes\Group;

/**
* @internal
Expand Down
2 changes: 1 addition & 1 deletion tests/system/Cache/Handlers/PredisHandlerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@

namespace CodeIgniter\Cache\Handlers;

use PHPUnit\Framework\Attributes\Group;
use CodeIgniter\CLI\CLI;
use CodeIgniter\I18n\Time;
use Config\Cache;
use PHPUnit\Framework\Attributes\Group;

/**
* @internal
Expand Down
2 changes: 1 addition & 1 deletion tests/system/Cache/Handlers/RedisHandlerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@

namespace CodeIgniter\Cache\Handlers;

use PHPUnit\Framework\Attributes\Group;
use CodeIgniter\CLI\CLI;
use CodeIgniter\I18n\Time;
use Config\Cache;
use PHPUnit\Framework\Attributes\Group;

/**
* @internal
Expand Down
4 changes: 2 additions & 2 deletions tests/system/Cache/ResponseCacheTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@

namespace CodeIgniter\Cache;

use PHPUnit\Framework\Attributes\BackupGlobals;
use PHPUnit\Framework\Attributes\Group;
use CodeIgniter\HTTP\CLIRequest;
use CodeIgniter\HTTP\IncomingRequest;
use CodeIgniter\HTTP\Response;
Expand All @@ -26,6 +24,8 @@
use Config\Cache as CacheConfig;
use ErrorException;
use Exception;
use PHPUnit\Framework\Attributes\BackupGlobals;
use PHPUnit\Framework\Attributes\Group;

/**
* @internal
Expand Down
8 changes: 4 additions & 4 deletions tests/system/CodeIgniterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,6 @@

namespace CodeIgniter;

use PHPUnit\Framework\Attributes\RunTestsInSeparateProcesses;
use PHPUnit\Framework\Attributes\BackupGlobals;
use PHPUnit\Framework\Attributes\Group;
use PHPUnit\Framework\Attributes\DataProvider;
use App\Controllers\Home;
use CodeIgniter\Config\Services;
use CodeIgniter\Debug\Timer;
Expand All @@ -34,6 +30,10 @@
use Config\Filters as FiltersConfig;
use Config\Modules;
use Config\Routing;
use PHPUnit\Framework\Attributes\BackupGlobals;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\Attributes\Group;
use PHPUnit\Framework\Attributes\RunTestsInSeparateProcesses;
use Tests\Support\Filters\Customfilter;
use Tests\Support\Filters\RedirectFilter;

Expand Down
2 changes: 1 addition & 1 deletion tests/system/Commands/BaseCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@

namespace CodeIgniter\Commands;

use PHPUnit\Framework\Attributes\Group;
use CodeIgniter\Log\Logger;
use CodeIgniter\Test\CIUnitTestCase;
use Config\Services;
use PHPUnit\Framework\Attributes\Group;
use Tests\Support\Commands\AppInfo;

/**
Expand Down
2 changes: 1 addition & 1 deletion tests/system/Commands/CellGeneratorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@

namespace CodeIgniter\Commands;

use PHPUnit\Framework\Attributes\Group;
use CodeIgniter\Test\CIUnitTestCase;
use CodeIgniter\Test\StreamFilterTrait;
use PHPUnit\Framework\Attributes\Group;

/**
* @internal
Expand Down
2 changes: 1 addition & 1 deletion tests/system/Commands/ClearCacheTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@

namespace CodeIgniter\Commands;

use PHPUnit\Framework\Attributes\Group;
use CodeIgniter\Cache\CacheFactory;
use CodeIgniter\Test\CIUnitTestCase;
use CodeIgniter\Test\StreamFilterTrait;
use Config\Services;
use PHPUnit\Framework\Attributes\Group;

/**
* @internal
Expand Down
2 changes: 1 addition & 1 deletion tests/system/Commands/ClearDebugbarTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@

namespace CodeIgniter\Commands;

use PHPUnit\Framework\Attributes\Group;
use CodeIgniter\Test\CIUnitTestCase;
use CodeIgniter\Test\StreamFilterTrait;
use PHPUnit\Framework\Attributes\Group;

/**
* @internal
Expand Down
2 changes: 1 addition & 1 deletion tests/system/Commands/ClearLogsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@

namespace CodeIgniter\Commands;

use PHPUnit\Framework\Attributes\Group;
use CodeIgniter\Test\CIUnitTestCase;
use CodeIgniter\Test\StreamFilterTrait;
use PHPUnit\Framework\Attributes\Group;

/**
* @internal
Expand Down
2 changes: 1 addition & 1 deletion tests/system/Commands/CommandGeneratorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@

namespace CodeIgniter\Commands;

use PHPUnit\Framework\Attributes\Group;
use CodeIgniter\Test\CIUnitTestCase;
use CodeIgniter\Test\StreamFilterTrait;
use PHPUnit\Framework\Attributes\Group;

/**
* @internal
Expand Down
4 changes: 2 additions & 2 deletions tests/system/Commands/CommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@

namespace CodeIgniter\Commands;

use PHPUnit\Framework\Attributes\Group;
use PHPUnit\Framework\Attributes\DataProvider;
use CodeIgniter\CLI\Commands;
use CodeIgniter\Log\Logger;
use CodeIgniter\Test\CIUnitTestCase;
use CodeIgniter\Test\StreamFilterTrait;
use Config\Services;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\Attributes\Group;
use Tests\Support\Commands\ParamsReveal;

/**
Expand Down
2 changes: 1 addition & 1 deletion tests/system/Commands/ConfigGeneratorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@

namespace CodeIgniter\Commands;

use PHPUnit\Framework\Attributes\Group;
use CodeIgniter\Test\CIUnitTestCase;
use CodeIgniter\Test\StreamFilterTrait;
use PHPUnit\Framework\Attributes\Group;

/**
* @internal
Expand Down
Loading

0 comments on commit 2530b23

Please sign in to comment.