diff --git a/rector.php b/rector.php index 4410fb2f9464..a50a2b90addb 100644 --- a/rector.php +++ b/rector.php @@ -80,13 +80,16 @@ __DIR__ . '/system/ThirdParty', __DIR__ . '/tests/system/Config/fixtures', __DIR__ . '/tests/system/Filters/fixtures', - __DIR__ . '/tests/_support', + __DIR__ . '/tests/_support/Commands/Foobar.php', + __DIR__ . '/tests/_support/View', + JsonThrowOnErrorRector::class, YieldDataProviderRector::class, RemoveUnusedPrivateMethodRector::class => [ // private method called via getPrivateMethodInvoker __DIR__ . '/tests/system/Test/ReflectionHelperTest.php', + __DIR__ . '/tests/_support/Test/TestForReflectionHelper.php', ], RemoveUnusedConstructorParamRector::class => [ diff --git a/tests/_support/Config/Filters.php b/tests/_support/Config/Filters.php index af6170c9568f..f3960544f294 100644 --- a/tests/_support/Config/Filters.php +++ b/tests/_support/Config/Filters.php @@ -13,8 +13,11 @@ namespace Tests\Support\Config\Filters; +use Tests\Support\Filters\Customfilter; +use Tests\Support\Filters\RedirectFilter; + /** * @psalm-suppress UndefinedGlobalVariable */ -$filters->aliases['test-customfilter'] = \Tests\Support\Filters\Customfilter::class; -$filters->aliases['test-redirectfilter'] = \Tests\Support\Filters\RedirectFilter::class; +$filters->aliases['test-customfilter'] = Customfilter::class; +$filters->aliases['test-redirectfilter'] = RedirectFilter::class; diff --git a/tests/_support/Config/Registrar.php b/tests/_support/Config/Registrar.php index d2d6a0b0bc3a..8889021a2d00 100644 --- a/tests/_support/Config/Registrar.php +++ b/tests/_support/Config/Registrar.php @@ -134,10 +134,8 @@ public static function Database() // Under GitHub Actions, we can set an ENV var named 'DB' // so that we can test against multiple databases. - if ($group = getenv('DB')) { - if (! empty(self::$dbConfig[$group])) { - $config['tests'] = self::$dbConfig[$group]; - } + if (($group = getenv('DB')) && ! empty(self::$dbConfig[$group])) { + $config['tests'] = self::$dbConfig[$group]; } return $config; diff --git a/tests/_support/Database/Migrations/20160428212500_Create_test_tables.php b/tests/_support/Database/Migrations/20160428212500_Create_test_tables.php index 78262afbe0fa..7a57d0cbd0cc 100644 --- a/tests/_support/Database/Migrations/20160428212500_Create_test_tables.php +++ b/tests/_support/Database/Migrations/20160428212500_Create_test_tables.php @@ -51,7 +51,7 @@ public function up(): void // missing types : // TINYINT,MEDIUMINT,BIT,YEAR,BINARY , VARBINARY, TINYTEXT,LONGTEXT,YEAR,JSON,Spatial data types // id must be interger else SQLite3 error on not null for autoinc field - $data_type_fields = [ + $dataTypeFields = [ 'id' => ['type' => 'INTEGER', 'constraint' => 20, 'auto_increment' => true], 'type_varchar' => ['type' => 'VARCHAR', 'constraint' => 40, 'null' => true], 'type_char' => ['type' => 'CHAR', 'constraint' => 10, 'null' => true], @@ -77,26 +77,26 @@ public function up(): void if ($this->db->DBDriver === 'Postgre') { unset( - $data_type_fields['type_real'], - $data_type_fields['type_decimal'] + $dataTypeFields['type_real'], + $dataTypeFields['type_decimal'] ); } if ($this->db->DBDriver === 'SQLSRV') { - unset($data_type_fields['type_timestamp']); + unset($dataTypeFields['type_timestamp']); } if ($this->db->DBDriver === 'Postgre' || $this->db->DBDriver === 'SQLSRV') { unset( - $data_type_fields['type_enum'], - $data_type_fields['type_set'], - $data_type_fields['type_mediumtext'], - $data_type_fields['type_double'], - $data_type_fields['type_blob'] + $dataTypeFields['type_enum'], + $dataTypeFields['type_set'], + $dataTypeFields['type_mediumtext'], + $dataTypeFields['type_double'], + $dataTypeFields['type_blob'] ); } - $this->forge->addField($data_type_fields)->addKey('id', true)->createTable('type_test', true); + $this->forge->addField($dataTypeFields)->addKey('id', true)->createTable('type_test', true); // Empty Table $this->forge->addField([ diff --git a/tests/_support/Database/Seeds/CITestSeeder.php b/tests/_support/Database/Seeds/CITestSeeder.php index cf1c459f8e6e..8811138ad275 100644 --- a/tests/_support/Database/Seeds/CITestSeeder.php +++ b/tests/_support/Database/Seeds/CITestSeeder.php @@ -107,7 +107,7 @@ public function run(): void 'type_time' => '2020-07-18T15:22:00.000+02:00', 'type_datetime' => '2020-06-18T05:12:24.000+02:00', 'type_timestamp' => '2019-07-18T21:53:21.000+02:00', - 'type_bigint' => 2342342, + 'type_bigint' => 2_342_342, 'type_boolean' => 1, ], ], @@ -178,11 +178,11 @@ public function run(): void unset($data['type_test'][0]['type_blob']); } - foreach ($data as $table => $dummy_data) { + foreach ($data as $table => $dummyData) { $this->db->table($table)->truncate(); - foreach ($dummy_data as $single_dummy_data) { - $this->db->table($table)->insert($single_dummy_data); + foreach ($dummyData as $singleDummyData) { + $this->db->table($table)->insert($singleDummyData); } } } diff --git a/tests/_support/Entity/Cast/CastBinaryUUID.php b/tests/_support/Entity/Cast/CastBinaryUUID.php index ddf5a80c202f..230f3a31eaf0 100644 --- a/tests/_support/Entity/Cast/CastBinaryUUID.php +++ b/tests/_support/Entity/Cast/CastBinaryUUID.php @@ -1,5 +1,7 @@