Skip to content

Commit

Permalink
support laravel 11
Browse files Browse the repository at this point in the history
  • Loading branch information
recca0120 committed Mar 12, 2024
1 parent d8b4bfc commit 552d7fd
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 15 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
strategy:
fail-fast: true
matrix:
php: [ '7.1','7.2', '7.3', '7.4', '8.0', '8.1', '8.2' ]
php: [ '7.1','7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3' ]
stability: [ prefer-stable ]

name: PHP ${{ matrix.php }} - ${{ matrix.stability }}
Expand All @@ -35,4 +35,4 @@ jobs:

- name: Execute tests
continue-on-error: ${{ matrix.php > 8 }}
run: vendor/bin/phpunit --verbose
run: vendor/bin/phpunit
10 changes: 5 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@
"require": {
"ext-pdo": "*",
"doctrine/sql-formatter": "^1.1",
"illuminate/database": "^5.8|^6.0|^7.0|^8.0|^9.0|^10.0"
"illuminate/database": "^5.8|^6.0|^7.0|^8.0|^9.0|^10.0|^11.0"
},
"require-dev": {
"mikey179/vfsstream": "^1.6",
"mockery/mockery": "^1.3",
"orchestra/testbench": "^3.5|^4.1|^5.2|^6.2|^7.0|^8.0",
"phpunit/phpunit": "^5.4|^6.1|^7.0|^8.0|^9.1|^10.0",
"symfony/var-dumper": "^3.2|^4.0|^5.4|^6.0"
"orchestra/testbench": "^3.5|^4.1|^5.2|^6.2|^7.0|^8.0|^9.0",
"phpunit/phpunit": "^5.4|^6.1|^7.0|^8.0|^9.1|^10.0|^11.0",
"symfony/var-dumper": "^3.2|^4.0|^5.4|^6.0|^7.0"
},
"autoload": {
"psr-4": {
Expand All @@ -45,4 +45,4 @@
]
}
}
}
}
2 changes: 1 addition & 1 deletion src/Dumper.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public static function factory(?string $driver = null): self
return new $grammar();
}

public static function format(string $sql, Highlighter $highlighter = null): string
public static function format(string $sql, ?Highlighter $highlighter = null): string
{
return (new SqlFormatter($highlighter))->format($sql);
}
Expand Down
10 changes: 3 additions & 7 deletions tests/EloquentDumperServiceProviderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class EloquentDumperServiceProviderTest extends TestCase
/**
* @dataProvider sqlProvider
*/
public function test_dump_sql(string $grammar, string $excepted, string $exceptedOutput): void
public function test_dump_sql(string $grammar, string $excepted): void
{
ConsoleOutput::setEchoFunction(static function ($sql) {
echo $sql;
Expand All @@ -26,8 +26,8 @@ public function test_dump_sql(string $grammar, string $excepted, string $excepte
$sql = $query->toRawSql();
$dumpSql = $this->dumpSql($query);

self::assertEquals($excepted, $sql);
self::assertEquals($excepted, $dumpSql);
self::assertStringContainsStringIgnoringCase($excepted, $sql);
self::assertStringContainsStringIgnoringCase($excepted, $dumpSql);
}

/**
Expand All @@ -48,19 +48,15 @@ public static function sqlProvider(): array
[
'mysql',
'select * from `users` where `name` = \'foo\' and `password` = \'bar\'',
'select * from `users` where `name` = \'foo\' and `password` = \'bar\'',
], [
'sqlite',
'select * from "users" where "name" = \'foo\' and "password" = \'bar\'',
'select * from "users" where "name" = \'foo\' and "password" = \'bar\'',
], [
'pgsql',
'select * from "users" where "name" = \'foo\' and "password" = \'bar\'',
'select * from "users" where "name" = \'foo\' and "password" = \'bar\'',
], [
'sqlsrv',
'select * from [users] where [name] = \'foo\' and [password] = \'bar\'',
'select * from [users] where [name] = \'foo\' and [password] = \'bar\'',
],
];
}
Expand Down

0 comments on commit 552d7fd

Please sign in to comment.