pdo-document/tests/unit/ConfigurationTest.php

29 lines
799 B
PHP

<?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');
}
}
}