Skip to content

Commit f0111bf

Browse files
crynoboneJubeki
andauthored
[slim-skeleton-11.x] Test Improvements (#49111)
* Test Improvements Signed-off-by: Mior Muhammad Zaki <crynobone@gmail.com> * Fix MariaDB Tests with changed query * Fix Testbench version * Allow to override collation using DB_COLLATION Signed-off-by: Mior Muhammad Zaki <crynobone@gmail.com> * wip Signed-off-by: Mior Muhammad Zaki <crynobone@gmail.com> --------- Signed-off-by: Mior Muhammad Zaki <crynobone@gmail.com> Co-authored-by: Julius Kiekbusch <contact@julius-kiekbusch.de>
1 parent a71e14b commit f0111bf

9 files changed

+24
-10
lines changed

.github/workflows/databases.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ jobs:
5252
env:
5353
DB_CONNECTION: mysql
5454
DB_USERNAME: root
55+
MYSQL_COLLATION: utf8mb4_unicode_ci
5556

5657
mysql_8:
5758
runs-on: ubuntu-22.04

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@
105105
"league/flysystem-sftp-v3": "^3.0",
106106
"mockery/mockery": "^1.5.1",
107107
"nyholm/psr7": "^1.2",
108-
"orchestra/testbench-core": "^9.0",
108+
"orchestra/testbench-core": "dev-next/slim-skeleton",
109109
"pda/pheanstalk": "^4.0",
110110
"phpstan/phpstan": "^1.4.7",
111111
"phpunit/phpunit": "^10.1",

tests/Integration/Database/SchemaBuilderTest.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -132,9 +132,10 @@ public function testChangeTextColumnToTextColumn()
132132

133133
$uppercase = strtoupper($type);
134134

135-
$expected = ["ALTER TABLE test CHANGE test_column test_column $uppercase NOT NULL"];
136-
137-
$this->assertEquals($expected, $queries);
135+
$this->assertContains($queries, [
136+
["ALTER TABLE test CHANGE test_column test_column $uppercase NOT NULL"], // MySQL
137+
["ALTER TABLE test CHANGE test_column test_column $uppercase NOT NULL COLLATE `utf8mb4_uca1400_ai_ci`"], // MariaDB
138+
]);
138139
}
139140
}
140141
}

tests/Integration/Generators/CacheTableCommandTest.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,13 @@
22

33
namespace Illuminate\Tests\Integration\Generators;
44

5+
use Illuminate\Cache\Console\CacheTableCommand;
6+
57
class CacheTableCommandTest extends TestCase
68
{
79
public function testCreateMakesMigration()
810
{
9-
$this->artisan('cache:table')->assertExitCode(0);
11+
$this->artisan(CacheTableCommand::class)->assertExitCode(0);
1012

1113
$this->assertMigrationFileContains([
1214
'use Illuminate\Database\Migrations\Migration;',

tests/Integration/Generators/NotificationTableCommandTest.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,13 @@
22

33
namespace Illuminate\Tests\Integration\Generators;
44

5+
use Illuminate\Notifications\Console\NotificationTableCommand;
6+
57
class NotificationTableCommandTest extends TestCase
68
{
79
public function testCreateMakesMigration()
810
{
9-
$this->artisan('notifications:table')->assertExitCode(0);
11+
$this->artisan(NotificationTableCommand::class)->assertExitCode(0);
1012

1113
$this->assertMigrationFileContains([
1214
'use Illuminate\Database\Migrations\Migration;',

tests/Integration/Generators/QueueBatchesTableCommandTest.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,13 @@
22

33
namespace Illuminate\Tests\Integration\Generators;
44

5+
use Illuminate\Queue\Console\BatchesTableCommand;
6+
57
class QueueBatchesTableCommandTest extends TestCase
68
{
79
public function testCreateMakesMigration()
810
{
9-
$this->artisan('queue:batches-table')->assertExitCode(0);
11+
$this->artisan(BatchesTableCommand::class)->assertExitCode(0);
1012

1113
$this->assertMigrationFileContains([
1214
'use Illuminate\Database\Migrations\Migration;',

tests/Integration/Generators/QueueFailedTableCommandTest.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,13 @@
22

33
namespace Illuminate\Tests\Integration\Generators;
44

5+
use Illuminate\Queue\Console\FailedTableCommand;
6+
57
class QueueFailedTableCommandTest extends TestCase
68
{
79
public function testCreateMakesMigration()
810
{
9-
$this->artisan('queue:failed-table')->assertExitCode(0);
11+
$this->artisan(FailedTableCommand::class)->assertExitCode(0);
1012

1113
$this->assertMigrationFileContains([
1214
'use Illuminate\Database\Migrations\Migration;',

tests/Integration/Generators/QueueTableCommandTest.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,13 @@
22

33
namespace Illuminate\Tests\Integration\Generators;
44

5+
use Illuminate\Queue\Console\TableCommand;
6+
57
class QueueTableCommandTest extends TestCase
68
{
79
public function testCreateMakesMigration()
810
{
9-
$this->artisan('queue:table')->assertExitCode(0);
11+
$this->artisan(TableCommand::class)->assertExitCode(0);
1012

1113
$this->assertMigrationFileContains([
1214
'use Illuminate\Database\Migrations\Migration;',

tests/Integration/Generators/SessionTableCommandTest.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,13 @@
22

33
namespace Illuminate\Tests\Integration\Generators;
44

5+
use Illuminate\Session\Console\SessionTableCommand;
6+
57
class SessionTableCommandTest extends TestCase
68
{
79
public function testCreateMakesMigration()
810
{
9-
$this->artisan('session:table')->assertExitCode(0);
11+
$this->artisan(SessionTableCommand::class)->assertExitCode(0);
1012

1113
$this->assertMigrationFileContains([
1214
'use Illuminate\Database\Migrations\Migration;',

0 commit comments

Comments
 (0)