Change param prefix from @ to :

This commit is contained in:
2024-06-04 20:59:24 -04:00
parent 7390ae0f61
commit 3d45bbcabc
13 changed files with 175 additions and 54 deletions

View File

@@ -15,14 +15,14 @@ class FindTest extends TestCase
#[TestDox('By ID succeeds')]
public function testByIdSucceeds(): void
{
$this->assertEquals("SELECT data FROM here WHERE data->>'id' = @id", Find::byId('here'),
$this->assertEquals("SELECT data FROM here WHERE data->>'id' = :id", Find::byId('here'),
'SELECT query not generated correctly');
}
public function testByFieldsSucceeds(): void
{
$this->assertEquals("SELECT data FROM there WHERE data->>'active' = @act OR data->>'locked' = @lock",
Find::byFields('there', [Field::EQ('active', true, '@act'), Field::EQ('locked', true, '@lock')], 'OR'),
$this->assertEquals("SELECT data FROM there WHERE data->>'active' = :act OR data->>'locked' = :lock",
Find::byFields('there', [Field::EQ('active', true, ':act'), Field::EQ('locked', true, ':lock')], 'OR'),
'SELECT query not generated correctly');
}
}