Change doc list hasItems and items to properties
- Update associated tests
This commit is contained in:
@@ -89,8 +89,8 @@ class RemoveFieldsTest extends TestCase
|
||||
RemoveFields::byContains(ThrowawayDb::TABLE, $criteria, ['value']);
|
||||
$docs = Find::byContains(ThrowawayDb::TABLE, $criteria, TestDocument::class);
|
||||
$this->assertNotNull($docs, 'There should have been a document list returned');
|
||||
$this->assertTrue($docs->hasItems(), 'The document list should not have been empty');
|
||||
foreach ($docs->items() as $item) {
|
||||
$this->assertTrue($docs->hasItems, 'The document list should not have been empty');
|
||||
foreach ($docs->items as $item) {
|
||||
$this->assertContains($item->id, ['two', 'four'], 'An incorrect document was returned');
|
||||
$this->assertEquals('', $item->value, 'The value field was not removed');
|
||||
}
|
||||
@@ -117,8 +117,8 @@ class RemoveFieldsTest extends TestCase
|
||||
RemoveFields::byJsonPath(ThrowawayDb::TABLE, $path, ['sub']);
|
||||
$docs = Find::byJsonPath(ThrowawayDb::TABLE, $path, TestDocument::class);
|
||||
$this->assertNotNull($docs, 'There should have been a document list returned');
|
||||
$this->assertTrue($docs->hasItems(), 'The document list should not have been empty');
|
||||
foreach ($docs->items() as $item) {
|
||||
$this->assertTrue($docs->hasItems, 'The document list should not have been empty');
|
||||
foreach ($docs->items as $item) {
|
||||
$this->assertContains($item->id, ['four', 'five'], 'An incorrect document was returned');
|
||||
$this->assertNull($item->sub, 'The sub field was not removed');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user