Add byContains and byJsonPath throughout

- Change to JSON Path function to work around PDO syntax quirk
This commit is contained in:
2024-06-13 21:39:16 -04:00
parent 9ecabbe39f
commit 7de39a41fc
26 changed files with 569 additions and 22 deletions

View File

@@ -2,7 +2,7 @@
namespace Test\Integration\SQLite;
use BitBadger\PDODocument\{Count, Field};
use BitBadger\PDODocument\{Count, DocumentException, Field};
use PHPUnit\Framework\Attributes\TestDox;
use PHPUnit\Framework\TestCase;
@@ -44,4 +44,17 @@ class CountTest extends TestCase
$count = Count::byFields(ThrowawayDb::TABLE, [Field::BT('value', 'aardvark', 'apple')]);
$this->assertEquals(1, $count, 'There should have been 1 matching document');
}
public function testByContainsFails(): void
{
$this->expectException(DocumentException::class);
Count::byContains('', []);
}
#[TestDox('By JSON Path fails')]
public function testByJsonPathFails(): void
{
$this->expectException(DocumentException::class);
Count::byJsonPath('', '');
}
}