Add in/inArray; expand Field ctr func names

This commit is contained in:
2024-09-20 20:29:47 -04:00
parent 0a188a80c2
commit e830b1ac3e
28 changed files with 466 additions and 299 deletions

View File

@@ -18,57 +18,69 @@ use PHPUnit\Framework\TestCase;
#[TestDox('Op (Unit tests)')]
class OpTest extends TestCase
{
#[TestDox('To SQL succeeds for EQ')]
public function testToSQLSucceedsForEQ(): void
#[TestDox('To SQL succeeds for Equal')]
public function testToSQLSucceedsForEqual(): void
{
$this->assertEquals('=', Op::EQ->toSQL(), 'EQ operator incorrect');
$this->assertEquals('=', Op::Equal->toSQL(), 'Equal SQL operator incorrect');
}
#[TestDox('To SQL succeeds for GT')]
public function testToSQLSucceedsForGT(): void
#[TestDox('To SQL succeeds for Greater')]
public function testToSQLSucceedsForGreater(): void
{
$this->assertEquals('>', Op::GT->toSQL(), 'GT operator incorrect');
$this->assertEquals('>', Op::Greater->toSQL(), 'Greater SQL operator incorrect');
}
#[TestDox('To SQL succeeds for GE')]
public function testToSQLSucceedsForGE(): void
#[TestDox('To SQL succeeds for GreaterOrEqual')]
public function testToSQLSucceedsForGreaterOrEqual(): void
{
$this->assertEquals('>=', Op::GE->toSQL(), 'GE operator incorrect');
$this->assertEquals('>=', Op::GreaterOrEqual->toSQL(), 'GreaterOrEqual SQL operator incorrect');
}
#[TestDox('To SQL succeeds for LT')]
public function testToSQLSucceedsForLT(): void
#[TestDox('To SQL succeeds for Less')]
public function testToSQLSucceedsForLess(): void
{
$this->assertEquals('<', Op::LT->toSQL(), 'LT operator incorrect');
$this->assertEquals('<', Op::Less->toSQL(), 'Less SQL operator incorrect');
}
#[TestDox('To SQL succeeds for LE')]
public function testToSQLSucceedsForLE(): void
#[TestDox('To SQL succeeds for LessOrEqual')]
public function testToSQLSucceedsForLessOrEqual(): void
{
$this->assertEquals('<=', Op::LE->toSQL(), 'LE operator incorrect');
$this->assertEquals('<=', Op::LessOrEqual->toSQL(), 'LessOrEqual SQL operator incorrect');
}
#[TestDox('To SQL succeeds for NE')]
public function testToSQLSucceedsForNE(): void
#[TestDox('To SQL succeeds for NotEqual')]
public function testToSQLSucceedsForNotEqual(): void
{
$this->assertEquals('<>', Op::NE->toSQL(), 'NE operator incorrect');
$this->assertEquals('<>', Op::NotEqual->toSQL(), 'NotEqual SQL operator incorrect');
}
#[TestDox('To SQL succeeds for BT')]
public function testToSQLSucceedsForBT(): void
#[TestDox('To SQL succeeds for Between')]
public function testToSQLSucceedsForBetween(): void
{
$this->assertEquals('BETWEEN', Op::BT->toSQL(), 'BT operator incorrect');
$this->assertEquals('BETWEEN', Op::Between->toSQL(), 'Between SQL operator incorrect');
}
#[TestDox('To SQL succeeds for EX')]
public function testToSQLSucceedsForEX(): void
#[TestDox('To SQL succeeds for In')]
public function testToSQLSucceedsForIn(): void
{
$this->assertEquals('IS NOT NULL', Op::EX->toSQL(), 'EX operator incorrect');
$this->assertEquals('IN', Op::In->toSQL(), 'In SQL operator incorrect');
}
#[TestDox('To SQL succeeds for NEX')]
#[TestDox('To SQL succeeds for InArray')]
public function testToSQLSucceedsForInArray(): void
{
$this->assertEquals('?|', Op::InArray->toSQL(), 'InArray SQL operator incorrect');
}
#[TestDox('To SQL succeeds for Exists')]
public function testToSQLSucceedsForExists(): void
{
$this->assertEquals('IS NOT NULL', Op::Exists->toSQL(), 'Exists SQL operator incorrect');
}
#[TestDox('To SQL succeeds for NotExists')]
public function testToSQLSucceedsForNEX(): void
{
$this->assertEquals('IS NULL', Op::NEX->toSQL(), 'NEX operator incorrect');
$this->assertEquals('IS NULL', Op::NotExists->toSQL(), 'NotExists SQL operator incorrect');
}
}