Derive mode from DSN function

- Add headers in all files
- Minor field name changes
This commit is contained in:
2024-07-20 21:47:21 -04:00
parent 1a37b009ea
commit d8330d828a
81 changed files with 1053 additions and 551 deletions

View File

@@ -1,4 +1,10 @@
<?php declare(strict_types=1);
<?php
/**
* @author Daniel J. Summers <daniel@bitbadger.solutions>
* @license MIT
*/
declare(strict_types=1);
namespace Test\Unit;
@@ -12,57 +18,57 @@ use PHPUnit\Framework\TestCase;
#[TestDox('Op (Unit tests)')]
class OpTest extends TestCase
{
#[TestDox('To string succeeds for EQ')]
public function testToStringSucceedsForEQ(): void
#[TestDox('To SQL succeeds for EQ')]
public function testToSQLSucceedsForEQ(): void
{
$this->assertEquals('=', Op::EQ->toString(), 'EQ operator incorrect');
$this->assertEquals('=', Op::EQ->toSQL(), 'EQ operator incorrect');
}
#[TestDox('To string succeeds for GT')]
public function testToStringSucceedsForGT(): void
#[TestDox('To SQL succeeds for GT')]
public function testToSQLSucceedsForGT(): void
{
$this->assertEquals('>', Op::GT->toString(), 'GT operator incorrect');
$this->assertEquals('>', Op::GT->toSQL(), 'GT operator incorrect');
}
#[TestDox('To string succeeds for GE')]
public function testToStringSucceedsForGE(): void
#[TestDox('To SQL succeeds for GE')]
public function testToSQLSucceedsForGE(): void
{
$this->assertEquals('>=', Op::GE->toString(), 'GE operator incorrect');
$this->assertEquals('>=', Op::GE->toSQL(), 'GE operator incorrect');
}
#[TestDox('To string succeeds for LT')]
public function testToStringSucceedsForLT(): void
#[TestDox('To SQL succeeds for LT')]
public function testToSQLSucceedsForLT(): void
{
$this->assertEquals('<', Op::LT->toString(), 'LT operator incorrect');
$this->assertEquals('<', Op::LT->toSQL(), 'LT operator incorrect');
}
#[TestDox('To string succeeds for LE')]
public function testToStringSucceedsForLE(): void
#[TestDox('To SQL succeeds for LE')]
public function testToSQLSucceedsForLE(): void
{
$this->assertEquals('<=', Op::LE->toString(), 'LE operator incorrect');
$this->assertEquals('<=', Op::LE->toSQL(), 'LE operator incorrect');
}
#[TestDox('To string succeeds for NE')]
public function testToStringSucceedsForNE(): void
#[TestDox('To SQL succeeds for NE')]
public function testToSQLSucceedsForNE(): void
{
$this->assertEquals('<>', Op::NE->toString(), 'NE operator incorrect');
$this->assertEquals('<>', Op::NE->toSQL(), 'NE operator incorrect');
}
#[TestDox('To string succeeds for BT')]
public function testToStringSucceedsForBT(): void
#[TestDox('To SQL succeeds for BT')]
public function testToSQLSucceedsForBT(): void
{
$this->assertEquals('BETWEEN', Op::BT->toString(), 'BT operator incorrect');
$this->assertEquals('BETWEEN', Op::BT->toSQL(), 'BT operator incorrect');
}
#[TestDox('To string succeeds for EX')]
public function testToStringSucceedsForEX(): void
#[TestDox('To SQL succeeds for EX')]
public function testToSQLSucceedsForEX(): void
{
$this->assertEquals('IS NOT NULL', Op::EX->toString(), 'EX operator incorrect');
$this->assertEquals('IS NOT NULL', Op::EX->toSQL(), 'EX operator incorrect');
}
#[TestDox('To string succeeds for NEX')]
public function testToStringSucceedsForNEX(): void
#[TestDox('To SQL succeeds for NEX')]
public function testToSQLSucceedsForNEX(): void
{
$this->assertEquals('IS NULL', Op::NEX->toString(), 'NEX operator incorrect');
$this->assertEquals('IS NULL', Op::NEX->toSQL(), 'NEX operator incorrect');
}
}