// Call $Count = $Database->count('users'); if (!is_int($Count)) { fail('COUNT_RETURNING_WRONG_DATA_TYPE'); } if ($Count !== 3) { fail('COUNT_RETURNING_WRONG_DATA'); } # has() Checks // Call $Has = $Database->has('users'); if (!is_bool($Has)) { fail('HAS_RETURNING_WRONG_DATA_TYPE'); } if ($Has !== true) { fail('HAS_RETURNING_WRONG_DATA'); } # delete() Checks // Call with where() $Database->where('id', 3)->delete('users'); if ($Database->where('id', 3)->has('users')) { fail('DELETE_WHERE_NOT_DELETING'); } if ($Database->where('id', array('<' => 3))->count('users') !== 2) { fail('DELETE_WHERE_DELETING_WRONG_ROWS'); } // Standalone call $Database->delete('users'); if ($Database->has('users')) { fail('DELETE_NOT_DELETING'); }