Change doc list hasItems and items to properties

- Update associated tests
This commit is contained in:
2024-10-01 18:39:57 -04:00
parent 4b29345dc7
commit bf04ddfd72
11 changed files with 110 additions and 95 deletions

View File

@@ -96,8 +96,8 @@ class PatchTest extends TestCase
Patch::byJsonPath(ThrowawayDb::TABLE, '$.num_value ? (@ > 10)', ['value' => 'blue']);
$docs = Find::byJsonPath(ThrowawayDb::TABLE, '$.num_value ? (@ > 10)', TestDocument::class);
$this->assertNotNull($docs, 'There should have been a document list returned');
$this->assertTrue($docs->hasItems(), 'The document list should not be empty');
foreach ($docs->items() as $item) {
$this->assertTrue($docs->hasItems, 'The document list should not be empty');
foreach ($docs->items as $item) {
$this->assertContains($item->id, ['four', 'five'], 'An incorrect document was returned');
$this->assertEquals('blue', $item->value, 'The document was not patched');
}