Changes for beta10 (#5)
- Add In/InArray support - Add ORDER BY support for `Find` functions - Update dependencies - Implement fixes identified via static analysis Reviewed-on: #5
This commit was merged in pull request #5.
This commit is contained in:
@@ -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('toSQL() 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('toSQL() 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('toSQL() 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('toSQL() 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('toSQL() 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('toSQL() 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('toSQL() 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('toSQL() 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('toSQL() succeeds for InArray')]
|
||||
public function testToSQLSucceedsForInArray(): void
|
||||
{
|
||||
$this->assertEquals('??|', Op::InArray->toSQL(), 'InArray SQL operator incorrect');
|
||||
}
|
||||
|
||||
#[TestDox('toSQL() succeeds for Exists')]
|
||||
public function testToSQLSucceedsForExists(): void
|
||||
{
|
||||
$this->assertEquals('IS NOT NULL', Op::Exists->toSQL(), 'Exists SQL operator incorrect');
|
||||
}
|
||||
|
||||
#[TestDox('toSQL() 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');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user