Migrate tests to Pest
This commit is contained in:
36
tests/Unit/ConfigurationTest.php
Normal file
36
tests/Unit/ConfigurationTest.php
Normal file
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
/**
|
||||
* @author Daniel J. Summers <daniel@bitbadger.solutions>
|
||||
* @license MIT
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
use BitBadger\PDODocument\{AutoId, Configuration, DocumentException};
|
||||
|
||||
pest()->group('unit');
|
||||
|
||||
describe('::$idField', function () {
|
||||
test('has expected default value', function () {
|
||||
expect(Configuration::$idField)->toBe('id');
|
||||
});
|
||||
});
|
||||
|
||||
describe('::$autoId', function () {
|
||||
test('has expected default value', function () {
|
||||
expect(Configuration::$autoId)->toBe(AutoId::None);
|
||||
});
|
||||
});
|
||||
|
||||
describe('::$idStringLength', function () {
|
||||
test('has expected default value', function () {
|
||||
expect(Configuration::$idStringLength)->toBe(16);
|
||||
});
|
||||
});
|
||||
|
||||
describe('::dbConn()', function () {
|
||||
test('throws if DSN has not been set', function () {
|
||||
Configuration::useDSN('');
|
||||
expect(fn() => Configuration::dbConn())->toThrow(DocumentException::class);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user