2024-07-21 01:47:21 +00:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* @author Daniel J. Summers <daniel@bitbadger.solutions>
|
|
|
|
* @license MIT
|
|
|
|
*/
|
|
|
|
|
|
|
|
declare(strict_types=1);
|
2024-06-11 11:07:56 +00:00
|
|
|
|
|
|
|
namespace Test\Unit;
|
|
|
|
|
|
|
|
use BitBadger\PDODocument\FieldMatch;
|
2024-06-21 13:46:41 +00:00
|
|
|
use PHPUnit\Framework\Attributes\TestDox;
|
2024-06-11 11:07:56 +00:00
|
|
|
use PHPUnit\Framework\TestCase;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Unit tests for the FieldMatch enum
|
|
|
|
*/
|
2024-06-21 13:46:41 +00:00
|
|
|
#[TestDox('Field Match (Unit tests)')]
|
2024-06-11 11:07:56 +00:00
|
|
|
class FieldMatchTest extends TestCase
|
|
|
|
{
|
2024-09-27 02:15:00 +00:00
|
|
|
#[TestDox('toSQL() succeeds for All')]
|
2024-07-21 01:47:21 +00:00
|
|
|
public function testToSQLSucceedsForAll(): void
|
2024-06-11 11:07:56 +00:00
|
|
|
{
|
2024-07-21 01:47:21 +00:00
|
|
|
$this->assertEquals('AND', FieldMatch::All->toSQL(), 'All should have returned AND');
|
2024-06-11 11:07:56 +00:00
|
|
|
}
|
|
|
|
|
2024-09-27 02:15:00 +00:00
|
|
|
#[TestDox('toSQL() succeeds for Any')]
|
2024-07-21 01:47:21 +00:00
|
|
|
public function testToSQLSucceedsForAny(): void
|
2024-06-11 11:07:56 +00:00
|
|
|
{
|
2024-07-21 01:47:21 +00:00
|
|
|
$this->assertEquals('OR', FieldMatch::Any->toSQL(), 'Any should have returned OR');
|
2024-06-11 11:07:56 +00:00
|
|
|
}
|
|
|
|
}
|