Use Option for single doc queries

This commit is contained in:
2024-06-24 22:04:11 -04:00
parent 124426fa12
commit 0c9490e394
14 changed files with 233 additions and 139 deletions

View File

@@ -33,8 +33,8 @@ class PatchTest extends TestCase
{
Patch::byId(ThrowawayDb::TABLE, 'one', ['num_value' => 44]);
$doc = Find::byId(ThrowawayDb::TABLE, 'one', TestDocument::class);
$this->assertNotFalse($doc, 'There should have been a document returned');
$this->assertEquals(44, $doc->num_value, 'The updated document is not correct');
$this->assertTrue($doc->isDefined(), 'There should have been a document returned');
$this->assertEquals(44, $doc->get()->num_value, 'The updated document is not correct');
}
#[TestDox('By ID succeeds when no document is updated')]