Changes for beta10 (#5)

- Add In/InArray support
- Add ORDER BY support for `Find` functions
- Update dependencies
- Implement fixes identified via static analysis

Reviewed-on: #5
This commit was merged in pull request #5.
This commit is contained in:
2024-09-27 02:15:00 +00:00
parent 9e0e663811
commit d067f8983f
66 changed files with 1728 additions and 664 deletions

View File

@@ -35,6 +35,7 @@ class DocumentListTest extends TestCase
parent::tearDown();
}
#[TestDox('create() succeeds')]
public function testCreateSucceeds(): void
{
$list = DocumentList::create(Query::selectFromTable(ThrowawayDb::TABLE), [],
@@ -43,6 +44,7 @@ class DocumentListTest extends TestCase
$list = null;
}
#[TestDox('items() succeeds')]
public function testItemsSucceeds(): void
{
$list = DocumentList::create(Query::selectFromTable(ThrowawayDb::TABLE), [],
@@ -57,6 +59,7 @@ class DocumentListTest extends TestCase
$this->assertEquals(5, $count, 'There should have been 5 documents returned');
}
#[TestDox('items() fails when already consumed')]
public function testItemsFailsWhenAlreadyConsumed(): void
{
$list = DocumentList::create(Query::selectFromTable(ThrowawayDb::TABLE), [],
@@ -69,6 +72,7 @@ class DocumentListTest extends TestCase
iterator_to_array($list->items());
}
#[TestDox('hasItems() succeeds with empty results')]
public function testHasItemsSucceedsWithEmptyResults(): void
{
$list = DocumentList::create(Query::selectFromTable(ThrowawayDb::TABLE) . " WHERE data->>'num_value' < 0", [],
@@ -77,6 +81,7 @@ class DocumentListTest extends TestCase
$this->assertFalse($list->hasItems(), 'There should be no items in the list');
}
#[TestDox('hasItems() succeeds with non-empty results')]
public function testHasItemsSucceedsWithNonEmptyResults(): void
{
$list = DocumentList::create(Query::selectFromTable(ThrowawayDb::TABLE), [],
@@ -88,6 +93,8 @@ class DocumentListTest extends TestCase
}
$this->assertFalse($list->hasItems(), 'There should be no remaining items in the list');
}
#[TestDox('map() succeeds')]
public function testMapSucceeds(): void
{
$list = DocumentList::create(Query::selectFromTable(ThrowawayDb::TABLE), [],
@@ -100,6 +107,7 @@ class DocumentListTest extends TestCase
}
}
#[TestDox('iter() succeeds')]
public function testIterSucceeds(): void
{
$list = DocumentList::create(Query::selectFromTable(ThrowawayDb::TABLE), [],
@@ -112,6 +120,7 @@ class DocumentListTest extends TestCase
'Iteration did not have the expected result');
}
#[TestDox('mapToArray() succeeds')]
public function testMapToArraySucceeds(): void
{
$list = DocumentList::create(Query::selectFromTable(ThrowawayDb::TABLE), [],