Migrate tests to Pest
This commit is contained in:
23
tests/Unit/ModeTest.php
Normal file
23
tests/Unit/ModeTest.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
/**
|
||||
* @author Daniel J. Summers <daniel@bitbadger.solutions>
|
||||
* @license MIT
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
use BitBadger\PDODocument\{DocumentException, Mode};
|
||||
|
||||
pest()->group('unit');
|
||||
|
||||
describe('::deriveFromDSN()', function () {
|
||||
test('derives for PostgreSQL', function () {
|
||||
expect(Mode::deriveFromDSN('pgsql:Host=localhost'))->toBe(Mode::PgSQL);
|
||||
})->group('postgresql');
|
||||
test('derives for SQLite', function () {
|
||||
expect(Mode::deriveFromDSN('sqlite:data.db'))->toBe(Mode::SQLite);
|
||||
})->group('sqlite');
|
||||
test('throws for other drivers', function () {
|
||||
expect(fn() => Mode::deriveFromDSN('mysql:Host=localhost'))->toThrow(DocumentException::class);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user