diff --git a/.gitignore b/.gitignore index b227ba3..d4218d0 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,8 @@ /vendor composer.lock phpunit.xml +.phpunit.result.cache +build ## Directory-based project format: .idea/ diff --git a/composer.json b/composer.json index 596c256..758cd66 100644 --- a/composer.json +++ b/composer.json @@ -22,12 +22,13 @@ "require": { "php": "^8.0", "ext-pdo": "*", - "illuminate/support": "^6.0|^7.0|^8.0", - "illuminate/database": "^6.0|^7.0|^8.0" + "illuminate/support": "^8.0|^9.0", + "illuminate/database": "^8.0|^9.0" }, "require-dev": { - "phpunit/phpunit": "^9.3", - "vimeo/psalm": "^3.1" + "phpunit/phpunit": "^9.5", + "vimeo/psalm": "^4.23", + "orchestra/testbench": "^7.0" }, "autoload": { "psr-4": { diff --git a/phpunit.xml.dist b/phpunit.xml.dist index d230cb3..7758fe8 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,38 +1,29 @@ + + + + src/ + + + + + + - tests - - - src/ - - - - - + + - - + + + + + + + diff --git a/src/Connection.php b/src/Connection.php index 6dcd276..e1b734a 100644 --- a/src/Connection.php +++ b/src/Connection.php @@ -31,7 +31,7 @@ protected function getDefaultQueryGrammar () protected function getDefaultSchemaGrammar () { return $this->withTablePrefix( - $this->keyOrDefault('sh', Schema::class) + $this->keyOrDefault('schema', Schema::class) ); } diff --git a/tests/ConnectionTest.php b/tests/ConnectionTest.php new file mode 100644 index 0000000..5876cb8 --- /dev/null +++ b/tests/ConnectionTest.php @@ -0,0 +1,19 @@ +select(config('database.test_select')); + + $this->assertNotNull($result); + } +} diff --git a/tests/TestCase.php b/tests/TestCase.php new file mode 100644 index 0000000..3ef4e02 --- /dev/null +++ b/tests/TestCase.php @@ -0,0 +1,35 @@ +app->make(Repository::class); + + $config->set('database.connections', [ + 'odbc' => [ + 'driver' => 'odbc', + 'dsn' => env('ODBC_DSN'), + 'host' => env('ODBC_HOST'), + 'database' => env('ODBC_DB'), + 'username' => env('ODBC_USERNAME'), + 'password' => env('ODBC_PASSWORD'), + ], + ]); + + $config->set('database.test_select', env('ODBC_TEST_SELECT')); + } + + protected function getPackageProviders ($app): array + { + return [Provider::class]; + } +}