/tests/Integration/PostgreSQL/CountTest.php [x] `::all()` → counts all documents [x] `::byFields()` → counts for numeric range correctly [x] `::byFields()` → counts for non-numeric range correctly [x] `::byContains()` → counts matching documents [x] `::byContains()` → returns 0 for no matching documents [x] `::byJsonPath()` → counts matching documents [x] `::byJsonPath()` → returns 0 for no matching documents /tests/Integration/PostgreSQL/CustomTest.php [x] `::runQuery()` → runs a valid query successfully [x] `::runQuery()` → fails with an invalid query [x] `::list()` → returns non-empty list when data found [x] `::list()` → returns empty list when no data found [x] `::array()` → returns non-empty array when data found [x] `::array()` → returns empty array when no data found [x] `::single()` → returns a document when one is found [x] `::single()` → returns no document when one is not found [x] `::nonQuery()` → works when documents match the WHERE clause [x] `::nonQuery()` → works when no documents match the WHERE clause [x] `::scalar()` → returns a scalar value /tests/Integration/PostgreSQL/DefinitionTest.php [x] `::ensureTable()` → creates a table [x] `::ensureFieldIndex()` → creates an index [x] `::ensureDocumentIndex()` → creates a full index [x] `::ensureDocumentIndex()` → creates an optimized index /tests/Integration/PostgreSQL/DeleteTest.php [x] `::byId()` → deletes a document when ID is matched [x] `::byId()` → does not delete a document when ID is not matched [x] `::byFields()` → deletes documents when fields match [x] `::byFields()` → does not delete documents when fields are not matched [x] `::byContains()` → deletes documents when containment matches [x] `::byContains()` → does not delete documents when containment is not matched [x] `::byJsonPath()` → deletes documents when path matches [x] `::byJsonPath()` → does not delete documents when path is not matched /tests/Integration/PostgreSQL/DocumentListTest.php [x] `::create()` → creates a document list [x] `->items()` → enumerates items in the list [x] `->items()` → fails when the list is exhausted [x] `->hasItems()` → returns false when no items are in the list [x] `->hasItems()` → returns true when items are in the list [x] `->map()` → transforms the list [x] `->iter()` → walks the list [x] `->mapToArray()` → creates an associative array /tests/Integration/PostgreSQL/DocumentTest.php [x] `::insert()` → inserts an array with no automatic ID [x] `::insert()` → inserts an array with auto-number ID, not provided [x] `::insert()` → inserts an array with auto-number ID, provided [x] `::insert()` → inserts an array with auto-UUID ID, not provided [x] `::insert()` → inserts an array with auto-UUID ID, provided [x] `::insert()` → inserts an array with auto-string ID, not provided [x] `::insert()` → inserts an array with auto-string ID, provided [x] `::insert()` → inserts an object with no automatic ID [x] `::insert()` → inserts an object with auto-number ID, not provided [x] `::insert()` → inserts an object with auto-number ID, provided [x] `::insert()` → inserts an object with auto-UUID ID, not provided [x] `::insert()` → inserts an object with auto-UUID ID, provided [x] `::insert()` → inserts an object with auto-string ID, not provided [x] `::insert()` → inserts an object with auto-string ID, provided [x] `::insert()` → throws an exception for duplicate key [x] `::save()` → inserts a new document [x] `::save()` → updates an existing document [x] `::update()` → replaces an existing document [x] `::update()` → does nothing for a non-existent document /tests/Integration/PostgreSQL/ExistsTest.php [x] `::byId()` → returns true when a document exists [x] `::byId()` → returns false when a document does not exist [x] `::byFields()` → returns true when matching documents exist [x] `::byFields()` → returns false when no matching documents exist [x] `::byContains()` → returns true when matching documents exist [x] `::byContains()` → returns false when no matching documents exist [x] `::byJsonPath()` → returns true when matching documents exist [x] `::byJsonPath()` → returns false when no matching documents exist /tests/Integration/PostgreSQL/FindTest.php [x] `::all()` → retrieves data [x] `::all()` → sorts data ascending [x] `::all()` → sorts data descending [x] `::all()` → sorts data numerically [x] `::all()` → retrieves empty results [x] `::byId()` → retrieves a document via string ID [x] `::byId()` → retrieves a document via numeric ID [x] `::byId()` → returns None when a document is not found [x] `::byFields()` → retrieves matching documents [x] `::byFields()` → retrieves ordered matching documents [x] `::byFields()` → retrieves documents matching a numeric IN clause [x] `::byFields()` → returns an empty list when no matching documents are found [x] `::byFields()` → retrieves documents matching an inArray condition [x] `::byFields()` → returns an empty list when no documents match an inArray condition [x] `::byContains()` → retrieves matching documents [x] `::byContains()` → retrieves ordered matching documents [x] `::byContains()` → returns an empty list when no documents match [x] `::byJsonPath()` → retrieves matching documents [x] `::byJsonPath()` → retrieves ordered matching documents [x] `::byJsonPath()` → returns an empty list when no documents match [x] `::firstByFields()` → retrieves a matching document [x] `::firstByFields()` → retrieves a document for multiple results [x] `::firstByFields()` → retrieves a document for multiple ordered results [x] `::firstByFields()` → returns None when no documents match [x] `::firstByContains()` → retrieves a matching document [x] `::firstByContains()` → retrieves a document for multiple results [x] `::firstByContains()` → retrieves a document for multiple ordered results [x] `::firstByContains()` → returns None when no documents match [x] `::firstByJsonPath()` → retrieves a matching document [x] `::firstByJsonPath()` → retrieves a document for multiple results [x] `::firstByJsonPath()` → retrieves a document for multiple ordered results [x] `::firstByJsonPath()` → returns None when no documents match /tests/Integration/PostgreSQL/PatchTest.php [x] `::byId()` → updates an existing document [x] `::byId()` → does nothing when a document does not exist [x] `::byFields()` → updates existing documents [x] `::byFields()` → does nothing when no matching documents exist [x] `::byContains()` → updates existing documents [x] `::byContains()` → does nothing when no matching documents exist [x] `::byJsonPath()` → updates existing documents [x] `::byJsonPath()` → does nothing when no matching documents exist /tests/Integration/PostgreSQL/RemoveFieldsTest.php [x] `::byId()` → removes fields [x] `::byId()` → does nothing when the field to remove does not exist [x] `::byId()` → does nothing when the document does not exist [x] `::byFields()` → removes fields from matching documents [x] `::byFields()` → does nothing when the field to remove does not exist [x] `::byFields()` → does nothing when no documents match [x] `::byContains()` → removes fields from matching documents [x] `::byContains()` → does nothing when the field to remove does not exist [x] `::byContains()` → does nothing when no documents match [x] `::byJsonPath()` → removes fields from matching documents [x] `::byJsonPath()` → does nothing when the field to remove does not exist [x] `::byJsonPath()` → does nothing when no documents match /tests/Integration/SQLite/CountTest.php [x] `::all()` → counts all documents [x] `::byFields()` → counts by numeric range [x] `::byFields()` → counts by non-numeric range [x] `::byContains()` → throws an exception [x] `::byJsonPath()` → throws an exception /tests/Integration/SQLite/CustomTest.php [x] `::runQuery()` → runs a valid query successfully [x] `::runQuery()` → fails with an invalid query [x] `::list()` → returns non-empty list when data is found [x] `::list()` → returns empty list when not data is found [x] `::array()` → returns non-empty array when data is found [x] `::array()` → returns empty array when data is not found [x] `::single()` → returns a document when one is found [x] `::single()` → returns no document when none is found [x] `::nonQuery()` → works when documents match the WHERE clause [x] `::nonQuery()` → works when no documents match the WHERE clause [x] `::scalar()` → returns a scalar value /tests/Integration/SQLite/DefinitionTest.php [x] `::ensureTable()` → creates table and PK index [x] `::ensureFieldIndex()` → creates an index [x] `::ensureDocumentIndex()` → throws an exception /tests/Integration/SQLite/DeleteTest.php [x] `::byId()` → deletes a document when one exists [x] `::byId()` → does nothing when the document does not exist [x] `::byFields()` → deletes matching documents [x] `::byFields()` → does nothing when no documents match [x] `::byContains()` → throws an exception [x] `::byJsonPath()` → throws an exception /tests/Integration/SQLite/DocumentListTest.php [x] `::create()` → creates a document list [x] `->items()` → enumerates items in the list [x] `->items()` → fails when the list is exhausted [x] `->hasItems()` → returns true when items exist [x] `->hasItems()` → returns false when no items exist [x] `->map()` → transforms the list [x] `->iter()` → walks the list [x] `->mapToArray()` → creates an associative array /tests/Integration/SQLite/DocumentTest.php [x] `::insert()` → inserts an array with no automatic ID [x] `::insert()` → inserts an array with auto-number ID, not provided [x] `::insert()` → inserts an array with auto-number ID, provided [x] `::insert()` → inserts an array with auto-UUID ID, not provided [x] `::insert()` → inserts an array with auto-UUID ID, provided [x] `::insert()` → inserts an array with auto-string ID, not provided [x] `::insert()` → inserts an array with auto-string ID, provided [x] `::insert()` → inserts an object with no automatic ID [x] `::insert()` → inserts an object with auto-number ID, not provided [x] `::insert()` → inserts an object with auto-number ID, provided [x] `::insert()` → inserts an object with auto-UUID ID, not provided [x] `::insert()` → inserts an object with auto-UUID ID, provided [x] `::insert()` → inserts an object with auto-string ID, not provided [x] `::insert()` → inserts an object with auto-string ID, provided [x] `::insert()` → throws an exception for duplicate key [x] `::save()` → inserts a new document [x] `::save()` → updates an existing document [x] `::update()` → replaces an existing document [x] `::update()` → does nothing for a non-existent document /tests/Integration/SQLite/ExistsTest.php [x] `::byId()` → returns true when a document exists [x] `::byId()` → returns false when no document exists [x] `::byFields()` → returns true when matching documents exist [x] `::byFields()` → returns false when no matching documents exist [x] `::byContains()` → throws an exception [x] `::byJsonPath()` → throws an exception /tests/Integration/SQLite/FindTest.php [x] `::all()` → retrieves data [x] `::all()` → sorts data ascending [x] `::all()` → sorts data descending [x] `::all()` → sorts data numerically [x] `::all()` → returns an empty list when no data exists [x] `::byId()` → returns a document when it exists [x] `::byId()` → returns a document with a numeric ID [x] `::byId()` → returns None when no document exists [x] `::byFields()` → returns matching documents [x] `::byFields()` → returns ordered matching documents [x] `::byFields()` → returns documents matching numeric IN clause [x] `::byFields()` → returns empty list when no documents match [x] `::byFields()` → returns matching documents for inArray comparison [x] `::byFields()` → returns empty list when no documents match inArray comparison [x] `::byContains()` → throws an exception [x] `::byJsonPath()` → throws an exception [x] `::firstByFields()` → returns a matching document [x] `::firstByFields()` → returns one of several matching documents [x] `::firstByFields()` → returns first of ordered matching documents [x] `::firstByFields()` → returns None when no documents match [x] `::firstByContains()` → throws an exception [x] `::firstByJsonPath()` → throws an exception /tests/Integration/SQLite/PatchTest.php [x] `::byId()` → updates an existing document [x] `::byId()` → does nothing when no document exists [x] `::byFields()` → updates matching documents [x] `::byFields()` → does nothing when no documents match [x] `::byContains()` → throws an exception [x] `::byJsonPath()` → throws an exception /tests/Integration/SQLite/RemoveFieldsTest.php [x] `::byId()` → updates an existing document [x] `::byId()` → does nothing when the field to remove does not exist [x] `::byId()` → does nothing when the document does not exist [x] `::byFields()` → updates matching documents [x] `::byFields()` → does nothing when the field to remove does not exist [x] `::byFields()` → does nothing when no documents match [x] `::byContains()` → throws an exception [x] `::byJsonPath()` → throws an exception /tests/Unit/ConfigurationTest.php [x] `::$idField` → has expected default value [x] `::$autoId` → has expected default value [x] `::$idStringLength` → has expected default value [x] `::dbConn()` → throws if DSN has not been set /tests/Unit/DocumentExceptionTest.php [x] `Constructor` → fills code and prior exception if provided [x] `Constructor` → uses expected code and prior exception if not provided [x] `->__toString()` → excludes code if 0 [x] `->__toString()` → includes code if non-zero /tests/Unit/FieldMatchTest.php [x] `->toSQL()` → returns AND for All [x] `->toSQL()` → returns OR for Any /tests/Unit/FieldTest.php [x] `->appendParameter()` → appends no parameter for exists [x] `->appendParameter()` → appends no parameter for notExists [x] `->appendParameter()` → appends two parameters for between [x] `->appendParameter()` → appends a parameter for each value for in [x] `->appendParameter()` → appends a parameter for each value for inArray [PostgreSQL] [x] `->appendParameter()` → appends a parameter for each value for inArray [SQLite] [x] `->appendParameter()` → appends a parameter for other operators [x] `->path()` → returns simple SQL path [PostgreSQL] [x] `->path()` → returns simple SQL path [SQLite] [x] `->path()` → returns nested SQL path [PostgreSQL] [x] `->path()` → returns nested SQL path [SQLite] [x] `->path()` → returns simple JSON path [PostgreSQL] [x] `->path()` → returns simple JSON path [SQLite] [x] `->path()` → returns nested JSON path [PostgreSQL] [x] `->path()` → returns nested JSON path [SQLite] [x] `->toWhere()` → generates IS NOT NULL for exists w/o qualifier [PostgreSQL] [x] `->toWhere()` → generates IS NOT NULL for exists w/o qualifier [SQLite] [x] `->toWhere()` → generates IS NULL for notExists w/o qualifier [PostgreSQL] [x] `->toWhere()` → generates IS NULL for notExists w/o qualifier [SQLite] [x] `->toWhere()` → generates BETWEEN for between w/o qualifier [SQLite] [x] `->toWhere()` → generates BETWEEN for between w/o qualifier, numeric range [PostgreSQL] [x] `->toWhere()` → generates BETWEEN for between w/o qualifier, non-numeric range [PostgreSQL] [x] `->toWhere()` → generates BETWEEN for between w/ qualifier [SQLite] [x] `->toWhere()` → generates BETWEEN for between w/ qualifier, numeric range [PostgreSQL] [x] `->toWhere()` → generates BETWEEN for between w/ qualifier, non-numeric range [PostgreSQL] [x] `->toWhere()` → generates IN for in, non-numeric values [PostgreSQL] [x] `->toWhere()` → generates IN for in, numeric values [PostgreSQL] [x] `->toWhere()` → generates IN for in [SQLite] [x] `->toWhere()` → generates clause for inArray [PostgreSQL] [x] `->toWhere()` → generates clause for inArray [SQLite] [x] `->toWhere()` → generates clause for other operators w/o qualifier [PostgreSQL] [x] `->toWhere()` → generates clause for other operators w/o qualifier [SQLite] [x] `->toWhere()` → generates no-parameter clause w/ qualifier [PostgreSQL] [x] `->toWhere()` → generates no-parameter clause w/ qualifier [SQLite] [x] `->toWhere()` → generates parameter clause w/ qualifier [PostgreSQL] [x] `->toWhere()` → generates parameter clause w/ qualifier [SQLite] [x] `::equal()` → creates Field w/o parameter [x] `::equal()` → creates Field w/ parameter [x] `::greater()` → creates Field w/o parameter [x] `::greater()` → creates Field w/ parameter [x] `::greaterOrEqual()` → creates Field w/o parameter [x] `::greaterOrEqual()` → creates Field w/ parameter [x] `::less()` → creates Field w/o parameter [x] `::less()` → creates Field w/ parameter [x] `::lessOrEqual()` → creates Field w/o parameter [x] `::lessOrEqual()` → creates Field w/ parameter [x] `::notEqual()` → creates Field w/o parameter [x] `::notEqual()` → creates Field w/ parameter [x] `::between()` → creates Field w/o parameter [x] `::between()` → creates Field w/ parameter [x] `::in()` → creates Field w/o parameter [x] `::in()` → creates Field w/ parameter [x] `::inArray()` → creates Field w/o parameter [x] `::inArray()` → creates Field w/ parameter [x] `::exists()` → creates Field [x] `::notExists()` → creates Field [x] `::named()` → creates Field /tests/Unit/Mapper/ArrayMapperTest.php [x] `->map()` → returns the given array /tests/Unit/Mapper/CountMapperTest.php [x] `->map()` → returns item 0 in the given array /tests/Unit/Mapper/DocumentMapperTest.php [x] `Constructor` → uses "data" as the default field name [x] `Constructor` → uses the provided field name [x] `->map()` → deserializes valid JSON [x] `->map()` → deserializes valid JSON [Pjson] [x] `->map()` → throws for invalid JSON [x] `->map()` → throws for invalid JSON [Pjson] /tests/Unit/Mapper/ExistsMapperTest.php [x] `->map()` → returns a boolean value from index 0 [PostgreSQL] [x] `->map()` → returns a number value as boolean from index 0 [SQLite] [x] `->map()` → throws if mode is not set /tests/Unit/Mapper/StringMapperTest.php [x] `->map()` → returns existing string column value [x] `->map()` → returns string value of non-string column [x] `->map()` → returns null for a missing column /tests/Unit/ModeTest.php [x] `::deriveFromDSN()` → derives for PostgreSQL [x] `::deriveFromDSN()` → derives for SQLite [x] `::deriveFromDSN()` → throws for other drivers /tests/Unit/OpTest.php [x] `->toSQL()` → returns "=" for Equal [x] `->toSQL()` → returns ">" for Greater [x] `->toSQL()` → returns ">=" for GreaterOrEqual [x] `->toSQL()` → returns "<" for Less [x] `->toSQL()` → returns "<=" for LessOrEqual [x] `->toSQL()` → returns "<>" for NotEqual [x] `->toSQL()` → returns "BETWEEN" for Between [x] `->toSQL()` → returns "IN" for In [x] `->toSQL()` → returns "?|" (escaped) for InArray [x] `->toSQL()` → returns "IS NOT NULL" for Exists [x] `->toSQL()` → returns "IS NULL" for NotExists /tests/Unit/ParametersTest.php [x] `::id()` → creates string ID parameter [x] `::id()` → creates string from numeric ID parameter [x] `::json()` → serializes an array [x] `::json()` → serializes an array w/ an empty array value [x] `::json()` → serializes a 1-D array w/ an empty array value [x] `::json()` → serializes a stdClass instance [x] `::json()` → serializes a Pjson class instance [x] `::json()` → serializes an array of Pjson class instances [x] `::nameFields()` → provides missing parameter names [x] `::addFields()` → appends to an existing parameter array [x] `::fieldNames()` → generates names [PostgreSQL] [x] `::fieldNames()` → generates names [SQLite] [x] `::fieldNames()` → throws when mode is not set /tests/Unit/Query/CountTest.php [x] `::all()` → generates the correct SQL [x] `::byFields()` → generates the correct SQL [x] `::byContains()` → generates the correct SQL [PostgreSQL] [x] `::byContains()` → throws an exception [SQLite] [x] `::byJsonPath()` → generates the correct SQL [PostgreSQL] [x] `::byJsonPath()` → throws an exception [SQLite] /tests/Unit/Query/DefinitionTest.php [x] `::ensureTable()` → generates correct SQL [PostgreSQL] [x] `::ensureTable()` → generates correct SQL [SQLite] [x] `::ensureTable()` → throws an exception if mode is not set [x] `::ensureIndexOn()` → generates correct SQL for unqualified table, single ascending field [x] `::ensureIndexOn()` → generates correct SQL for qualified table, multiple fields [x] `::ensureKey()` → generates correct SQL [x] `::ensureDocumentIndexOn()` → generates correct SQL for qualified table, full index [PostgreSQL] [x] `::ensureDocumentIndexOn()` → generates correct SQL for unqualified table, optimized index [PostgreSQL] [x] `::ensureDocumentIndexOn()` → throws an exception [SQLite] /tests/Unit/Query/DeleteTest.php [x] `::byId()` → generates correct SQL [x] `::byFields()` → generates correct SQL [x] `::byContains()` → generates correct SQL [PostgreSQL] [x] `::byContains()` → throws an exception [SQLite] [x] `::byJsonPath()` → generates correct SQL [PostgreSQL] [x] `::byJsonPath()` → throws an exception [SQLite] /tests/Unit/Query/ExistsTest.php [x] `::query()` → generates correct SQL [x] `::byId()` → generates correct SQL [x] `::byFields()` → generates correct SQL [x] `::byContains()` → generates correct SQL [PostgreSQL] [x] `::byContains()` → throws an exception [SQLite] [x] `::byJsonPath()` → generates correct SQL [PostgreSQL] [x] `::byJsonPath()` → throws an exception [SQLite] /tests/Unit/Query/FindTest.php [x] `::byId()` → generates correct SQL [x] `::byFields()` → generates correct SQL [x] `::byContains()` → generates correct SQL [PostgreSQL] [x] `::byContains()` → throws an exception [SQLite] [x] `::byJsonPath()` → generates correct SQL [PostgreSQL] [x] `::byJsonPath()` → throws an exception [SQLite] /tests/Unit/Query/PatchTest.php [x] `::byId()` → generates correct SQL [PostgreSQL] [x] `::byId()` → generates correct SQL [SQLite] [x] `::byId()` → throws an exception [mode not set] [x] `::byFields()` → generates correct SQL [PostgreSQL] [x] `::byFields()` → generates correct SQL [SQLite] [x] `::byFields()` → throws an exception [mode not set] [x] `::byContains()` → generates correct SQL [PostgreSQL] [x] `::byContains()` → throws an exception [SQLite] [x] `::byJsonPath()` → generates correct SQL [PostgreSQL] [x] `::byJsonPath()` → throws an exception [SQLite] /tests/Unit/Query/RemoveFieldsTest.php [x] `::update()` → generates correct SQL [PostgreSQL] [x] `::update()` → generates correct SQL [SQLite] [x] `::update()` → throws an exception [mode not set] [x] `::byId()` → generates correct SQL [PostgreSQL] [x] `::byId()` → generates correct SQL [SQLite] [x] `::byId()` → throws an exception [mode not set] [x] `::byFields()` → generates correct SQL [PostgreSQL] [x] `::byFields()` → generates correct SQL [SQLite] [x] `::byFields()` → throws an exception [mode not set] [x] `::byContains()` → generates correct SQL [PostgreSQL] [x] `::byContains()` → throws an exception [SQLite] [x] `::byJsonPath()` → generates correct SQL [PostgreSQL] [x] `::byJsonPath()` → throws an exception [SQLite] /tests/Unit/QueryTest.php [x] `::selectFromTable()` → correctly forms a query [x] `::whereByFields()` → generates a single field correctly [x] `::whereByFields()` → generates all fields correctly [x] `::whereByFields()` → generates any field correctly [x] `::whereById()` → uses default parameter name [x] `::whereById()` → uses provided parameter name [x] `::whereDataContains()` → uses default parameter [PostgreSQL] [x] `::whereDataContains()` → uses provided parameter [PostgreSQL] [x] `::whereDataContains()` → throws [SQLite] [x] `::whereJsonPathMatches()` → uses default parameter [PostgreSQL] [x] `::whereJsonPathMatches()` → uses provided parameter [PostgreSQL] [x] `::whereJsonPathMatches()` → throws [SQLite] [x] `::insert()` → generates with no auto-ID [PostgreSQL] [x] `::insert()` → generates with no auto-ID [SQLite] [x] `::insert()` → generates with auto numeric ID [PostgreSQL] [x] `::insert()` → generates with auto numeric ID [SQLite] [x] `::insert()` → generates with auto UUID [PostgreSQL] [x] `::insert()` → generates with auto UUID [SQLite] [x] `::insert()` → generates with auto random string [PostgreSQL] [x] `::insert()` → generates with auto random string [SQLite] [x] `::insert()` → throws when mode not set [x] `::save()` → generates the correct query [x] `::update()` → generates the correct query [x] `::orderBy()` → returns blank for no criteria [PostgreSQL] [x] `::orderBy()` → returns blank for no criteria [SQLite] [x] `::orderBy()` → generates one field with no direction [PostgreSQL] [x] `::orderBy()` → generates one field with no direction [SQLite] [x] `::orderBy()` → generates with one qualified field [PostgreSQL] [x] `::orderBy()` → generates with one qualified field [SQLite] [x] `::orderBy()` → generates with multiple fields and direction [PostgreSQL] [x] `::orderBy()` → generates with multiple fields and direction [SQLite] [x] `::orderBy()` → generates with numeric field [PostgreSQL] [x] `::orderBy()` → generates with numeric field [SQLite] [x] `::orderBy()` → generates case-insensitive ordering [PostgreSQL] [x] `::orderBy()` → generates case-insensitive ordering [SQLite]