Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[slim-skeleton-11.x] Test Improvements #49111

Merged
merged 6 commits into from
Nov 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/databases.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ jobs:
env:
DB_CONNECTION: mysql
DB_USERNAME: root
MYSQL_COLLATION: utf8mb4_unicode_ci

mysql_8:
runs-on: ubuntu-22.04
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
7 changes: 4 additions & 3 deletions tests/Integration/Database/SchemaBuilderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
]);
}
}
}
4 changes: 3 additions & 1 deletion tests/Integration/Generators/CacheTableCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;',
Expand Down
4 changes: 3 additions & 1 deletion tests/Integration/Generators/QueueFailedTableCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;',
Expand Down
4 changes: 3 additions & 1 deletion tests/Integration/Generators/QueueTableCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;',
Expand Down
4 changes: 3 additions & 1 deletion tests/Integration/Generators/SessionTableCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;',
Expand Down