Skip to content

Commit

Permalink
Run rector
Browse files Browse the repository at this point in the history
  • Loading branch information
paulbalandan committed Apr 22, 2024
1 parent faed516 commit dd76daa
Show file tree
Hide file tree
Showing 320 changed files with 1,185 additions and 728 deletions.
3 changes: 2 additions & 1 deletion tests/system/API/ResponseTraitTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

namespace CodeIgniter\API;

use PHPUnit\Framework\Attributes\Group;
use CodeIgniter\Config\Factories;
use CodeIgniter\Format\FormatterInterface;
use CodeIgniter\Format\JSONFormatter;
Expand All @@ -29,7 +30,7 @@
/**
* @internal
*/
#[\PHPUnit\Framework\Attributes\Group('Others')]
#[Group('Others')]
final class ResponseTraitTest extends CIUnitTestCase
{
private ?MockIncomingRequest $request = null;
Expand Down
6 changes: 4 additions & 2 deletions tests/system/AutoReview/ComposerJsonTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,17 @@

namespace CodeIgniter\AutoReview;

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

/**
* @internal
*/
#[\PHPUnit\Framework\Attributes\CoversNothing]
#[\PHPUnit\Framework\Attributes\Group('AutoReview')]
#[CoversNothing]
#[Group('AutoReview')]
final class ComposerJsonTest extends TestCase
{
private array $devComposer;
Expand Down
3 changes: 2 additions & 1 deletion tests/system/AutoReview/FrameworkCodeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

namespace CodeIgniter\AutoReview;

use PHPUnit\Framework\Attributes\DataProvider;
use FilesystemIterator;
use PHPUnit\Framework\Attributes\Group;
use PHPUnit\Framework\TestCase;
Expand Down Expand Up @@ -44,7 +45,7 @@ final class FrameworkCodeTest extends TestCase
/**
* @param class-string $class
*/
#[\PHPUnit\Framework\Attributes\DataProvider('provideEachTestClassHasCorrectGroupAttributeName')]
#[DataProvider('provideEachTestClassHasCorrectGroupAttributeName')]
public function testEachTestClassHasCorrectGroupAttributeName(string $class): void
{
$reflection = new ReflectionClass($class);
Expand Down
9 changes: 6 additions & 3 deletions tests/system/Autoloader/AutoloaderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@

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 @@ -28,7 +31,7 @@
/**
* @internal
*/
#[\PHPUnit\Framework\Attributes\Group('Others')]
#[Group('Others')]
final class AutoloaderTest extends CIUnitTestCase
{
use ReflectionHelper;
Expand Down Expand Up @@ -389,8 +392,8 @@ public function testAutoloaderLoadsNonClassFiles(): void
$loader->unregister();
}

#[\PHPUnit\Framework\Attributes\RunInSeparateProcess]
#[\PHPUnit\Framework\Attributes\PreserveGlobalState(false)]
#[RunInSeparateProcess]
#[PreserveGlobalState(false)]
public function testLoadHelpers(): void
{
// Workaround for errors on PHPUnit 10 and PHP 8.3.
Expand Down
3 changes: 2 additions & 1 deletion tests/system/Autoloader/FileLocatorCachedTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,15 @@

namespace CodeIgniter\Autoloader;

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

/**
* @internal
*/
#[\PHPUnit\Framework\Attributes\Group('Others')]
#[Group('Others')]
final class FileLocatorCachedTest extends FileLocatorTest
{
private FileVarExportHandler $handler;
Expand Down
3 changes: 2 additions & 1 deletion tests/system/Autoloader/FileLocatorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

namespace CodeIgniter\Autoloader;

use PHPUnit\Framework\Attributes\Group;
use CodeIgniter\HTTP\Header;
use CodeIgniter\Test\CIUnitTestCase;
use Config\Autoload;
Expand All @@ -23,7 +24,7 @@
*
* @no-final
*/
#[\PHPUnit\Framework\Attributes\Group('Others')]
#[Group('Others')]
class FileLocatorTest extends CIUnitTestCase
{
protected FileLocatorInterface $locator;
Expand Down
6 changes: 4 additions & 2 deletions tests/system/CLI/CLITest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@

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;
Expand All @@ -22,7 +24,7 @@
/**
* @internal
*/
#[\PHPUnit\Framework\Attributes\Group('Others')]
#[Group('Others')]
final class CLITest extends CIUnitTestCase
{
use StreamFilterTrait;
Expand Down Expand Up @@ -455,7 +457,7 @@ public function testWindow(): void
* @param array $thead
* @param array $expected
*/
#[\PHPUnit\Framework\Attributes\DataProvider('provideTable')]
#[DataProvider('provideTable')]
public function testTable($tbody, $thead, $expected): void
{
CLI::table($tbody, $thead);
Expand Down
3 changes: 2 additions & 1 deletion tests/system/CLI/ConsoleTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

namespace CodeIgniter\CLI;

use PHPUnit\Framework\Attributes\Group;
use CodeIgniter\CodeIgniter;
use CodeIgniter\Config\DotEnv;
use CodeIgniter\Events\Events;
Expand All @@ -24,7 +25,7 @@
/**
* @internal
*/
#[\PHPUnit\Framework\Attributes\Group('Others')]
#[Group('Others')]
final class ConsoleTest extends CIUnitTestCase
{
use StreamFilterTrait;
Expand Down
3 changes: 2 additions & 1 deletion tests/system/Cache/CacheFactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

namespace CodeIgniter\Cache;

use PHPUnit\Framework\Attributes\Group;
use CodeIgniter\Cache\Exceptions\CacheException;
use CodeIgniter\Cache\Handlers\DummyHandler;
use CodeIgniter\Test\CIUnitTestCase;
Expand All @@ -21,7 +22,7 @@
/**
* @internal
*/
#[\PHPUnit\Framework\Attributes\Group('Others')]
#[Group('Others')]
final class CacheFactoryTest extends CIUnitTestCase
{
private static string $directory = 'CacheFactory';
Expand Down
3 changes: 2 additions & 1 deletion tests/system/Cache/CacheMockTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,15 @@

namespace CodeIgniter\Cache;

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

/**
* @internal
*/
#[\PHPUnit\Framework\Attributes\Group('Others')]
#[Group('Others')]
final class CacheMockTest extends CIUnitTestCase
{
public function testMockReturnsMockCacheClass(): void
Expand Down
3 changes: 2 additions & 1 deletion tests/system/Cache/FactoriesCacheFileHandlerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,13 @@

namespace CodeIgniter\Cache;

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

/**
* @internal
*/
#[\PHPUnit\Framework\Attributes\Group('Others')]
#[Group('Others')]
final class FactoriesCacheFileHandlerTest extends FactoriesCacheFileVarExportHandlerTest
{
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

namespace CodeIgniter\Cache;

use PHPUnit\Framework\Attributes\Group;
use CodeIgniter\Cache\FactoriesCache\FileVarExportHandler;
use CodeIgniter\Config\Factories;
use CodeIgniter\Test\CIUnitTestCase;
Expand All @@ -22,7 +23,7 @@
* @internal
* @no-final
*/
#[\PHPUnit\Framework\Attributes\Group('Others')]
#[Group('Others')]
class FactoriesCacheFileVarExportHandlerTest extends CIUnitTestCase
{
protected FactoriesCache $cache;
Expand Down
6 changes: 4 additions & 2 deletions tests/system/Cache/Handlers/BaseHandlerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,22 @@

namespace CodeIgniter\Cache\Handlers;

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

/**
* @internal
*/
#[\PHPUnit\Framework\Attributes\Group('Others')]
#[Group('Others')]
final class BaseHandlerTest extends CIUnitTestCase
{
/**
* @param mixed $input
*/
#[\PHPUnit\Framework\Attributes\DataProvider('provideValidateKeyInvalidType')]
#[DataProvider('provideValidateKeyInvalidType')]
public function testValidateKeyInvalidType($input): void
{
$this->expectException('InvalidArgumentException');
Expand Down
3 changes: 2 additions & 1 deletion tests/system/Cache/Handlers/DummyHandlerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,13 @@

namespace CodeIgniter\Cache\Handlers;

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

/**
* @internal
*/
#[\PHPUnit\Framework\Attributes\Group('Others')]
#[Group('Others')]
final class DummyHandlerTest extends CIUnitTestCase
{
private DummyHandler $handler;
Expand Down
13 changes: 8 additions & 5 deletions tests/system/Cache/Handlers/FileHandlerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@

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;
Expand All @@ -21,7 +24,7 @@
/**
* @internal
*/
#[\PHPUnit\Framework\Attributes\Group('Others')]
#[Group('Others')]
final class FileHandlerTest extends AbstractHandlerTestCase
{
private static string $directory = 'FileHandler';
Expand Down Expand Up @@ -86,7 +89,7 @@ public function testNew(): void
/**
* chmod('path', 0444) does not work on Windows
*/
#[\PHPUnit\Framework\Attributes\RequiresOperatingSystem('Linux|Darwin')]
#[RequiresOperatingSystem('Linux|Darwin')]
public function testNewWithNonWritablePath(): void
{
$this->expectException(CacheException::class);
Expand Down Expand Up @@ -144,7 +147,7 @@ public function testRemember(): void
/**
* chmod('path', 0444) does not work on Windows
*/
#[\PHPUnit\Framework\Attributes\RequiresOperatingSystem('Linux|Darwin')]
#[RequiresOperatingSystem('Linux|Darwin')]
public function testSave(): void
{
$this->assertTrue($this->handler->save(self::$key1, 'value'));
Expand Down Expand Up @@ -306,8 +309,8 @@ public function testIsSupported(): void
$this->assertTrue($this->handler->isSupported());
}

#[\PHPUnit\Framework\Attributes\DataProvider('provideSaveMode')]
#[\PHPUnit\Framework\Attributes\RequiresOperatingSystem('Linux|Darwin')]
#[DataProvider('provideSaveMode')]
#[RequiresOperatingSystem('Linux|Darwin')]
public function testSaveMode(int $int, string $string): void
{
// Initialize mode
Expand Down
3 changes: 2 additions & 1 deletion tests/system/Cache/Handlers/MemcachedHandlerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

namespace CodeIgniter\Cache\Handlers;

use PHPUnit\Framework\Attributes\Group;
use CodeIgniter\CLI\CLI;
use CodeIgniter\I18n\Time;
use Config\Cache;
Expand All @@ -21,7 +22,7 @@
/**
* @internal
*/
#[\PHPUnit\Framework\Attributes\Group('CacheLive')]
#[Group('CacheLive')]
final class MemcachedHandlerTest extends AbstractHandlerTestCase
{
private Cache $config;
Expand Down
3 changes: 2 additions & 1 deletion tests/system/Cache/Handlers/PredisHandlerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,15 @@

namespace CodeIgniter\Cache\Handlers;

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

/**
* @internal
*/
#[\PHPUnit\Framework\Attributes\Group('CacheLive')]
#[Group('CacheLive')]
final class PredisHandlerTest extends AbstractHandlerTestCase
{
private Cache $config;
Expand Down
3 changes: 2 additions & 1 deletion tests/system/Cache/Handlers/RedisHandlerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,15 @@

namespace CodeIgniter\Cache\Handlers;

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

/**
* @internal
*/
#[\PHPUnit\Framework\Attributes\Group('CacheLive')]
#[Group('CacheLive')]
final class RedisHandlerTest extends AbstractHandlerTestCase
{
private Cache $config;
Expand Down
6 changes: 4 additions & 2 deletions tests/system/Cache/ResponseCacheTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@

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 @@ -28,8 +30,8 @@
/**
* @internal
*/
#[\PHPUnit\Framework\Attributes\BackupGlobals(true)]
#[\PHPUnit\Framework\Attributes\Group('Others')]
#[BackupGlobals(true)]
#[Group('Others')]
final class ResponseCacheTest extends CIUnitTestCase
{
private AppConfig $appConfig;
Expand Down
Loading

0 comments on commit dd76daa

Please sign in to comment.