Finish tests
- Add sub-doc handling for SQLite fields - Add casting for PostgreSQL BT on numeric value - Add hasItems() to DocumentList - Fix SQL syntax problems exposed by tests
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
|
||||
namespace Test\Unit\Query;
|
||||
|
||||
use BitBadger\PDODocument\Field;
|
||||
use BitBadger\PDODocument\{Configuration, Field, Mode};
|
||||
use BitBadger\PDODocument\Query\Count;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
@@ -20,7 +20,12 @@ class CountTest extends TestCase
|
||||
|
||||
public function testByFieldsSucceeds()
|
||||
{
|
||||
$this->assertEquals("SELECT COUNT(*) FROM somewhere WHERE data->>'errors' > :errors",
|
||||
Count::byFields('somewhere', [Field::GT('errors', 10, ':errors')]));
|
||||
Configuration::$mode = Mode::SQLite;
|
||||
try {
|
||||
$this->assertEquals("SELECT COUNT(*) FROM somewhere WHERE data->>'errors' > :errors",
|
||||
Count::byFields('somewhere', [Field::GT('errors', 10, ':errors')]));
|
||||
} finally {
|
||||
Configuration::$mode = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user