Skip to content

Commit

Permalink
Merge pull request #5 from colopl/feature/laravel-11
Browse files Browse the repository at this point in the history
feat: Laravel 11 Support
  • Loading branch information
taka-oyama authored Mar 19, 2024
2 parents 68a5531 + 9c069b9 commit b50630d
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 12 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# v3.1.0 (2024-03-15)

Added
- Laravel 11 Support (#5)
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@
"php": ">=8",
"ext-json": "*",
"ext-pdo": "*",
"laravel/framework": "~8|~9|~10"
"laravel/framework": "~10|~11"
},
"require-dev": {
"orchestra/testbench": "~6|~7|~8",
"phpunit/phpunit": "~10"
"orchestra/testbench": "~8|~9",
"phpunit/phpunit": "~11"
},
"autoload": {
"psr-4": {
Expand Down
3 changes: 0 additions & 3 deletions tests/Schema/BlueprintTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,6 @@ public function testDropColumn()
self::assertNotContains('num', $columns);
}

/**
* @group test
*/
public function testCreateTableWithIndex()
{
$conn = $this->getConnection();
Expand Down
10 changes: 4 additions & 6 deletions tests/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
use Colopl\TiDB\Schema\Blueprint;
use Colopl\TiDB\TiDBServiceProvider;
use Illuminate\Database\Connectors\MySqlConnector;
use Illuminate\Support\Str;

class TestCase extends \Orchestra\Testbench\TestCase
{
Expand All @@ -30,17 +29,16 @@ class TestCase extends \Orchestra\Testbench\TestCase
protected function tearDown(): void
{
$this->cleanupDatabaseRecords();
parent::tearDown();
}

protected function cleanupDatabaseRecords()
{
/** @var Connection $conn */
foreach ($this->app['db']->getConnections() as $conn) {
$tables = $conn->getSchemaBuilder()->getAllTables()[0];
foreach ($tables as $key => $table) {
if (Str::startsWith($key, 'Tables_in_')) {
$conn->query()->from($table)->delete();
}
$tables = $conn->getSchemaBuilder()->getTables();
foreach ($tables as $table) {
$conn->query()->from($table['name'])->delete();
}
}
}
Expand Down

0 comments on commit b50630d

Please sign in to comment.