From 588e12dc569cfb22548bd722888ec0a23f06b407 Mon Sep 17 00:00:00 2001 From: Mior Muhammad Zaki Date: Fri, 24 Nov 2023 11:24:53 +0800 Subject: [PATCH 1/5] Test Improvements Signed-off-by: Mior Muhammad Zaki --- composer.json | 2 +- tests/Integration/Generators/CacheTableCommandTest.php | 4 +++- tests/Integration/Generators/NotificationTableCommandTest.php | 4 +++- tests/Integration/Generators/QueueBatchesTableCommandTest.php | 4 +++- tests/Integration/Generators/QueueFailedTableCommandTest.php | 4 +++- tests/Integration/Generators/QueueTableCommandTest.php | 4 +++- tests/Integration/Generators/SessionTableCommandTest.php | 4 +++- 7 files changed, 19 insertions(+), 7 deletions(-) diff --git a/composer.json b/composer.json index 439d904e1aa3..a0b7ac8a0e7d 100644 --- a/composer.json +++ b/composer.json @@ -105,7 +105,7 @@ "league/flysystem-sftp-v3": "^3.0", "mockery/mockery": "^1.5.1", "nyholm/psr7": "^1.2", - "orchestra/testbench-core": "^9.0", + "orchestra/testbench-core": "dev-next/slim-skeleton", "pda/pheanstalk": "^4.0", "phpstan/phpstan": "^1.4.7", "phpunit/phpunit": "^10.1", diff --git a/tests/Integration/Generators/CacheTableCommandTest.php b/tests/Integration/Generators/CacheTableCommandTest.php index a02c35dc845b..403061605974 100644 --- a/tests/Integration/Generators/CacheTableCommandTest.php +++ b/tests/Integration/Generators/CacheTableCommandTest.php @@ -2,11 +2,13 @@ namespace Illuminate\Tests\Integration\Generators; +use Illuminate\Cache\Console\CacheTableCommand; + class CacheTableCommandTest extends TestCase { public function testCreateMakesMigration() { - $this->artisan('cache:table')->assertExitCode(0); + $this->artisan(CacheTableCommand::class)->assertExitCode(0); $this->assertMigrationFileContains([ 'use Illuminate\Database\Migrations\Migration;', diff --git a/tests/Integration/Generators/NotificationTableCommandTest.php b/tests/Integration/Generators/NotificationTableCommandTest.php index cf956e495c78..334a6612c760 100644 --- a/tests/Integration/Generators/NotificationTableCommandTest.php +++ b/tests/Integration/Generators/NotificationTableCommandTest.php @@ -2,11 +2,13 @@ namespace Illuminate\Tests\Integration\Generators; +use Illuminate\Notifications\Console\NotificationTableCommand; + class NotificationTableCommandTest extends TestCase { public function testCreateMakesMigration() { - $this->artisan('notifications:table')->assertExitCode(0); + $this->artisan(NotificationTableCommand::class)->assertExitCode(0); $this->assertMigrationFileContains([ 'use Illuminate\Database\Migrations\Migration;', diff --git a/tests/Integration/Generators/QueueBatchesTableCommandTest.php b/tests/Integration/Generators/QueueBatchesTableCommandTest.php index d9356fc9304c..4afb4612c03e 100644 --- a/tests/Integration/Generators/QueueBatchesTableCommandTest.php +++ b/tests/Integration/Generators/QueueBatchesTableCommandTest.php @@ -2,11 +2,13 @@ namespace Illuminate\Tests\Integration\Generators; +use Illuminate\Queue\Console\BatchesTableCommand; + class QueueBatchesTableCommandTest extends TestCase { public function testCreateMakesMigration() { - $this->artisan('queue:batches-table')->assertExitCode(0); + $this->artisan(BatchesTableCommand::class)->assertExitCode(0); $this->assertMigrationFileContains([ 'use Illuminate\Database\Migrations\Migration;', diff --git a/tests/Integration/Generators/QueueFailedTableCommandTest.php b/tests/Integration/Generators/QueueFailedTableCommandTest.php index dd1a1d40b7c7..c996da1d834a 100644 --- a/tests/Integration/Generators/QueueFailedTableCommandTest.php +++ b/tests/Integration/Generators/QueueFailedTableCommandTest.php @@ -2,11 +2,13 @@ namespace Illuminate\Tests\Integration\Generators; +use Illuminate\Queue\Console\FailedTableCommand; + class QueueFailedTableCommandTest extends TestCase { public function testCreateMakesMigration() { - $this->artisan('queue:failed-table')->assertExitCode(0); + $this->artisan(FailedTableCommand::class)->assertExitCode(0); $this->assertMigrationFileContains([ 'use Illuminate\Database\Migrations\Migration;', diff --git a/tests/Integration/Generators/QueueTableCommandTest.php b/tests/Integration/Generators/QueueTableCommandTest.php index d70b81ea48ea..ec1b953f16f4 100644 --- a/tests/Integration/Generators/QueueTableCommandTest.php +++ b/tests/Integration/Generators/QueueTableCommandTest.php @@ -2,11 +2,13 @@ namespace Illuminate\Tests\Integration\Generators; +use Illuminate\Queue\Console\TableCommand; + class QueueTableCommandTest extends TestCase { public function testCreateMakesMigration() { - $this->artisan('queue:table')->assertExitCode(0); + $this->artisan(TableCommand::class)->assertExitCode(0); $this->assertMigrationFileContains([ 'use Illuminate\Database\Migrations\Migration;', diff --git a/tests/Integration/Generators/SessionTableCommandTest.php b/tests/Integration/Generators/SessionTableCommandTest.php index cb491893e376..0fc60230cbcf 100644 --- a/tests/Integration/Generators/SessionTableCommandTest.php +++ b/tests/Integration/Generators/SessionTableCommandTest.php @@ -2,11 +2,13 @@ namespace Illuminate\Tests\Integration\Generators; +use Illuminate\Session\Console\SessionTableCommand; + class SessionTableCommandTest extends TestCase { public function testCreateMakesMigration() { - $this->artisan('session:table')->assertExitCode(0); + $this->artisan(SessionTableCommand::class)->assertExitCode(0); $this->assertMigrationFileContains([ 'use Illuminate\Database\Migrations\Migration;', From 69c66d1e7f8fdfb83d890a58f5694faa4e67bd28 Mon Sep 17 00:00:00 2001 From: Julius Kiekbusch Date: Fri, 24 Nov 2023 09:19:34 +0100 Subject: [PATCH 2/5] Fix MariaDB Tests with changed query --- tests/Integration/Database/SchemaBuilderTest.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/Integration/Database/SchemaBuilderTest.php b/tests/Integration/Database/SchemaBuilderTest.php index 0a13f5812b18..f736f493a916 100644 --- a/tests/Integration/Database/SchemaBuilderTest.php +++ b/tests/Integration/Database/SchemaBuilderTest.php @@ -132,9 +132,10 @@ public function testChangeTextColumnToTextColumn() $uppercase = strtoupper($type); - $expected = ["ALTER TABLE test CHANGE test_column test_column $uppercase NOT NULL"]; - - $this->assertEquals($expected, $queries); + $this->assertContains($queries, [ + ["ALTER TABLE test CHANGE test_column test_column $uppercase NOT NULL"], // MySQL + ["ALTER TABLE test CHANGE test_column test_column $uppercase NOT NULL COLLATE `utf8mb4_uca1400_ai_ci`"], // MariaDB + ]); } } } From ac05660c7e93ecaa3be60f3229e539c4671c4d9f Mon Sep 17 00:00:00 2001 From: Julius Kiekbusch Date: Fri, 24 Nov 2023 09:26:53 +0100 Subject: [PATCH 3/5] Fix Testbench version --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 439d904e1aa3..a0b7ac8a0e7d 100644 --- a/composer.json +++ b/composer.json @@ -105,7 +105,7 @@ "league/flysystem-sftp-v3": "^3.0", "mockery/mockery": "^1.5.1", "nyholm/psr7": "^1.2", - "orchestra/testbench-core": "^9.0", + "orchestra/testbench-core": "dev-next/slim-skeleton", "pda/pheanstalk": "^4.0", "phpstan/phpstan": "^1.4.7", "phpunit/phpunit": "^10.1", From 5857d28986c53bb9e93ca38b488ad347c57fe8bd Mon Sep 17 00:00:00 2001 From: Mior Muhammad Zaki Date: Fri, 24 Nov 2023 16:53:14 +0800 Subject: [PATCH 4/5] Allow to override collation using DB_COLLATION Signed-off-by: Mior Muhammad Zaki --- .github/workflows/databases.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/databases.yml b/.github/workflows/databases.yml index 2d31da69b8f9..86f899214b5e 100644 --- a/.github/workflows/databases.yml +++ b/.github/workflows/databases.yml @@ -52,6 +52,7 @@ jobs: env: DB_CONNECTION: mysql DB_USERNAME: root + DB_COLLATION: utf8mb4_unicode_ci mysql_8: runs-on: ubuntu-22.04 From dba69d5de8e138d35b8c34c51b6b05857728eef0 Mon Sep 17 00:00:00 2001 From: Mior Muhammad Zaki Date: Fri, 24 Nov 2023 16:59:21 +0800 Subject: [PATCH 5/5] wip Signed-off-by: Mior Muhammad Zaki --- .github/workflows/databases.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/databases.yml b/.github/workflows/databases.yml index 86f899214b5e..06040a997ab2 100644 --- a/.github/workflows/databases.yml +++ b/.github/workflows/databases.yml @@ -52,7 +52,7 @@ jobs: env: DB_CONNECTION: mysql DB_USERNAME: root - DB_COLLATION: utf8mb4_unicode_ci + MYSQL_COLLATION: utf8mb4_unicode_ci mysql_8: runs-on: ubuntu-22.04