Add classes and tests from common project
This commit is contained in:
28
tests/unit/ConfigurationTest.php
Normal file
28
tests/unit/ConfigurationTest.php
Normal file
@@ -0,0 +1,28 @@
|
||||
<?php declare(strict_types=1);
|
||||
|
||||
namespace Test\Unit;
|
||||
|
||||
use BitBadger\PDODocument\Configuration;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
/**
|
||||
* Unit tests for the Configuration class
|
||||
*/
|
||||
class ConfigurationTest extends TestCase
|
||||
{
|
||||
public function testIdFieldDefaultSucceeds(): void
|
||||
{
|
||||
$this->assertEquals('id', Configuration::idField(), 'Default ID field should be "id"');
|
||||
}
|
||||
|
||||
public function testUseIdFieldSucceeds()
|
||||
{
|
||||
try {
|
||||
Configuration::useIdField('EyeDee');
|
||||
$this->assertEquals('EyeDee', Configuration::idField(), 'ID field should have been updated');
|
||||
} finally {
|
||||
Configuration::useIdField('id');
|
||||
$this->assertEquals('id', Configuration::idField(), 'Default ID value should have been restored');
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user