diff --git a/CHANGELOG.md b/CHANGELOG.md
index 1d47c7ab..5a0bd228 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -21,6 +21,13 @@ server side, the following driver methods have been deprecated as well:
- CollectionHandler::load()
- CollectionHandler::unload()
+It is also deprecated to create indexes of type `hash` or `skiplist` using the
+`CollectionHandler::createIndex()` method. Instead, the generic index type `persistent`
+should be used when calling this method.
+Please also note that the dedicated methods `CollectionHandler::createHashIndex()` and
+`CollectionHandler::createSkipListIndex()` for creating hash or skiplist indexes are
+deprecated since 3.5 already.
+
## Release notes for the ArangoDB-PHP driver 3.8.x
OPTION_TIMEOUT of the Connection class is now superseded by the more specialized options
diff --git a/lib/ArangoDBClient/AdminHandler.php b/lib/ArangoDBClient/AdminHandler.php
index 5383b481..39ab84ab 100644
--- a/lib/ArangoDBClient/AdminHandler.php
+++ b/lib/ArangoDBClient/AdminHandler.php
@@ -129,6 +129,46 @@ public function getServerTime()
}
+ /**
+ * Get the server's current log levels
+ *
+ * This will throw if the log levels cannot be retrieved
+ *
+ * @throws Exception
+ *
+ * @return array - an array holding the various log levels
+ * @since 3.9
+ */
+ public function getServerLogLevels()
+ {
+ $url = UrlHelper::appendParamsUrl(Urls::URL_ADMIN_LOG_LEVEL, []);
+ $response = $this->getConnection()->get($url);
+
+ return $response->getJson();
+ }
+
+
+ /**
+ * Set the server's current log levels
+ *
+ * This will throw if the log levels cannot be adjusted
+ *
+ * @throws Exception
+ *
+ * @param array $levels - an array of topic => level settings
+ *
+ * @return array - an array holding the various log levels
+ * @since 3.9
+ */
+ public function setServerLogLevels(array $levels)
+ {
+ $url = UrlHelper::appendParamsUrl(Urls::URL_ADMIN_LOG_LEVEL, []);
+ $response = $this->getConnection()->put($url, $this->json_encode_wrapper($levels));
+
+ return $response->getJson();
+ }
+
+
/**
* Get the server log entries
*
diff --git a/lib/ArangoDBClient/AqlUserFunction.php b/lib/ArangoDBClient/AqlUserFunction.php
index 7bc252ff..40940d75 100644
--- a/lib/ArangoDBClient/AqlUserFunction.php
+++ b/lib/ArangoDBClient/AqlUserFunction.php
@@ -75,7 +75,7 @@ class AqlUserFunction
/**
- * Initialise the AqlUserFunction object
+ * Initialize the AqlUserFunction object
*
* The $attributesArray array can be used to specify the name and code for the user function in form of an array.
*
diff --git a/lib/ArangoDBClient/Autoloader.php b/lib/ArangoDBClient/Autoloader.php
index de08917b..87c772c3 100644
--- a/lib/ArangoDBClient/Autoloader.php
+++ b/lib/ArangoDBClient/Autoloader.php
@@ -35,7 +35,7 @@ class Autoloader
const EXTENSION = '.php';
/**
- * Initialise the autoloader
+ * Initialize the autoloader
*
* @throws Exception
* @return void
diff --git a/lib/ArangoDBClient/CollectionHandler.php b/lib/ArangoDBClient/CollectionHandler.php
index 3ece4e03..80f52c0e 100644
--- a/lib/ArangoDBClient/CollectionHandler.php
+++ b/lib/ArangoDBClient/CollectionHandler.php
@@ -116,6 +116,11 @@ class CollectionHandler extends Handler
* fields
*/
const OPTION_FIELDS = 'fields';
+
+ /**
+ * fieldValueTypes (zkd index only)
+ */
+ const OPTION_FIELD_VALUE_TYPES = 'fieldValueTypes';
/**
* unique
@@ -156,6 +161,11 @@ class CollectionHandler extends Handler
* minLength option
*/
const OPTION_MIN_LENGTH = 'minLength';
+
+ /**
+ * zkd index option
+ */
+ const OPTION_ZKD_INDEX = 'zkd';
/**
* skiplist index option
@@ -918,6 +928,39 @@ public function createFulltextIndex($collection, array $fields, $minLength = nul
return $this->createIndex($collection, $indexOptions);
}
+
+
+ /**
+ * Create a zkd index
+ *
+ * @param mixed $collection - collection as string or object
+ * @param array $fields - an array of fields
+ * @param bool $unique - whether the index is unique or not
+ * @param string $fieldValueTypes - data type of index values
+ * @param bool $inBackground - true if index shall be created in background
+ *
+ * @deprecated use CollectionHandler::createIndex instead
+ *
+ * @return array - server response of the created index
+ * @throws \ArangoDBClient\Exception
+ */
+ public function createZkdIndex($collection, array $fields, $unique = null, $fieldValueTypes = "double", $inBackground = false)
+ {
+ $indexOptions = [
+ self::OPTION_TYPE => 'zkd',
+ self::OPTION_FIELDS => $fields,
+ self::OPTION_FIELD_VALUE_TYPES => $fieldValueTypes,
+ ];
+
+ if ($unique) {
+ $indexOptions[self::OPTION_UNIQUE] = (bool) $unique;
+ }
+ if ($inBackground) {
+ $indexOptions[self::OPTION_IN_BACKGROUND] = (bool) $inBackground;
+ }
+
+ return $this->createIndex($collection, $indexOptions);
+ }
/**
* Create a skip-list index
diff --git a/lib/ArangoDBClient/Cursor.php b/lib/ArangoDBClient/Cursor.php
index 816449cc..3ab867ee 100644
--- a/lib/ArangoDBClient/Cursor.php
+++ b/lib/ArangoDBClient/Cursor.php
@@ -176,7 +176,7 @@ class Cursor implements \Iterator
const ENTRY_BASEURL = 'baseurl';
/**
- * Initialise the cursor with the first results and some metadata
+ * Initialize the cursor with the first results and some metadata
*
* @param Connection $connection - connection to be used
* @param array $data - initial result data as returned by the server
diff --git a/lib/ArangoDBClient/Database.php b/lib/ArangoDBClient/Database.php
index 3ffd7cac..ac583ab6 100644
--- a/lib/ArangoDBClient/Database.php
+++ b/lib/ArangoDBClient/Database.php
@@ -43,7 +43,7 @@ class Database
* This creates a new database
*
* @param Connection $connection - the connection to be used
- * @param string $name - database name, for example 'myDatabase'
+ * @param string $name - database name, for example 'myDatabase' - must be NFC-normalized!
* @param array $options - extra options for new collections in this database.
*
Options are :
*
'replicationFactor'
@@ -58,16 +58,6 @@ class Database
*/
public static function create(Connection $connection, $name, array $options = [])
{
- try {
- // NFC-normalize the database name, as this is required
- // by the server
- if (class_exists("\Normalizer", false)) {
- $name = \Normalizer::normalize($name, \Normalizer::FORM_C);
- }
- } catch (\Exception $e) {
- // don't fail if Unicode normalization doesn't work.
- // probably it is not installed.
- }
$payload = [
self::ENTRY_DATABASE_NAME => $name,
self::ENTRY_DATABASE_USERS => [
@@ -195,6 +185,33 @@ public static function getInfo(Connection $connection)
return $response->getJson();
}
+
+
+ /**
+ * normalizes a database name
+ *
+ * UTF-8 NFC Normalization is required for database names in case
+ * the extended naming scheme for databases is used. This has to
+ * be enabled on the server side and is present since server version
+ * 3.9.
+ * If the name needs normalization but no normalizer is installed,
+ * this function can fail and abort the program with a PHP fatal error.
+ *
+ * @param string $name - database name to normalize.
+ *
+ * @return string $name - The normalized name
+ */
+ public static function normalizeName($name)
+ {
+ // first check if the database name follows the traditional
+ // naming scheme. if so, there is no need to normalize it.
+ if (!preg_match("/^[a-zA-Z0-9_\-]+$/", $name)) {
+ // extended database naming scheme. now NFC-normalize
+ // the database name, as this is required by the server
+ $name = \Normalizer::normalize($name, \Normalizer::FORM_C);
+ }
+ return $name;
+ }
}
class_alias(Database::class, '\triagens\ArangoDb\Database');
diff --git a/lib/ArangoDBClient/EdgeDefinition.php b/lib/ArangoDBClient/EdgeDefinition.php
index ed2db36d..a46863f8 100644
--- a/lib/ArangoDBClient/EdgeDefinition.php
+++ b/lib/ArangoDBClient/EdgeDefinition.php
@@ -44,6 +44,13 @@ class EdgeDefinition
* @var array names of the end vertices collection
*/
protected $_toCollections = [];
+
+ /**
+ * An array containing satellite collections in Hybrid SmartGraphs
+ *
+ * @var array satellite collections
+ */
+ protected $_satellites = [];
/**
* Constructs an new edge definition
@@ -51,19 +58,18 @@ class EdgeDefinition
* @param string $relation - name of the relation (the underlying edge collection).
* @param array|string $fromCollections - a list of collections providing the edges start vertices or a string holding a single collection name.
* @param array|string $toCollections - a list of collections providing the edges end vertices or a string holding a single collection name.
+ * @param array|string $satellites - a list of satellite collections (SmartGraph only).
*
* @since 2.2
*
*/
- public function __construct($relation = null, $fromCollections = [], $toCollections = [])
+ public function __construct($relation = null, $fromCollections = [], $toCollections = [], $satellites = [])
{
$this->_relation = $relation;
- $fromCollections = (array) $fromCollections;
- $toCollections = (array) $toCollections;
-
- $this->_fromCollections = $fromCollections;
- $this->_toCollections = $toCollections;
+ $this->_fromCollections = (array) $fromCollections;
+ $this->_toCollections = (array) $toCollections;
+ $this->_satellites = (array) $satellites;
}
/**
@@ -111,6 +117,17 @@ public function getFromCollections()
{
return $this->_fromCollections;
}
+
+ /**
+ * Get the 'satellites' collections of the graph.
+ *
+ * @return array
+ * @since 3.9
+ */
+ public function getSatellites()
+ {
+ return $this->_satellites;
+ }
/**
* Add a 'to' collections of the graph.
@@ -135,6 +152,18 @@ public function addFromCollection($fromCollection)
{
$this->_fromCollections[] = $fromCollection;
}
+
+ /**
+ * Add a 'satellite' collection of the graph.
+ *
+ * @param string $toCollection - the name of the added collection.
+ *
+ * @since 3.9
+ */
+ public function addSatelliteCollection($collection)
+ {
+ $this->_satellites[] = $collection;
+ }
/**
* Resets the 'to' collections of the graph.
@@ -155,6 +184,16 @@ public function clearFromCollection()
{
return $this->_fromCollections = [];
}
+
+ /**
+ * Resets the 'satellites' collections of the graph.
+ *
+ * @since 3.9
+ */
+ public function clearSatellites()
+ {
+ return $this->_satellites = [];
+ }
/**
* Transforms an edge definition to an array.
@@ -168,6 +207,7 @@ public function transformToArray()
$transformedEd['collection'] = $this->getRelation();
$transformedEd['from'] = $this->getFromCollections();
$transformedEd['to'] = $this->getToCollections();
+ $transformedEd['satellites'] = $this->getSatellites();
return $transformedEd;
}
@@ -179,13 +219,14 @@ public function transformToArray()
*
* @param string $relation - name of the relation (the underlying edge collection).
* @param array $vertexCollections - a list of collections providing the edges start and end vertices.
+ * @param array $satellites - a list of satellite collections (for Hybrid SmartGraphs).
*
* @return EdgeDefinition
* @since 2.2
*/
- public static function createUndirectedRelation($relation, $vertexCollections)
+ public static function createUndirectedRelation($relation, $vertexCollections, array $satellites = [])
{
- return new EdgeDefinition($relation, $vertexCollections, $vertexCollections);
+ return new EdgeDefinition($relation, $vertexCollections, $vertexCollections, $satellites);
}
@@ -196,13 +237,14 @@ public static function createUndirectedRelation($relation, $vertexCollections)
* @param string $relation - name of the relation (the underlying edge collection).
* @param array|string $fromCollections - a list of collections providing the edges start vertices or a string holding a single collection name.
* @param array|string $toCollections - a list of collections providing the edges end vertices or a string holding a single collection name.
+ * @param array|string $satellites - a list of satellite collections (for Hybrid SmartGraphs).
*
* @return EdgeDefinition
* @since 2.2
*/
- public static function createDirectedRelation($relation, $fromCollections, $toCollections)
+ public static function createDirectedRelation($relation, $fromCollections, $toCollections, array $satellites = [])
{
- return new EdgeDefinition($relation, $fromCollections, $toCollections);
+ return new EdgeDefinition($relation, $fromCollections, $toCollections, $satellites);
}
}
diff --git a/lib/ArangoDBClient/Graph.php b/lib/ArangoDBClient/Graph.php
index cee2dc4f..267b9225 100644
--- a/lib/ArangoDBClient/Graph.php
+++ b/lib/ArangoDBClient/Graph.php
@@ -1,7 +1,7 @@
set('_key', $name);
}
- // pass the $options to the parent constructor to do the actual work
- parent::__construct($options);
+ foreach ($options as $key => $value) {
+ $this->set($key, $value);
+ }
}
@@ -139,7 +211,156 @@ public function getOrphanCollections()
{
return $this->_orphanCollections;
}
+
+
+ /**
+ * Adds a satellite collection to the graph.
+ *
+ * @param string $name - name of satellite collection
+ *
+ * @return Graph
+ */
+ public function addSatellite($name)
+ {
+ $this->_satellites[] = $name;
+ return $this;
+ }
+ /**
+ * Get the satellite collections of the graph.
+ *
+ * @return string[]
+ */
+ public function getSatellites()
+ {
+ return $this->_satellites;
+ }
+
+ /**
+ * Set the smart graph attribute
+ *
+ * @param string $name - smart graph attribute name
+ *
+ * @return Graph
+ * @since 3.9
+ */
+ public function setSmartGraphAttribute($name)
+ {
+ $this->set(self::ENTRY_IS_SMART_GRAPH_ATTRIBUTE, $name);
+ return $this;
+ }
+
+ /**
+ * Get the smart graph attribute
+ *
+ * @return string
+ * @since 3.9
+ */
+ public function getSmartGraphAttribute()
+ {
+ return $this->_smartGraphAttribute;
+ }
+
+ /**
+ * Set the smartness of the graph.
+ *
+ * @param bool $value - smartness value
+ *
+ * @return Graph
+ * @since 3.9
+ */
+ public function setIsSmart($value)
+ {
+ $this->set(self::ENTRY_IS_SMART, $value);
+ return $this;
+ }
+
+ /**
+ * Get the smartness of the graph.
+ *
+ * @return bool
+ * @since 3.9
+ */
+ public function isSmart()
+ {
+ return $this->_isSmart;
+ }
+
+ /**
+ * Set the disjointness of the graph.
+ *
+ * @param bool $value - disjointness value
+ *
+ * @return Graph
+ * @since 3.9
+ */
+ public function setIsDisjoint($value)
+ {
+ $this->set(self::ENTRY_IS_DISJOINT, $value);
+ return $this;
+ }
+
+ /**
+ * Get the disjointness of the graph.
+ *
+ * @return bool
+ * @since 3.9
+ */
+ public function isDisjoint()
+ {
+ return $this->_isDisjoint;
+ }
+
+ /**
+ * Set the number of shards
+ *
+ * @param int $shards - number of shards
+ *
+ * @return Graph
+ * @since 3.9
+ */
+ public function setNumberOfShards($shards)
+ {
+ $this->set(self::ENTRY_NUMBER_OF_SHARDS, $shards);
+ return $this;
+ }
+
+ /**
+ * Get the number of shards
+ *
+ * @return mixed
+ * @since 3.9
+ */
+ public function getNumberOfShards()
+ {
+ return $this->_numberOfShards;
+ }
+
+
+ /**
+ * Set the replication factor
+ *
+ * @param mixed $replicationFactor - replication factor (either a number or "satellite")
+ *
+ * @return Graph
+ * @since 3.9
+ */
+ public function setReplicationFactor($value)
+ {
+ $this->set(self::ENTRY_REPLICATION_FACTOR, $value);
+ return $this;
+ }
+
+ /**
+ * Get the replication factor
+ *
+ * @return mixed
+ * @since 3.9
+ */
+ public function getReplicationFactor()
+ {
+ return $this->_replicationFactor;
+ }
/**
* Set a graph attribute
@@ -184,6 +405,26 @@ public function set($key, $value)
foreach ($value as $o) {
$this->addOrphanCollection($o);
}
+ } else if ($key === self::ENTRY_SATELLITES) {
+ foreach ($value as $o) {
+ $this->addSatellite($o);
+ }
+ } else if ($key === self::ENTRY_NUMBER_OF_SHARDS) {
+ $this->_numberOfShards = (int) $value;
+ } else if ($key === self::ENTRY_REPLICATION_FACTOR) {
+ $this->_replicationFactor = $value;
+ } else if ($key === self::ENTRY_IS_SMART) {
+ if (!$value && ($this instanceof SmartGraph)) {
+ throw new ClientException('Cannot unset isSmart attribute of a SmartGraph');
+ }
+ $this->_isSmart = $value;
+ } else if ($key === self::ENTRY_IS_DISJOINT) {
+ if (!($this instanceof SmartGraph)) {
+ throw new ClientException('Cannot set isDisjoint attribute on non-SmartGraph');
+ }
+ $this->_isDisjoint = $value;
+ } else if ($key === self::ENTRY_SMART_GRAPH_ATTRIBUTE) {
+ $this->_smartGraphAttribute = $value;
} else {
parent::set($key, $value);
}
diff --git a/lib/ArangoDBClient/GraphHandler.php b/lib/ArangoDBClient/GraphHandler.php
index c9163021..97ca5a41 100644
--- a/lib/ArangoDBClient/GraphHandler.php
+++ b/lib/ArangoDBClient/GraphHandler.php
@@ -112,10 +112,24 @@ public function createGraph(Graph $graph)
}
$params = [
- self::OPTION_NAME => $graph->getKey(),
- self::OPTION_EDGE_DEFINITIONS => $edgeDefinitions,
- self::OPTION_ORPHAN_COLLECTIONS => $graph->getOrphanCollections()
+ self::OPTION_NAME => $graph->getKey(),
+ self::OPTION_EDGE_DEFINITIONS => $edgeDefinitions,
+ self::OPTION_ORPHAN_COLLECTIONS => $graph->getOrphanCollections(),
];
+
+ if ($graph->isSmart()) {
+ $params[Graph::ENTRY_IS_SMART] = $graph->isSmart();
+ $params["options"][Graph::ENTRY_IS_DISJOINT] = $graph->isDisjoint();
+ $params["options"][Graph::ENTRY_SMART_GRAPH_ATTRIBUTE] = $graph->getSmartGraphAttribute();
+ }
+
+ if ($graph->getReplicationFactor() !== null) {
+ $params["options"][Graph::ENTRY_REPLICATION_FACTOR] = $graph->getReplicationFactor();
+ }
+ if ($graph->getNumberOfShards() !== null) {
+ $params["options"][Graph::ENTRY_NUMBER_OF_SHARDS] = $graph->getNumberOfShards();
+ }
+
$url = Urls::URL_GRAPH;
$response = $this->getConnection()->post($url, $this->json_encode_wrapper($params));
$json = $response->getJson();
diff --git a/lib/ArangoDBClient/SmartGraph.php b/lib/ArangoDBClient/SmartGraph.php
new file mode 100644
index 00000000..002931b8
--- /dev/null
+++ b/lib/ArangoDBClient/SmartGraph.php
@@ -0,0 +1,47 @@
+_isSmart = true;
+ }
+}
+
+class_alias(SmartGraph::class, '\triagens\ArangoDb\SmartGraph');
diff --git a/lib/ArangoDBClient/Statement.php b/lib/ArangoDBClient/Statement.php
index b60fb7a3..dc57f667 100644
--- a/lib/ArangoDBClient/Statement.php
+++ b/lib/ArangoDBClient/Statement.php
@@ -165,6 +165,13 @@ class Statement
*/
private $_memoryLimit = 0;
+ /**
+ * Whether or not the query should populate the RocksDB block cache while reading data
+ *
+ * @var bool
+ */
+ private $_fillBlockCache = null;
+
/**
* transaction id (used internally)
*
@@ -218,6 +225,11 @@ class Statement
* Memory limit threshold for query
*/
const ENTRY_MEMORY_LIMIT = 'memoryLimit';
+
+ /**
+ * Whether or not the query should fill the block cache while reading
+ */
+ const ENTRY_FILL_BLOCK_CACHE = 'fillBlockCache';
/**
* Full count option index
@@ -245,7 +257,7 @@ class Statement
const ENTRY_TRANSACTION = 'transaction';
/**
- * Initialise the statement
+ * Initialize the statement
*
* The $data property can be used to specify the query text and further
* options for the query.
@@ -328,6 +340,10 @@ public function __construct(Connection $connection, array $data)
if (isset($data[self::ENTRY_MEMORY_LIMIT])) {
$this->_memoryLimit = (int) $data[self::ENTRY_MEMORY_LIMIT];
}
+
+ if (isset($data[self::ENTRY_FILL_BLOCK_CACHE])) {
+ $this->_fillBlockCache = (bool) $data[self::ENTRY_FILL_BLOCK_CACHE];
+ }
if (isset($data[self::ENTRY_TRANSACTION]) && $data[self::ENTRY_TRANSACTION] instanceof StreamingTransaction) {
$this->_trxId = $data[self::ENTRY_TRANSACTION]->getId();
@@ -718,6 +734,29 @@ public function getMemoryLimit()
{
return $this->_memoryLimit;
}
+
+
+ /**
+ * Set whether or not the query should populate the block cache while reading data
+ *
+ * @param bool $value - value for block cache filling option
+ *
+ * @return void
+ */
+ public function setFillBlockCache($value = true)
+ {
+ $this->_fillBlockCache = (bool) $value;
+ }
+
+ /**
+ * Get the configured value for block cache filling
+ *
+ * @return bool - current value of block cache filling option
+ */
+ public function getFillBlockCache()
+ {
+ return $this->_fillBlockCache;
+ }
/**
* Set the batch size for the statement
@@ -780,6 +819,10 @@ private function buildData()
$data['options'][self::ENTRY_MAX_RUNTIME] = $this->_maxRuntime;
}
+ if ($this->_fillBlockCache !== null) {
+ $data['options'][self::ENTRY_FILL_BLOCK_CACHE] = $this->_fillBlockCache;
+ }
+
if ($this->_ttl !== null) {
$data[self::ENTRY_TTL] = $this->_ttl;
}
diff --git a/lib/ArangoDBClient/Transaction.php b/lib/ArangoDBClient/Transaction.php
index ec18a26a..9563bf62 100644
--- a/lib/ArangoDBClient/Transaction.php
+++ b/lib/ArangoDBClient/Transaction.php
@@ -74,7 +74,7 @@ class Transaction extends TransactionBase
protected $_action;
/**
- * Initialise the transaction object
+ * Initialize the transaction object
*
* The $transaction array can be used to specify the collections, action and further
* options for the transaction in form of an array.
diff --git a/lib/ArangoDBClient/TransactionBase.php b/lib/ArangoDBClient/TransactionBase.php
index f7e3006c..f84878ef 100644
--- a/lib/ArangoDBClient/TransactionBase.php
+++ b/lib/ArangoDBClient/TransactionBase.php
@@ -63,7 +63,7 @@ class TransactionBase
const ENTRY_EXCLUSIVE = 'exclusive';
/**
- * Initialise the transaction object
+ * Initialize the transaction object
*
* @param Connection $connection - the connection to be used
*
diff --git a/lib/ArangoDBClient/Traversal.php b/lib/ArangoDBClient/Traversal.php
index 888b4c6b..a4f1bfd3 100644
--- a/lib/ArangoDBClient/Traversal.php
+++ b/lib/ArangoDBClient/Traversal.php
@@ -61,11 +61,11 @@ class Traversal
protected $_action;
/**
- * Initialise the Traversal object
+ * Initialize the Traversal object
*
* @param Connection $connection - the connection to be used
- * @param string $startVertex - user function initialization data
- * @param string $edgeCollection - user function initialization data
+ * @param string $startVertex - start vertex id for query
+ * @param string $edgeCollection - name of the underlying edge collection
* @param array $options
*
* @throws \ArangoDBClient\ClientException
diff --git a/lib/ArangoDBClient/UrlHelper.php b/lib/ArangoDBClient/UrlHelper.php
index b936309d..2a37a27a 100644
--- a/lib/ArangoDBClient/UrlHelper.php
+++ b/lib/ArangoDBClient/UrlHelper.php
@@ -66,7 +66,7 @@ public static function buildUrl($baseUrl, array $parts = [])
@list(,$part) = explode('/', $part);
}
- $url .= '/' . urlencode($part);
+ $url .= '/' . rawurlencode($part);
}
return $url;
diff --git a/lib/ArangoDBClient/Urls.php b/lib/ArangoDBClient/Urls.php
index 024764ef..cec0f731 100644
--- a/lib/ArangoDBClient/Urls.php
+++ b/lib/ArangoDBClient/Urls.php
@@ -202,6 +202,11 @@ abstract class Urls
* URL for admin log entries
*/
const URL_ADMIN_LOG_ENTRIES = '/_admin/log/entries';
+
+ /**
+ * URL for admin log levels
+ */
+ const URL_ADMIN_LOG_LEVEL = '/_admin/log/level';
/**
* base URL part for admin routing reload (deprecated)
diff --git a/tests/.phpunit.result.cache b/tests/.phpunit.result.cache
new file mode 100644
index 00000000..de8606a2
--- /dev/null
+++ b/tests/.phpunit.result.cache
@@ -0,0 +1 @@
+{"version":1,"defects":{"ArangoDBClient\\CollectionBasicTest::testCreateCollectionWithKeyOptionsCluster":1,"ArangoDBClient\\CollectionBasicTest::testCreateCollectionWithDistributeShardsLike":1,"ArangoDBClient\\CollectionBasicTest::testCreateCollectionWithNumberOfShardsCluster":1,"ArangoDBClient\\CollectionBasicTest::testCreateCollectionWithReplicationFactor1":1,"ArangoDBClient\\CollectionBasicTest::testCreateCollectionWithReplicationFactor2":1,"ArangoDBClient\\CollectionBasicTest::testCreateCollectionWithReplicationFactorSatellite":1,"ArangoDBClient\\CollectionBasicTest::testCreateCollectionWithShardingStrategyCommunityCompat":1,"ArangoDBClient\\CollectionBasicTest::testCreateCollectionWithShardingStrategyHash":1,"ArangoDBClient\\CollectionBasicTest::testCreateCollectionWithoutShardingStrategy":1,"ArangoDBClient\\CollectionBasicTest::testCreateCollectionWithShardKeysCluster":1,"ArangoDBClient\\CollectionBasicTest::testCreateCollectionWithSmartJoinAttribute":1,"ArangoDBClient\\CollectionBasicTest::testCollectionCountDetailed":1,"ArangoDBClient\\CollectionBasicTest::testGetShards":1,"ArangoDBClient\\CollectionBasicTest::testGetResponsibleShard":1,"ArangoDBClient\\DatabaseTest::testCreateDatabaseWithUnicodeName":1,"ArangoDBClient\\DatabaseTest::testCreateDatabaseWithUnicodeNameNormalization":1,"ArangoDBClient\\DatabaseTest::testCreateDatabaseWithOptions":1,"ArangoDBClient\\DatabaseTest::testCreateDatabaseWithMoreOptions":1,"ArangoDBClient\\CollectionBasicTest::testCreateZkdIndex":4},"times":{"ArangoDBClient\\AdminTest::testEngine":0.003,"ArangoDBClient\\AdminTest::testEngineStats":0.001,"ArangoDBClient\\AdminTest::testGetServerVersion":0,"ArangoDBClient\\AdminTest::testGetServerVersionWithDetails":0,"ArangoDBClient\\AdminTest::testGetServerTime":0,"ArangoDBClient\\AdminTest::testGetServerLogEntries":0,"ArangoDBClient\\AdminTest::testGetServerLog":0.001,"ArangoDBClient\\AdminTest::testGetServerMetrics":0.002,"ArangoDBClient\\AdminTest::testReloadServerRouting":0,"ArangoDBClient\\AdminTest::testGetServerStatistics":0,"ArangoDBClient\\AdminTest::testGetServerStatisticsDescription":0,"ArangoDBClient\\AnalyzerTest::testCreateAnalyzerObject":0.002,"ArangoDBClient\\AnalyzerTest::testCreateIdentityAnalyzer":0.005,"ArangoDBClient\\AnalyzerTest::testCreateTextAnalyzer":0.005,"ArangoDBClient\\AnalyzerTest::testCreateTextAnalyzerFail":0.003,"ArangoDBClient\\AnalyzerTest::testCreateStopwordsAnalyzer":0.007,"ArangoDBClient\\AnalyzerTest::testCreateDelimiterAnalyzer":0.006,"ArangoDBClient\\AnalyzerTest::testCreateNormAnalyzer":0.007,"ArangoDBClient\\AnalyzerTest::testCreatePipelineAnalyzer":0.007,"ArangoDBClient\\AnalyzerTest::testGetAnalyzer":0.009,"ArangoDBClient\\AnalyzerTest::testGetDefaultAnalyzers":0.003,"ArangoDBClient\\AnalyzerTest::testGetAllAnalyzers":0.014,"ArangoDBClient\\AnalyzerTest::testGetNonExistingAnalyzer":0.003,"ArangoDBClient\\AnalyzerTest::testAnalyzerProperties":0.015,"ArangoDBClient\\AnalyzerTest::testDropAnalyzer":0.008,"ArangoDBClient\\AnalyzerTest::testDropNonExistingAnalyzer":0.003,"ArangoDBClient\\AqlUserFunctionTest::testRegisterListAndUnRegisterAqlUserFunctionWithInitialConfig":0.013,"ArangoDBClient\\AqlUserFunctionTest::testRegisterListAndUnRegisterAqlUserFunctionUsingShortcut":0.014,"ArangoDBClient\\AqlUserFunctionTest::testRegisterListAndUnRegisterAqlUserFunctionWithGettersAndSetters":0.013,"ArangoDBClient\\AqlUserFunctionTest::testRegisterListAndUnRegisterAqlUserFunctionWithWithMagicSettersAndGetters":0.01,"ArangoDBClient\\AqlUserFunctionTest::testReRegisterListAndUnRegisterAqlUserFunctionTwice":0.012,"ArangoDBClient\\AqlUserFunctionTest::testGetAQLFunctionsWithNamespaceFilter":0.012,"ArangoDBClient\\AqlUserFunctionTest::testUnRegisterAQLFunctionsOnNamespace":0.013,"ArangoDBClient\\BatchTest::testEmptyBatch":0.01,"ArangoDBClient\\BatchTest::testPartIds":0.009,"ArangoDBClient\\BatchTest::testProcessProcess":0.008,"ArangoDBClient\\BatchTest::testCreateDocumentBatch":0.006,"ArangoDBClient\\BatchTest::testCreateDocumentBatchWithDefinedBatchSize":0.006,"ArangoDBClient\\BatchTest::testFailureWhenCreatingMoreDocumentsInBatchThanDefinedBatchSize":0.003,"ArangoDBClient\\BatchTest::testCreateMixedBatchWithPartIds":0.022,"ArangoDBClient\\BatchTest::testRemoveByKeysInBatch":0.011,"ArangoDBClient\\BatchTest::testCollectionHandlerAllInBatch":0.009,"ArangoDBClient\\BatchTest::testFirstExampleBatch":0.014,"ArangoDBClient\\BatchTest::testByExampleBatch":0.014,"ArangoDBClient\\CollectionBasicTest::testDefaultCollectionType":0.005,"ArangoDBClient\\CollectionBasicTest::testInitializeCollection":0.001,"ArangoDBClient\\CollectionBasicTest::testInitializeCollectionWithDocumentType":0.001,"ArangoDBClient\\CollectionBasicTest::testInitializeCollectionWithEdgeType":0.001,"ArangoDBClient\\CollectionBasicTest::testCreateCollectionLongName":0.002,"ArangoDBClient\\CollectionBasicTest::testCreateCollectionTooLongName":0.001,"ArangoDBClient\\CollectionBasicTest::testCreateAndDeleteCollectionPre1_2":0.002,"ArangoDBClient\\CollectionBasicTest::testCreateCollectionWithKeyOptionsAndVerifyProperties":0.002,"ArangoDBClient\\CollectionBasicTest::testCreateCollectionWithKeyOptionsCluster":0.001,"ArangoDBClient\\CollectionBasicTest::testCreateCollectionWithDistributeShardsLike":0.002,"ArangoDBClient\\CollectionBasicTest::testCreateCollectionWithNumberOfShardsCluster":0.001,"ArangoDBClient\\CollectionBasicTest::testCreateCollectionWithReplicationFactor1":0.001,"ArangoDBClient\\CollectionBasicTest::testCreateCollectionWithReplicationFactor2":0.001,"ArangoDBClient\\CollectionBasicTest::testCreateCollectionWithReplicationFactorSatellite":0.001,"ArangoDBClient\\CollectionBasicTest::testCreateCollectionWithShardingStrategyCommunityCompat":0.001,"ArangoDBClient\\CollectionBasicTest::testCreateCollectionWithShardingStrategyHash":0.002,"ArangoDBClient\\CollectionBasicTest::testCreateCollectionWithoutShardingStrategy":0.001,"ArangoDBClient\\CollectionBasicTest::testCreateCollectionWithShardKeysCluster":0.001,"ArangoDBClient\\CollectionBasicTest::testCreateCollectionWithSmartJoinAttribute":0.001,"ArangoDBClient\\CollectionBasicTest::testCreateAndDeleteCollection":0.001,"ArangoDBClient\\CollectionBasicTest::testCreateAndDeleteEdgeCollection":0.003,"ArangoDBClient\\CollectionBasicTest::testCreateAndDeleteEdgeCollectionWithoutCreatingObject":0.003,"ArangoDBClient\\CollectionBasicTest::testCreateAndDeleteSystemCollectionWithoutCreatingObject":0.002,"ArangoDBClient\\CollectionBasicTest::testCreateIndex":0.003,"ArangoDBClient\\CollectionBasicTest::testGetIndexById":0.002,"ArangoDBClient\\CollectionBasicTest::testGetIndexByName":0.002,"ArangoDBClient\\CollectionBasicTest::testDropIndexById":0.002,"ArangoDBClient\\CollectionBasicTest::testDropIndexByName":0.002,"ArangoDBClient\\CollectionBasicTest::testCreateGeo1Index":0.003,"ArangoDBClient\\CollectionBasicTest::testCreateGeo2Index":0.002,"ArangoDBClient\\CollectionBasicTest::testCreateHashIndex":0.003,"ArangoDBClient\\CollectionBasicTest::testCreateSparseHashIndex":0.002,"ArangoDBClient\\CollectionBasicTest::testCreateFulltextIndex":0.002,"ArangoDBClient\\CollectionBasicTest::testCreateSkipListIndex":0.002,"ArangoDBClient\\CollectionBasicTest::testCreateSparseSkipListIndex":0.002,"ArangoDBClient\\CollectionBasicTest::testCreatePersistentIndex":0.002,"ArangoDBClient\\CollectionBasicTest::testCreateSparsePersistentIndex":0.002,"ArangoDBClient\\CollectionBasicTest::testCreateTtlIndex":0.002,"ArangoDBClient\\CollectionBasicTest::testGetIndex":0.002,"ArangoDBClient\\CollectionBasicTest::testCreateIndexInBackground":0.011,"ArangoDBClient\\CollectionBasicTest::testHasCollectionReturnsFalseIfCollectionDoesNotExist":0.002,"ArangoDBClient\\CollectionBasicTest::testHasCollectionReturnsTrueIfCollectionExists":0.002,"ArangoDBClient\\CollectionBasicTest::testCollectionCountDetailed":0.001,"ArangoDBClient\\CollectionBasicTest::testGetShards":0.001,"ArangoDBClient\\CollectionBasicTest::testGetResponsibleShard":0.001,"ArangoDBClient\\CollectionExtendedTest::testCreateWithNoSchema":0.002,"ArangoDBClient\\CollectionExtendedTest::testCreateWithSchema":0.002,"ArangoDBClient\\CollectionExtendedTest::testCreateGetAndDeleteCollectionWithWaitForSyncDefault":0.001,"ArangoDBClient\\CollectionExtendedTest::testCreateGetAndDeleteSystemCollection":0.001,"ArangoDBClient\\CollectionExtendedTest::testGetAllNonSystemCollections":0.002,"ArangoDBClient\\CollectionExtendedTest::testGetChecksum":0.002,"ArangoDBClient\\CollectionExtendedTest::testGetChecksumWithException":0.001,"ArangoDBClient\\CollectionExtendedTest::testGetRevision":0.002,"ArangoDBClient\\CollectionExtendedTest::testGetRevisionWithException":0.001,"ArangoDBClient\\CollectionExtendedTest::testCreateRenameAndDeleteCollection":0.002,"ArangoDBClient\\CollectionExtendedTest::testCreateGetAndDeleteCollectionWithWaitForSyncTrue":0.017,"ArangoDBClient\\CollectionExtendedTest::testCreateGetAndDeleteCollectionThroughCreateFromArrayWithWaitForSyncTrue":0.009,"ArangoDBClient\\CollectionExtendedTest::testRemoveByKeys":0.013,"ArangoDBClient\\CollectionExtendedTest::testRemoveByKeysCollectionNotFound":0.004,"ArangoDBClient\\CollectionExtendedTest::testRemoveByKeysNotFound":0.007,"ArangoDBClient\\CollectionExtendedTest::testCreateDocumentsAndRemoveByExampleEmptyExample":0.006,"ArangoDBClient\\CollectionExtendedTest::testCreateDocumentsAndUpdateByExampleEmptyExample":0.006,"ArangoDBClient\\CollectionExtendedTest::testCreateDocumentsAndUpdateByExampleEmptyUpdateExample":0.006,"ArangoDBClient\\CollectionExtendedTest::testCreateDocumentsAndReplaceByExampleEmptyExample":0.006,"ArangoDBClient\\CollectionExtendedTest::testCreateDocumentsAndReplaceByExampleEmptyReplaceExample":0.005,"ArangoDBClient\\CollectionExtendedTest::testCreateDocumentsAndQueryByExampleEmptyExample":0.004,"ArangoDBClient\\CollectionExtendedTest::testCreateDocumentsWithCreateFromArrayAndRemoveByExample":0.028,"ArangoDBClient\\CollectionExtendedTest::testCreateDocumentsWithCreateFromArrayGetAsArrayAndRemoveByExample":0.015,"ArangoDBClient\\CollectionExtendedTest::testCreateDocumentsWithCreateFromArrayUpdateReplaceAndRemoveByExample":0.04,"ArangoDBClient\\CollectionExtendedTest::testCreateDocumentsFromArrayUpdateReplaceAndRemoveByExample":0.041,"ArangoDBClient\\CollectionExtendedTest::testCreateDocumentsWithCreateFromArrayUpdateReplaceAndRemoveByExampleWithLimits":0.039,"ArangoDBClient\\CollectionExtendedTest::testCreateDocumentsWithCreateFromArrayUpdateReplaceAndRemoveByExampleWithWaitForSync":0.04,"ArangoDBClient\\CollectionExtendedTest::testCreateDocumentsWithCreateFromArrayUpdateReplaceAndRemoveByExampleWithKeepNull":0.034,"ArangoDBClient\\CollectionExtendedTest::testCreateDocumentsWithCreateFromArrayAndRemoveByExampleWithLimit":0.027,"ArangoDBClient\\CollectionExtendedTest::testImportFromFileUsingHeadersAndValues":0.014,"ArangoDBClient\\CollectionExtendedTest::testImportFromFileUsingDocumentsLineByLine":0.012,"ArangoDBClient\\CollectionExtendedTest::testImportFromFileUsingResultSet":0.013,"ArangoDBClient\\CollectionExtendedTest::testImportFromArrayOfDocuments":0.012,"ArangoDBClient\\CollectionExtendedTest::testImportFromStringWithValuesAndHeaders":0.013,"ArangoDBClient\\CollectionExtendedTest::testImportFromStringUsingDocumentsLineByLine":0.013,"ArangoDBClient\\CollectionExtendedTest::testImportFromStringUsingDocumentsUsingResultset":0.012,"ArangoDBClient\\CollectionExtendedTest::testCreateGetAllIdsAndDeleteCollectionThroughCreateFromArray":0.014,"ArangoDBClient\\CollectionExtendedTest::testCreateAndAllAndDeleteCollection":0.013,"ArangoDBClient\\CollectionExtendedTest::testCreateAndIssueAllWithHiddenAttributesAndDeleteCollection":0.008,"ArangoDBClient\\CollectionExtendedTest::testCreateAndIssueAllWithHiddenAttributesButDifferentDocGetAllOptionsAndDeleteCollection":0.009,"ArangoDBClient\\CollectionExtendedTest::testCreateAndAllWithLimitAndDeleteCollection":0.004,"ArangoDBClient\\CollectionExtendedTest::testCreateAndAllWithSkipAndDeleteCollection":0.005,"ArangoDBClient\\CollectionExtendedTest::testCreateFillAndTruncateCollection":0.017,"ArangoDBClient\\CollectionExtendedTest::testGetAll":0.001,"ArangoDBClient\\CollectionExtendedTest::testCreateHashIndex":0.004,"ArangoDBClient\\CollectionExtendedTest::testCreateUniqueHashIndex":0.003,"ArangoDBClient\\CollectionExtendedTest::testCreateSkipListIndexedCollectionAddDocumentsAndQueryRange":0.012,"ArangoDBClient\\CollectionExtendedTest::testCreateGeoIndexedCollectionAddDocumentsAndQueryNear":0.018,"ArangoDBClient\\CollectionExtendedTest::testCreateGeoIndexedCollectionAddDocumentsAndQueryWithin":0.013,"ArangoDBClient\\CollectionExtendedTest::testCreateFulltextIndexedCollectionAddDocumentsAndQuery":0.015,"ArangoDBClient\\CollectionExtendedTest::testCreateFulltextIndexedCollectionWithOptions":0.003,"ArangoDBClient\\CollectionExtendedTest::testCreateArrayIndex":0.003,"ArangoDBClient\\CollectionExtendedTest::testCreateArrayIndexWithDeduplicateOption":0.003,"ArangoDBClient\\CollectionExtendedTest::testCreateIndexWithDisabledEstimates":0.003,"ArangoDBClient\\CollectionExtendedTest::testCreateTtlIndex":0.003,"ArangoDBClient\\CollectionExtendedTest::testAnyDocumentInCollection":0.007,"ArangoDBClient\\CollectionExtendedTest::testAnyDocumentInNonExistentCollection":0.002,"ArangoDBClient\\CollectionExtendedTest::testAnyDocumentInAnEmptyCollection":0.003,"ArangoDBClient\\CollectionExtendedTest::testFulltextQuery":0.016,"ArangoDBClient\\CollectionExtendedTest::testLookupByKeys":0.004,"ArangoDBClient\\CollectionExtendedTest::testLookupByCollectionNotFound":0.002,"ArangoDBClient\\ConnectionTest::testInitializeConnection":0.001,"ArangoDBClient\\ConnectionTest::testTestUnconnected":2.007,"ArangoDBClient\\ConnectionTest::testTest":0.001,"ArangoDBClient\\ConnectionTest::testEndpointAndPort":0.001,"ArangoDBClient\\ConnectionTest::testGetStatus":0.001,"ArangoDBClient\\ConnectionTest::testGetOptions":0,"ArangoDBClient\\ConnectionTest::testSetOptions":0,"ArangoDBClient\\ConnectionTest::testTimeoutOptions":0,"ArangoDBClient\\ConnectionTest::testSetEndpointOption":0,"ArangoDBClient\\ConnectionTest::testSetAllowSelfSignedOption":0,"ArangoDBClient\\ConnectionTest::testSetVerifyCert":0,"ArangoDBClient\\ConnectionTest::testSetCiphers":0,"ArangoDBClient\\ConnectionTest::testSetHostOption":0,"ArangoDBClient\\ConnectionTest::testSetPortOption":0,"ArangoDBClient\\ConnectionTest::testGetSetDatabase":0,"ArangoDBClient\\ConnectionTest::testSetTimeoutException":3.001,"ArangoDBClient\\ConnectionTest::testSetTimeout":1.003,"ArangoDBClient\\ConnectionTest::testSetConnectTimeout":1.004,"ArangoDBClient\\ConnectionTest::testSetRequestTimeoutException":2.005,"ArangoDBClient\\ConnectionTest::testSetRequestTimeout":1.007,"ArangoDBClient\\ConnectionTest::testConnectionClose":0.001,"ArangoDBClient\\ConnectionTest::testConnectionKeepAlive":0.001,"ArangoDBClient\\ConnectionTest::testAuthentication":0.001,"ArangoDBClient\\ConnectionTest::testBasicTracer":0.002,"ArangoDBClient\\ConnectionTest::testEnhancedTracer":0.01,"ArangoDBClient\\CustomDocumentClassTest::testGetCustomDocumentWithHandler":0.007,"ArangoDBClient\\CustomDocumentClassTest::testGetCustomDocumentWithStatement":0.007,"ArangoDBClient\\CustomDocumentClassTest::testGetCustomDocumentWithBatch":0.01,"ArangoDBClient\\CustomEdgeClassTest::testGetCustomEdgeWithHandler":0.008,"ArangoDBClient\\DatabaseTest::testCreateDatabaseWithUnicodeName":0.005,"ArangoDBClient\\DatabaseTest::testCreateDatabaseWithUnicodeNameNormalization":0.004,"ArangoDBClient\\DatabaseTest::testCreateDatabaseDeleteIt":0.045,"ArangoDBClient\\DatabaseTest::testCreateDatabaseGetListOfDatabasesAndDeleteItAgain":0.032,"ArangoDBClient\\DatabaseTest::testCreateDatabaseGetInfoOfDatabasesAndDeleteItAgain":0.021,"ArangoDBClient\\DatabaseTest::testCreateDatabaseWithOptions":0.001,"ArangoDBClient\\DatabaseTest::testCreateDatabaseWithMoreOptions":0.001,"ArangoDBClient\\DatabaseTest::testDeleteNonExistentDatabase":0.001,"ArangoDBClient\\DatabaseTest::testCreateDatabaseSwitchToItAndCreateAnotherOne":0.019,"ArangoDBClient\\DocumentBasicTest::testInitializeDocument":0.002,"ArangoDBClient\\DocumentBasicTest::testInsertSilent":0.002,"ArangoDBClient\\DocumentBasicTest::testInsertSilentWithError":0.002,"ArangoDBClient\\DocumentBasicTest::testInsertReturnNew":0.002,"ArangoDBClient\\DocumentBasicTest::testInsertMany":0.002,"ArangoDBClient\\DocumentBasicTest::testInsertManyReturnNew":0.002,"ArangoDBClient\\DocumentBasicTest::testInsertManySilent":0.002,"ArangoDBClient\\DocumentBasicTest::testInsertManyWithErrors":0.002,"ArangoDBClient\\DocumentBasicTest::testInsertManySilentWithErrors":0.002,"ArangoDBClient\\DocumentBasicTest::testInsertManyLarge":0.092,"ArangoDBClient\\DocumentBasicTest::testInsertManyEmpty":0.001,"ArangoDBClient\\DocumentBasicTest::testInsertOverwrite":0.002,"ArangoDBClient\\DocumentBasicTest::testInsertOverwriteMode":0.002,"ArangoDBClient\\DocumentBasicTest::testCreateAndDeleteDocumentWithId":0.001,"ArangoDBClient\\DocumentBasicTest::testCreateAndDeleteDocument":0.001,"ArangoDBClient\\DocumentBasicTest::testCreateAndDeleteDocumentSilent":0.001,"ArangoDBClient\\DocumentBasicTest::testDeleteDocumentSilentWithError":0.001,"ArangoDBClient\\DocumentBasicTest::testCreateAndDeleteDocumentWithoutCreatedCollection":0.002,"ArangoDBClient\\DocumentBasicTest::testCreateAndDeleteDocumentWithoutCreatedCollectionAndOptionCreate":0.002,"ArangoDBClient\\DocumentBasicTest::testCreateAndDeleteDocumentUsingDefinedKey":0.001,"ArangoDBClient\\DocumentBasicTest::testCreateAndDeleteDocumentWithSeveralKeys":0.03,"ArangoDBClient\\DocumentBasicTest::testCreateDocumentWithInvalidKeys":0.001,"ArangoDBClient\\DocumentBasicTest::testCreateAndDeleteDocumentWithArray":0.001,"ArangoDBClient\\DocumentBasicTest::testCreateGetAndDeleteDocumentWithRevision":0.003,"ArangoDBClient\\DocumentBasicTest::testCreateHeadAndDeleteDocumentWithRevision":0.001,"ArangoDBClient\\DocumentBasicTest::testCreateAndDeleteDocumentUsingDefinedKeyWithArrayAndSaveOnly":0.001,"ArangoDBClient\\DocumentBasicTest::testCreateAndVerifyValidJsonIsReturnedWhenCastToString":0.001,"ArangoDBClient\\DocumentBasicTest::testHasDocumentReturnsFalseIfDocumentDoesNotExist":0.001,"ArangoDBClient\\DocumentBasicTest::testHasDocumentReturnsTrueIfDocumentExists":0.001,"ArangoDBClient\\DocumentExtendedTest::testCreateDocumentWithCreateFromArrayGetAndDeleteDocument":0.001,"ArangoDBClient\\DocumentExtendedTest::testCreateDocumentWithCreateFromArrayGetByExampleAndDeleteDocument":0.002,"ArangoDBClient\\DocumentExtendedTest::testCreateDocumentWithCreateFromArrayGetByExampleWithOptionsAndDeleteDocument":0.02,"ArangoDBClient\\DocumentExtendedTest::testCreateDocumentWithCreateFromArrayGetFirstExampleAndDeleteDocument":0.009,"ArangoDBClient\\DocumentExtendedTest::testUpdateDocument":0.008,"ArangoDBClient\\DocumentExtendedTest::testUpdateDocumentMergeObjects":0.007,"ArangoDBClient\\DocumentExtendedTest::testUpdateDocumentDoNotMergeObjects":0.007,"ArangoDBClient\\DocumentExtendedTest::testUpdateDocumentDoNotKeepNull":0.007,"ArangoDBClient\\DocumentExtendedTest::testUpdateDocumentReturnOldNew":0.006,"ArangoDBClient\\DocumentExtendedTest::testUpdateDocumentSilent":0.006,"ArangoDBClient\\DocumentExtendedTest::testUpdateDocumentSilentWithError":0.005,"ArangoDBClient\\DocumentExtendedTest::testReplaceDocument":0.007,"ArangoDBClient\\DocumentExtendedTest::testReplaceDocumentReturnOldNew":0.005,"ArangoDBClient\\DocumentExtendedTest::testReplaceDocumentSilent":0.005,"ArangoDBClient\\DocumentExtendedTest::testReplaceDocumentSilentWithError":0.004,"ArangoDBClient\\DocumentExtendedTest::testDeleteDocumentWithDeleteByIdWithoutRevision":0.004,"ArangoDBClient\\DocumentExtendedTest::testDeleteDocumentWithDeleteByIdWithRevisionAndPolicyIsError":0.003,"ArangoDBClient\\DocumentExtendedTest::testDeleteDocumentWithDeleteByIdWithRevisionAndPolicyIsLast":0.002,"ArangoDBClient\\DocumentExtendedTest::testRemoveDocumentReturnOld":0.002,"ArangoDBClient\\DocumentExtendedTest::testCreateUpdateGetAndDeleteDocumentWithRevisionCheck":0.004,"ArangoDBClient\\DocumentExtendedTest::testMoreCreateUpdateGetAndDeleteDocumentWithRevisionCheck":0.004,"ArangoDBClient\\DocumentExtendedTest::testCreateSetNullAttributeUpdateGetAndDeleteDocumentWithRevisionCheck":0.003,"ArangoDBClient\\DocumentExtendedTest::testGetAll":0.001,"ArangoDBClient\\DocumentExtendedTest::testHiddenAttributesGetAll":0.002,"ArangoDBClient\\DocumentExtendedTest::testGetReplaceUpdateAndRemoveOnNonExistentObjects":0.003,"ArangoDBClient\\DocumentExtendedTest::testStoreNewDocumentThenReplace":0.001,"ArangoDBClient\\EdgeBasicTest::testInitializeEdge":0.002,"ArangoDBClient\\EdgeBasicTest::testCreateAndDeleteEdge":0.006,"ArangoDBClient\\EdgeBasicTest::testCreateAndDeleteEdgeWithoutCreatedEdgeCollection":0.006,"ArangoDBClient\\EdgeBasicTest::testCreateGetAndDeleteEdgeWithRevision":0.003,"ArangoDBClient\\EdgeBasicTest::testCreateHeadAndDeleteEdgeWithRevision":0.003,"ArangoDBClient\\EdgeBasicTest::testGetAllIds":0.003,"ArangoDBClient\\EdgeBasicTest::testEdges":0.004,"ArangoDBClient\\EdgeBasicTest::testEdgesAny":0.004,"ArangoDBClient\\EdgeBasicTest::testEdgesIn":0.004,"ArangoDBClient\\EdgeBasicTest::testEdgesOut":0.004,"ArangoDBClient\\EdgeBasicTest::testEdgesBatched":0.004,"ArangoDBClient\\EdgeExtendedTest::testGetReplaceUpdateAndRemoveOnNonExistentObjects":0.004,"ArangoDBClient\\EdgeExtendedTest::testUpdateEdge":0.004,"ArangoDBClient\\EdgeExtendedTest::testUpdateEdgeDoNotKeepNull":0.003,"ArangoDBClient\\EdgeExtendedTest::testReplaceEdge":0.005,"ArangoDBClient\\FoxxBasicTest::testUploadAndInstallFoxxApp":0.188,"ArangoDBClient\\FoxxBasicTest::testUploadAndInstallNonExistingFoxxApp":0.003,"ArangoDBClient\\GeneralGraphExtendedTest::testsaveGetUpdateReplaceRemoveVertex":0.014,"ArangoDBClient\\GeneralGraphExtendedTest::testsaveGetUpdateReplaceRemoveEdge":0.012,"ArangoDBClient\\GraphBasicTest::testCreateAndDeleteGraphsWithDefinitions":0.008,"ArangoDBClient\\GraphBasicTest::testCreationOfGraphObject":0.001,"ArangoDBClient\\GraphBasicTest::testCreateAndDeleteGraphByName":0.003,"ArangoDBClient\\GraphBasicTest::testCreateRetrieveAndDeleteGraph1":0.003,"ArangoDBClient\\GraphBasicTest::testGetPropertiesAndDeleteGraphByInstance":0.003,"ArangoDBClient\\GraphBasicTest::testGetNonExistingGraph":0.001,"ArangoDBClient\\GraphBasicTest::testAddGetDeleteCollections":0.006,"ArangoDBClient\\GraphBasicTest::testAddGetDeleteCollectionsWithCache":0.008,"ArangoDBClient\\GraphBasicTest::testAddGetDeleteEdgeCollections":0.007,"ArangoDBClient\\GraphExtendedTest::testSaveVerticesAndEdgeBetweenThemAndRemoveOneByOne":0.007,"ArangoDBClient\\GraphExtendedTest::testSaveVerticesAndEdgeBetweenThemAndRemoveOneByOneWithCache":0.007,"ArangoDBClient\\GraphExtendedTest::testSaveVerticesAndEdgeBetweenThemAndRemoveFirstVertexFirst":0.009,"ArangoDBClient\\GraphExtendedTest::testGetReplaceUpdateAndRemoveOnNonExistentObjects":0.006,"ArangoDBClient\\GraphExtendedTest::testSaveVertexReplaceUpdateAndRemove":0.007,"ArangoDBClient\\GraphExtendedTest::testSaveVertexConditionalReplaceUpdateAndRemove":0.006,"ArangoDBClient\\GraphExtendedTest::testSaveVerticesAndSaveReplaceUpdateAndRemoveEdge":0.009,"ArangoDBClient\\GraphExtendedTest::testSaveVerticesAndConditionalSaveReplaceUpdateAndRemoveEdge":0.008,"ArangoDBClient\\GraphExtendedTest::testSaveVerticesFromVertexHandlerAndEdgeFromEdgeHandlerBetweenThemAndRemoveFirstVertexFirst":0.005,"ArangoDBClient\\GraphExtendedTest::testSaveVertexWithGraphInstance":0.002,"ArangoDBClient\\GraphExtendedTest::testGetVertexWithGraphInstance":0.006,"ArangoDBClient\\GraphExtendedTest::testReplaceVertexWithGraphInstance":0.006,"ArangoDBClient\\GraphExtendedTest::testUpdateVertexWithGraphInstance":0.007,"ArangoDBClient\\GraphExtendedTest::testRemoveVertexWithGraphInstance":0.007,"ArangoDBClient\\GraphExtendedTest::testSaveEdgeWithGraphInstance":0.006,"ArangoDBClient\\GraphExtendedTest::testGetEdgeWithGraphInstance":0.006,"ArangoDBClient\\GraphExtendedTest::testReplaceEdgeWithGraphInstance":0.007,"ArangoDBClient\\GraphExtendedTest::testUpdateEdgeWithGraphInstance":0.007,"ArangoDBClient\\GraphExtendedTest::testRemoveEdgeWithGraphInstance":0.007,"ArangoDBClient\\GraphExtendedTest::testHasVertexReturnsFalseIfNotExists":0.003,"ArangoDBClient\\GraphExtendedTest::testHasVertexReturnsTrueIfExists":0.007,"ArangoDBClient\\GraphExtendedTest::testHasEdgeReturnsFalseIfNotExists":0.003,"ArangoDBClient\\GraphExtendedTest::testHasEdgeReturnsTrueIfExists":0.007,"ArangoDBClient\\QueryCacheTest::testClear":0.025,"ArangoDBClient\\QueryCacheTest::testGetEntries":0.02,"ArangoDBClient\\QueryCacheTest::testEnable":0.021,"ArangoDBClient\\QueryCacheTest::testEnabledButExplicitlyDisabledForQuery":0.02,"ArangoDBClient\\QueryCacheTest::testDisable":0.021,"ArangoDBClient\\QueryCacheTest::testDemandModeUsed1":0.02,"ArangoDBClient\\QueryCacheTest::testDemandModeUsed2":0.021,"ArangoDBClient\\QueryCacheTest::testDemandModeUnused":0.021,"ArangoDBClient\\QueryTest::testCurrentAndKill":3.002,"ArangoDBClient\\QueryTest::testGetSlowEmpty":0.001,"ArangoDBClient\\QueryTest::testGetSlow":10.006,"ArangoDBClient\\QueryTest::testTimeoutException":10.009,"ArangoDBClient\\StatementTest::testExecuteStatement":0.004,"ArangoDBClient\\StatementTest::testStatementReturnNoWarnings":0.002,"ArangoDBClient\\StatementTest::testStatementReturnWarnings":0.002,"ArangoDBClient\\StatementTest::testStatementFailOnWarning":0.002,"ArangoDBClient\\StatementTest::testStatementFailWithMemoryLimit":0.006,"ArangoDBClient\\StatementTest::testStatisticsPeakMemoryUsage":0.004,"ArangoDBClient\\StatementTest::testStatisticsExecutionTime":3.014,"ArangoDBClient\\StatementTest::testStatisticsInsert":0.036,"ArangoDBClient\\StatementTest::testStatisticsSelectRemove":0.014,"ArangoDBClient\\StatementTest::testStatisticsSelect":0.015,"ArangoDBClient\\StatementTest::testExplainStatement":0.002,"ArangoDBClient\\StatementTest::testValidateStatement":0.002,"ArangoDBClient\\StatementTest::testExecuteStatementFlat":0.001,"ArangoDBClient\\StatementTest::testStatementThatReturnsScalarResponses":0.002,"ArangoDBClient\\StatementTest::testStatementWithFullCount":0.002,"ArangoDBClient\\StatementTest::testTtl":8.017,"ArangoDBClient\\StatementTest::testMemoryLimit":0.145,"ArangoDBClient\\StatementTest::testMaxRuntime":2.108,"ArangoDBClient\\StatementTest::testProfiling":0.019,"ArangoDBClient\\StatementTest::testStatementStreaming":0.066,"ArangoDBClient\\StatementTest::testBindReservedValue":0.003,"ArangoDBClient\\StatementTest::testBindReservedName":0.002,"ArangoDBClient\\StatementTest::testCacheAttributeTrue":0.001,"ArangoDBClient\\StatementTest::testCacheAttributeFalse":0.001,"ArangoDBClient\\StatementTest::testCacheAttributeNull":0.001,"ArangoDBClient\\StatementTest::testCacheAttributeNotSet":0.001,"ArangoDBClient\\StreamingTransactionTest::testCreateTransaction":0.003,"ArangoDBClient\\StreamingTransactionTest::testCreateAndAbortTransaction":0.002,"ArangoDBClient\\StreamingTransactionTest::testCreateAndAbortTransactionById":0.002,"ArangoDBClient\\StreamingTransactionTest::testCreateAndCommitTransaction":0.002,"ArangoDBClient\\StreamingTransactionTest::testCreateAndCommitTransactionById":0.002,"ArangoDBClient\\StreamingTransactionTest::testCreateAndGetStatusTransaction":0.002,"ArangoDBClient\\StreamingTransactionTest::testCreateAndGetStatusTransactionById":0.002,"ArangoDBClient\\StreamingTransactionTest::testGetStatusForNonExistingTransaction":0.002,"ArangoDBClient\\StreamingTransactionTest::testCreateWithCollections":0.003,"ArangoDBClient\\StreamingTransactionTest::testCreateWithCollectionsAndModes":0.002,"ArangoDBClient\\StreamingTransactionTest::testGetCollection":0.002,"ArangoDBClient\\StreamingTransactionTest::testInsert":0.002,"ArangoDBClient\\StreamingTransactionTest::testRemove":0.003,"ArangoDBClient\\StreamingTransactionTest::testUpdate":0.003,"ArangoDBClient\\StreamingTransactionTest::testReplace":0.003,"ArangoDBClient\\StreamingTransactionTest::testTruncate":0.011,"ArangoDBClient\\StreamingTransactionTest::testQuery":0.004,"ArangoDBClient\\StreamingTransactionTest::testCommitAndthenCommitTransaction":0.003,"ArangoDBClient\\StreamingTransactionTest::testCommitAndthenAbortTransaction":0.002,"ArangoDBClient\\StreamingTransactionTest::testAbortAndthenAbortTransaction":0.002,"ArangoDBClient\\StreamingTransactionTest::testAbortAndthenCommitTransaction":0.002,"ArangoDBClient\\TransactionTest::testCreateAndExecuteTransactionWithArrayInitialization":0.008,"ArangoDBClient\\TransactionTest::testCreateAndExecuteTransactionWithMagicGettersSetters":0.012,"ArangoDBClient\\TransactionTest::testCreateAndExecuteTransactionWithMagicGettersSettersAndSingleCollectionDefinitionsAsStrings":0.018,"ArangoDBClient\\TransactionTest::testCreateAndExecuteTransactionWithGettersSetters":0.01,"ArangoDBClient\\TransactionTest::testCreateAndExecuteTransactionExclusiveWithGettersSetters":0.01,"ArangoDBClient\\TransactionTest::testCreateAndExecuteTransactionWithReturnValue":0.006,"ArangoDBClient\\TransactionTest::testCreateAndExecuteTransactionWithTransactionException":0.005,"ArangoDBClient\\TransactionTest::testCreateAndExecuteTransactionWithTransactionErrorUniqueConstraintOnSave":0.004,"ArangoDBClient\\TraversalTest::testTraversalUsingDirectionOutbound":0.014,"ArangoDBClient\\TraversalTest::testTraversalUsingDirectionInbound":0.008,"ArangoDBClient\\TraversalTest::testTraversalUsingDirectionAnyAndUniquenessWithVerticesNoneAndEdgesGlobal":0.009,"ArangoDBClient\\TraversalTest::testTraversalUsingDirectionOutboundAndFilter1":0.008,"ArangoDBClient\\TraversalTest::testTraversalUsingDirectionOutboundAndFilter2":0.007,"ArangoDBClient\\TraversalTest::testTraversalUsingDirectionOutboundAndMinDepthIs2":0.008,"ArangoDBClient\\TraversalTest::testTraversalUsingDirectionOutboundAndMaxDepthIs1":0.007,"ArangoDBClient\\TraversalTest::testTraversalCountVisitedNodesAndReturnListOfNodesOnly":0.007,"ArangoDBClient\\TraversalTest::testTraversalExpandOnlyInboundOfAliceAndOutboundOfEve":0.008,"ArangoDBClient\\TraversalTest::testTraversalFollowDepthFirstStrategy":0.01,"ArangoDBClient\\TraversalTest::testTraversalUsingPostOrderOrdering":0.01,"ArangoDBClient\\TraversalTest::testTraversalUsingBackwardItemOrdering":0.01,"ArangoDBClient\\TraversalTest::testTraversalIncludeEdgesOnlyOnceGloballyButNodesEveryTimeVisited":0.008,"ArangoDBClient\\TraversalTest::testTraversalTooManyIterations":0.009,"ArangoDBClient\\UserBasicTest::testGrantPermissions":0.003,"ArangoDBClient\\UserBasicTest::testGrantAndRevokePermissions":0.002,"ArangoDBClient\\UserBasicTest::testGrantDatabasePermissions":0.002,"ArangoDBClient\\UserBasicTest::testGrantAndRevokeDatabasePermissions":0.001,"ArangoDBClient\\UserBasicTest::testGrantCollectionPermissions":0.002,"ArangoDBClient\\UserBasicTest::testGrantAndRevokeCollectionPermissions":0.001,"ArangoDBClient\\UserBasicTest::testAddReplaceUpdateGetAndDeleteUserWithNullValues":0.002,"ArangoDBClient\\UserBasicTest::testAddReplaceUpdateGetAndDeleteUserWithNonNullValues":0.001,"ArangoDBClient\\UserBasicTest::testFunctionsOnNonExistentUser":0.001,"ArangoDBClient\\ViewTest::testCreateViewObject":0.001,"ArangoDBClient\\ViewTest::testCreateView":0.001,"ArangoDBClient\\ViewTest::testGetView":0.001,"ArangoDBClient\\ViewTest::testGetNonExistingView":0,"ArangoDBClient\\ViewTest::testViewProperties":0,"ArangoDBClient\\ViewTest::testViewSetProperties":0.005,"ArangoDBClient\\ViewTest::testDropView":0.001,"ArangoDBClient\\ViewTest::testDropNonExistingView":0.001,"ArangoDBClient\\ViewTest::testRenameView":0.001,"ArangoDBClient\\ViewTest::testRenameNonExistingView":0.001,"ArangoDBClient\\CollectionBasicTest::testCreateZkdIndex":0.002,"ArangoDBClient\\CollectionBasicTest::testCreateZkdIndexGeneric":0.002}}
\ No newline at end of file
diff --git a/tests/AdminTest.php b/tests/AdminTest.php
index 1d368fa2..53302a08 100644
--- a/tests/AdminTest.php
+++ b/tests/AdminTest.php
@@ -98,6 +98,68 @@ public function testGetServerTime()
}
+ /**
+ * Test if we can get the server log levels
+ */
+ public function testGetServerLogLevels()
+ {
+ $result = $this->adminHandler->getServerLogLevels();
+ static::assertTrue(is_array($result));
+
+ $levels = ["TRACE", "DEBUG", "INFO", "WARNING", "ERROR", "FATAL", "DEFAULT"];
+ static::assertGreaterThan(0, count($result));
+ foreach ($result as $topic => $level) {
+ static::assertContains($level, $levels);
+ }
+ // check a few well-known log topics
+ static::assertArrayHasKey('aql', $result);
+ static::assertArrayHasKey('threads', $result);
+ }
+
+
+ /**
+ * Test if we can set the server log levels
+ */
+ public function testSetServerLogLevels()
+ {
+ $old = $this->adminHandler->getServerLogLevels();
+
+ $levels = ["TRACE", "DEBUG", "INFO", "WARNING", "ERROR", "FATAL", "DEFAULT"];
+ try {
+ $new = ["aql" => "TRACE", "threads" => "debug"];
+
+ $result = $this->adminHandler->setServerLogLevels($new);
+ static::assertTrue(is_array($result));
+ static::assertGreaterThan(0, count($result));
+ foreach ($result as $topic => $level) {
+ static::assertContains($level, $levels);
+ }
+ static::assertEquals("TRACE", $result["aql"]);
+ static::assertEquals("DEBUG", $result["threads"]);
+
+ $new = ["all" => "INFO"];
+ $result = $this->adminHandler->setServerLogLevels($new);
+ static::assertTrue(is_array($result));
+ static::assertGreaterThan(0, count($result));
+ foreach ($result as $topic => $level) {
+ // everything must be INFO now
+ static::assertEquals("INFO", $level);
+ }
+
+ $result = $this->adminHandler->setServerLogLevels($old);
+ static::assertTrue(is_array($result));
+ static::assertGreaterThan(0, count($result));
+ foreach ($result as $topic => $level) {
+ static::assertEquals($old[$topic], $level);
+ }
+ } catch (\Exception $e) {
+ $this->adminHandler->setServerLogLevels($old);
+ static::assertTrue(false, "should not end up here");
+ }
+
+ }
+
+
/**
* Test if we can get the server log
* Rather dumb tests just checking that an array is returned
diff --git a/tests/AnalyzerTest.php b/tests/AnalyzerTest.php
index beb38ccc..d4a43e4d 100644
--- a/tests/AnalyzerTest.php
+++ b/tests/AnalyzerTest.php
@@ -43,7 +43,7 @@ public function testCreateAnalyzerObject()
$analyzer = new Analyzer('Analyzer1' . '_' . static::$testsTimestamp, 'text', [ "locale" => "en.UTF-8", "stopwords" => [] ]);
static::assertEquals('Analyzer1' . '_' . static::$testsTimestamp, $analyzer->getName());
static::assertEquals('text', $analyzer->getType());
- static::assertEquals([ "locale" => "en.UTF-8", "stopwords" => [] ],$analyzer->getProperties());
+ static::assertEquals([ "locale" => "en.UTF-8", "stopwords" => [] ], $analyzer->getProperties());
static::assertEquals([], $analyzer->getFeatures());
}
@@ -69,7 +69,7 @@ public function testCreateTextAnalyzer()
$result = $this->analyzerHandler->create($analyzer);
static::assertEquals('Analyzer1' . '_' . static::$testsTimestamp, $result['name']);
static::assertEquals('text', $result['type']);
- static::assertEquals([ "locale" => "en.UTF-8", "stopwords" => [] ],$analyzer->getProperties());
+ static::assertEquals([ "locale" => "en.UTF-8", "stopwords" => [] ], $analyzer->getProperties());
static::assertEquals([], $analyzer->getFeatures());
}
@@ -85,21 +85,76 @@ public function testCreateTextAnalyzerFail()
}
static::assertEquals(400, $exception->getCode());
}
+
+
+ /**
+ * Test creation of segmentation analyzer
+ */
+ public function testCreateSegmentationAnalyzer()
+ {
+ $analyzer = new Analyzer('Analyzer1' . '_' . static::$testsTimestamp, 'segmentation', [ "break" => "alpha" ]);
+ $result = $this->analyzerHandler->create($analyzer);
+ static::assertEquals('Analyzer1' . '_' . static::$testsTimestamp, $result['name']);
+ static::assertEquals('segmentation', $result['type']);
+ static::assertEquals('alpha', $result['properties']['break']);
+ static::assertEquals([], $analyzer->getFeatures());
+ }
+
+
+ /**
+ * Test creation of collation analyzer
+ */
+ public function testCreateCollationAnalyzer()
+ {
+ $analyzer = new Analyzer('Analyzer1' . '_' . static::$testsTimestamp, 'collation', [ "locale" => "en.utf-8" ]);
+ $result = $this->analyzerHandler->create($analyzer);
+ static::assertEquals('Analyzer1' . '_' . static::$testsTimestamp, $result['name']);
+ static::assertEquals('collation', $result['type']);
+ static::assertEquals('en.utf-8', $result['properties']['locale']);
+ static::assertEquals([], $analyzer->getFeatures());
+ }
+
+
+ /**
+ * Test creation of geopoint analyzer
+ */
+ public function testCreateGeoPointAnalyzer()
+ {
+ $options = [ ]; //"maxCells" => 20, "minLevel" => 4, "maxLevel" => 40 ];
+ $analyzer = new Analyzer('Analyzer1' . '_' . static::$testsTimestamp, 'geopoint', [ "latitude" => ["lat"], "longitude" => ["lng"] ]);
+ $result = $this->analyzerHandler->create($analyzer);
+ static::assertEquals('Analyzer1' . '_' . static::$testsTimestamp, $result['name']);
+ static::assertEquals('geopoint', $result['type']);
+ static::assertEquals(['lat'], $result['properties']['latitude']);
+ static::assertEquals(['lng'], $result['properties']['longitude']);
+ static::assertEquals([], $analyzer->getFeatures());
+ }
+
+ /**
+ * Test creation of geojson analyzer
+ */
+ public function testCreateGeoJsonAnalyzer()
+ {
+ $analyzer = new Analyzer('Analyzer1' . '_' . static::$testsTimestamp, 'geojson', [ "type" => "point" ]);
+ $result = $this->analyzerHandler->create($analyzer);
+ static::assertEquals('Analyzer1' . '_' . static::$testsTimestamp, $result['name']);
+ static::assertEquals('geojson', $result['type']);
+ static::assertEquals('point', $result['properties']['type']);
+ static::assertEquals([], $analyzer->getFeatures());
+ }
/**
* Test creation of stopwords analyzer
*/
- /* disabled until 3.8.1
public function testCreateStopwordsAnalyzer()
{
$analyzer = new Analyzer('Analyzer1' . '_' . static::$testsTimestamp, 'stopwords', [ "stopwords" => ["foo", "bar", "baz", "dead"] ]);
$result = $this->analyzerHandler->create($analyzer);
static::assertEquals('Analyzer1' . '_' . static::$testsTimestamp, $result['name']);
static::assertEquals('stopwords', $result['type']);
- static::assertEquals([ "stopwords" => ["foo", "bar", "baz", "dead"] ],$analyzer->getProperties());
+ static::assertEquals([ "stopwords" => ["foo", "bar", "baz", "dead"] ], $analyzer->getProperties());
static::assertEquals([], $analyzer->getFeatures());
}
- */
/**
* Test creation of delimiter analyzer
@@ -110,7 +165,7 @@ public function testCreateDelimiterAnalyzer()
$result = $this->analyzerHandler->create($analyzer);
static::assertEquals('Analyzer1' . '_' . static::$testsTimestamp, $result['name']);
static::assertEquals('delimiter', $result['type']);
- static::assertEquals([ "delimiter" => " " ],$analyzer->getProperties());
+ static::assertEquals([ "delimiter" => " " ], $analyzer->getProperties());
static::assertEquals([], $analyzer->getFeatures());
}
@@ -123,14 +178,13 @@ public function testCreateNormAnalyzer()
$result = $this->analyzerHandler->create($analyzer);
static::assertEquals('Analyzer1' . '_' . static::$testsTimestamp, $result['name']);
static::assertEquals('norm', $result['type']);
- static::assertEquals([ "locale" => "en.UTF-8", "accent" => false, "case" => "lower" ],$analyzer->getProperties());
+ static::assertEquals([ "locale" => "en.UTF-8", "accent" => false, "case" => "lower" ], $analyzer->getProperties());
static::assertEquals([], $analyzer->getFeatures());
}
/**
* Test creation of pipeline analyzer
*/
- /* disabled until 3.8.1
public function testCreatePipelineAnalyzer()
{
$data = [ "pipeline" => [
@@ -147,7 +201,6 @@ public function testCreatePipelineAnalyzer()
static::assertEquals($data, $analyzer->getProperties());
static::assertEquals([], $analyzer->getFeatures());
}
- */
/**
* Test getting an analyzer
@@ -160,7 +213,7 @@ public function testGetAnalyzer()
$result = $this->analyzerHandler->get('Analyzer1' . '_' . static::$testsTimestamp);
static::assertEquals('_system::Analyzer1' . '_' . static::$testsTimestamp, $result->getName());
static::assertEquals('text', $result->getType());
- static::assertEquals([ "locale" => "en.UTF-8", "stopwords" => [] ],$analyzer->getProperties());
+ static::assertEquals([ "locale" => "en.UTF-8", "stopwords" => [] ], $analyzer->getProperties());
static::assertEquals([], $analyzer->getFeatures());
}
@@ -252,13 +305,13 @@ public function testAnalyzerProperties()
$result = $this->analyzerHandler->create($analyzer);
static::assertEquals('Analyzer2' . '_' . static::$testsTimestamp, $result['name']);
static::assertEquals('text', $result['type']);
- static::assertEquals([ "locale" => "en.UTF-8", "stopwords" => [] ],$analyzer->getProperties());
+ static::assertEquals([ "locale" => "en.UTF-8", "stopwords" => [] ], $analyzer->getProperties());
static::assertEquals([], $analyzer->getFeatures());
$result = $this->analyzerHandler->properties($analyzer);
static::assertEquals('_system::Analyzer2' . '_' . static::$testsTimestamp, $result['name']);
static::assertEquals('text', $result['type']);
- static::assertEquals([ "locale" => "en.UTF-8", "stopwords" => [] ],$analyzer->getProperties());
+ static::assertEquals([ "locale" => "en.UTF-8", "stopwords" => [] ], $analyzer->getProperties());
static::assertEquals([], $analyzer->getFeatures());
}
diff --git a/tests/CollectionBasicTest.php b/tests/CollectionBasicTest.php
index 32b76928..4ea9f01b 100644
--- a/tests/CollectionBasicTest.php
+++ b/tests/CollectionBasicTest.php
@@ -1055,6 +1055,69 @@ public function testCreateFulltextIndex()
static::assertEquals('fulltextfield', $indexInfo['fields'][0], "The indexed field is not 'fulltextfield'");
static::assertEquals(5, $indexInfo[CollectionHandler::OPTION_MIN_LENGTH], 'minLength was not set to 5!');
}
+
+
+ /**
+ * Create a zkd index and verify it by getting information about the index from the server
+ */
+ public function testCreateZkdIndex()
+ {
+ $result = $this->collectionHandler->createZkdIndex(
+ 'ArangoDB_PHP_TestSuite_IndexTestCollection' . '_' . static::$testsTimestamp,
+ ['zkdfield1', 'zkdfield2'],
+ true
+ );
+
+ $indices = $this->collectionHandler->getIndexes('ArangoDB_PHP_TestSuite_IndexTestCollection' . '_' . static::$testsTimestamp);
+
+ $indicesByIdentifiers = $indices['identifiers'];
+
+ static::assertArrayHasKey($result['id'], $indicesByIdentifiers);
+
+ $indexInfo = $indicesByIdentifiers[$result['id']];
+
+ static::assertEquals(
+ CollectionHandler::OPTION_ZKD_INDEX,
+ $indexInfo[CollectionHandler::OPTION_TYPE]
+ );
+ static::assertCount(2, $indexInfo['fields']);
+ static::assertEquals('zkdfield1', $indexInfo['fields'][0]);
+ static::assertEquals('zkdfield2', $indexInfo['fields'][1]);
+ static::assertTrue($indexInfo[CollectionHandler::OPTION_UNIQUE]);
+ static::assertFalse($indexInfo[CollectionHandler::OPTION_SPARSE]);
+ }
+
+ /**
+ * Create a zkd index and verify it by getting information about the index from the server
+ */
+ public function testCreateZkdIndexGeneric()
+ {
+ $result = $this->collectionHandler->createIndex(
+ 'ArangoDB_PHP_TestSuite_IndexTestCollection' . '_' . static::$testsTimestamp, [
+ 'type' => 'zkd',
+ 'fields' => ['zkdfield1', 'zkdfield2'],
+ 'fieldValueTypes' => 'double',
+ ]
+ );
+
+ $indices = $this->collectionHandler->getIndexes('ArangoDB_PHP_TestSuite_IndexTestCollection' . '_' . static::$testsTimestamp);
+
+ $indicesByIdentifiers = $indices['identifiers'];
+
+ static::assertArrayHasKey($result['id'], $indicesByIdentifiers);
+
+ $indexInfo = $indicesByIdentifiers[$result['id']];
+
+ static::assertEquals(
+ CollectionHandler::OPTION_ZKD_INDEX,
+ $indexInfo[CollectionHandler::OPTION_TYPE]
+ );
+ static::assertCount(2, $indexInfo['fields']);
+ static::assertEquals('zkdfield1', $indexInfo['fields'][0]);
+ static::assertEquals('zkdfield2', $indexInfo['fields'][1]);
+ static::assertFalse($indexInfo[CollectionHandler::OPTION_UNIQUE]);
+ static::assertFalse($indexInfo[CollectionHandler::OPTION_SPARSE]);
+ }
/**
diff --git a/tests/DatabaseTest.php b/tests/DatabaseTest.php
index d2621a07..1af71028 100644
--- a/tests/DatabaseTest.php
+++ b/tests/DatabaseTest.php
@@ -45,6 +45,79 @@ public function setUp(): void
}
}
+
+ public function testCreateDatabaseWithUnicodeName()
+ {
+ if (!class_exists("\Normalizer", false)) {
+ $this->markTestSkipped("unable to find Normalizer class. maybe php-intl is not installed?");
+ return;
+ }
+
+ // try to create a database with Unicode name.
+ // this may fail if the server side is not configured to allow
+ // Unicode database names
+ $database = "tröt tröt tröt_" . static::$testsTimestamp;
+ try {
+ $response = Database::create($this->connection, $database);
+ } catch (ServerException $exception) {
+ // ERROR_ARANGO_DATABASE_NAME_INVALID,1229,"database name invalid","Will be raised when an invalid database name is used."
+ if ($exception->getServerCode() === 1229) {
+ $this->markTestSkipped("server was not started with extended database naming scheme");
+ return;
+ }
+ throw $exception;
+ }
+
+ $response = Database::listDatabases($this->connection);
+ static::assertArrayHasKey($database, array_flip($response['result']));
+ }
+
+
+ public function testCreateDatabaseWithUnicodeNameNormalization()
+ {
+ if (!class_exists("\Normalizer", false)) {
+ $this->markTestSkipped("unable to find Normalizer class. maybe php-intl is not installed?");
+ return;
+ }
+
+ $databases = [ "😀", "ﻚﻠﺑ ﻞﻄﻴﻓ", "かわいい犬" ];
+
+ // try to create a database with Unicode name.
+ // this may fail if the server side is not configured to allow
+ // Unicode database names
+ foreach ($databases as $database) {
+ $database = Database::normalizeName($database);
+
+ try {
+ Database::delete($this->connection, $database);
+ } catch (\Exception $ex) {
+ // try to get rid of existing databases first. ignore if it does not exist.
+ }
+
+ try {
+ $response = Database::create($this->connection, $database);
+ } catch (ServerException $exception) {
+ // ERROR_ARANGO_DATABASE_NAME_INVALID,1229,"database name invalid","Will be raised when an invalid database name is used."
+ if ($exception->getServerCode() === 1229) {
+ $this->markTestSkipped("server was not started with extended database naming scheme");
+ return;
+ }
+ throw $exception;
+ }
+
+ try {
+ $response = Database::listDatabases($this->connection);
+ static::assertArrayHasKey($database, array_flip($response['result']));
+
+ Database::delete($this->connection, $database);
+ } catch (\Exception $ex) {
+ // always clean up
+ Database::delete($this->connection, $database);
+ throw $ex;
+ }
+ }
+ }
+
/**
* Test if Databases can be created and deleted
*/
@@ -53,7 +126,6 @@ public function testCreateDatabaseDeleteIt()
$database = 'ArangoTestSuiteDatabaseTest01' . '_' . static::$testsTimestamp;
try {
- $e = null;
Database::delete($this->connection, $database);
} catch (\Exception $e) {
// don't bother us... just give us the $e
@@ -354,7 +426,11 @@ public function tearDown(): void
$this->connection->setDatabase('_system');
// clean up
- $databases = ['ArangoTestSuiteDatabaseTest01' . '_' . static::$testsTimestamp, 'ArangoTestSuiteDatabaseTest02' . '_' . static::$testsTimestamp];
+ $databases = [
+ 'ArangoTestSuiteDatabaseTest01' . '_' . static::$testsTimestamp,
+ 'ArangoTestSuiteDatabaseTest02' . '_' . static::$testsTimestamp,
+ 'tröt tröt tröt_' . static::$testsTimestamp,
+ ];
foreach ($databases as $database) {
try {
diff --git a/tests/GraphBasicTest.php b/tests/GraphBasicTest.php
index 32f6980e..40b77772 100644
--- a/tests/GraphBasicTest.php
+++ b/tests/GraphBasicTest.php
@@ -40,8 +40,248 @@ public function setUp(): void
$this->connection = getConnection();
$this->collectionHandler = new CollectionHandler($this->connection);
}
+
+
+ public function testInstantiateSmartGraphWithoutSmartGraphAttribute()
+ {
+ try {
+ new SmartGraph('Graph1' . '_' . static::$testsTimestamp);
+ static::assertTrue(false, "should not get here");
+ } catch (\Exception $e) {
+ static::assertInstanceOf(ClientException::class, $e);
+ }
+ }
+
+
+ public function testInstantiateRegularSmartGraphWithSmartGraphAttribute()
+ {
+ $graph = new SmartGraph('Graph1' . '_' . static::$testsTimestamp, [ "smartGraphAttribute" => "testi" ]);
+ static::assertEquals("testi", $graph->getSmartGraphAttribute());
+ static::assertTrue($graph->isSmart());
+ static::assertFalse($graph->isDisjoint());
+ }
+
+
+ public function testUnsetSmartnessOfSmartGraph()
+ {
+ $graph = new SmartGraph('Graph1' . '_' . static::$testsTimestamp, [ "smartGraphAttribute" => "testi" ]);
+ try {
+ $graph->setIsSmart(false);
+ static::assertTrue(false, "should not get here");
+ } catch (\Exception $e) {
+ static::assertInstanceOf(ClientException::class, $e);
+ }
+ }
+
+
+ public function testInstantiateDisjointSmartGraph()
+ {
+ $graph = new SmartGraph('Graph1' . '_' . static::$testsTimestamp, [ "smartGraphAttribute" => "testi", "isDisjoint" => true ]);
+ static::assertEquals("testi", $graph->getSmartGraphAttribute());
+ static::assertTrue($graph->isSmart());
+ static::assertTrue($graph->isDisjoint());
+ }
+
+
+ public function testCreateAndDeleteSmartRegularGraph()
+ {
+ if (!isCluster($this->connection)) {
+ // don't execute this test in a non-cluster
+ $this->markTestSkipped("test is only meaningful in cluster");
+ return;
+ }
+
+ if (!isEnterprise($this->connection)) {
+ // don't execute this test in community version
+ $this->markTestSkipped("test is only meaningful in enterprise version");
+ return;
+ }
+
+ $param1 = [];
+ $param1[] = 'lba' . '_' . static::$testsTimestamp;
+ $param1[] = 'blub' . '_' . static::$testsTimestamp;
+ $param2 = [];
+ $param2[] = 'bla' . '_' . static::$testsTimestamp;
+ $param2[] = 'blob' . '_' . static::$testsTimestamp;
+ $ed1 = EdgeDefinition::createDirectedRelation('directed' . '_' . static::$testsTimestamp, $param1, $param2);
+ $ed2 = EdgeDefinition::createUndirectedRelation('undirected' . '_' . static::$testsTimestamp, 'singleV' . '_' . static::$testsTimestamp);
+ $this->graph = new SmartGraph('Graph1' . '_' . static::$testsTimestamp, [ "smartGraphAttribute" => "testi" ]);
+ $this->graph->addEdgeDefinition($ed1);
+ $this->graph->addEdgeDefinition($ed2);
+ static::assertEquals("testi", $this->graph->getSmartGraphAttribute());
+ static::assertTrue($this->graph->isSmart());
+ static::assertFalse($this->graph->isDisjoint());
+ $this->graphHandler = new GraphHandler($this->connection);
+ $result = $this->graphHandler->createGraph($this->graph);
+ static::assertEquals('Graph1' . '_' . static::$testsTimestamp, $result['_key'], 'Did not return Graph1!');
+ $properties = $this->graphHandler->properties('Graph1' . '_' . static::$testsTimestamp);
+ static::assertEquals('Graph1' . '_' . static::$testsTimestamp, $properties['_key'], 'Did not return Graph1!');
+ static::assertTrue($properties['isSmart']);
+ static::assertFalse($properties['isDisjoint']);
+ static::assertEquals('testi', $properties['smartGraphAttribute']);
+ }
+
+
+ public function testCreateAndDeleteDisjointSmartGraph()
+ {
+ if (!isCluster($this->connection)) {
+ // don't execute this test in a non-cluster
+ $this->markTestSkipped("test is only meaningful in cluster");
+ return;
+ }
+
+ if (!isEnterprise($this->connection)) {
+ // don't execute this test in community version
+ $this->markTestSkipped("test is only meaningful in enterprise version");
+ return;
+ }
+
+ $param1 = [];
+ $param1[] = 'lba' . '_' . static::$testsTimestamp;
+ $param1[] = 'blub' . '_' . static::$testsTimestamp;
+ $param2 = [];
+ $param2[] = 'bla' . '_' . static::$testsTimestamp;
+ $param2[] = 'blob' . '_' . static::$testsTimestamp;
+ $ed1 = EdgeDefinition::createDirectedRelation('directed' . '_' . static::$testsTimestamp, $param1, $param2);
+ $ed2 = EdgeDefinition::createUndirectedRelation('undirected' . '_' . static::$testsTimestamp, 'singleV' . '_' . static::$testsTimestamp);
+ $this->graph = new SmartGraph('Graph1' . '_' . static::$testsTimestamp, [ "smartGraphAttribute" => "testi", "isDisjoint" => true ]);
+ $this->graph->addEdgeDefinition($ed1);
+ $this->graph->addEdgeDefinition($ed2);
+ static::assertEquals("testi", $this->graph->getSmartGraphAttribute());
+ static::assertTrue($this->graph->isSmart());
+ static::assertTrue($this->graph->isDisjoint());
+ $this->graphHandler = new GraphHandler($this->connection);
+ $result = $this->graphHandler->createGraph($this->graph);
+ static::assertEquals('Graph1' . '_' . static::$testsTimestamp, $result['_key'], 'Did not return Graph1!');
+ $properties = $this->graphHandler->properties('Graph1' . '_' . static::$testsTimestamp);
+ static::assertEquals('Graph1' . '_' . static::$testsTimestamp, $properties['_key'], 'Did not return Graph1!');
+ static::assertTrue($properties['isSmart']);
+ static::assertTrue($properties['isDisjoint']);
+ static::assertEquals('testi', $properties['smartGraphAttribute']);
+ }
+ public function testCreateAndDeleteHybridSmartGraph()
+ {
+ if (!isCluster($this->connection)) {
+ // don't execute this test in a non-cluster
+ $this->markTestSkipped("test is only meaningful in cluster");
+ return;
+ }
+
+ if (!isEnterprise($this->connection)) {
+ // don't execute this test in community version
+ $this->markTestSkipped("test is only meaningful in enterprise version");
+ return;
+ }
+
+ $param1 = [];
+ $param1[] = 'lba' . '_' . static::$testsTimestamp;
+ $param1[] = 'blub' . '_' . static::$testsTimestamp;
+ $param2 = [];
+ $param2[] = 'bla' . '_' . static::$testsTimestamp;
+ $param2[] = 'blob' . '_' . static::$testsTimestamp;
+ $ed1 = EdgeDefinition::createDirectedRelation('directed' . '_' . static::$testsTimestamp, $param1, $param2, ['directed_' . static::$testsTimestamp]);
+ $ed2 = EdgeDefinition::createUndirectedRelation('undirected' . '_' . static::$testsTimestamp, 'singleV' . '_' . static::$testsTimestamp);
+ $this->graph = new SmartGraph('Graph1' . '_' . static::$testsTimestamp, [ "smartGraphAttribute" => "testi" ]);
+ $this->graph->addEdgeDefinition($ed1);
+ $this->graph->addEdgeDefinition($ed2);
+
+ static::assertEquals("testi", $this->graph->getSmartGraphAttribute());
+ static::assertTrue($this->graph->isSmart());
+ static::assertFalse($this->graph->isDisjoint());
+ $this->graphHandler = new GraphHandler($this->connection);
+ $result = $this->graphHandler->createGraph($this->graph);
+ static::assertEquals('Graph1' . '_' . static::$testsTimestamp, $result['_key'], 'Did not return Graph1!');
+ $properties = $this->graphHandler->properties('Graph1' . '_' . static::$testsTimestamp);
+ static::assertEquals('Graph1' . '_' . static::$testsTimestamp, $properties['_key'], 'Did not return Graph1!');
+ static::assertTrue($properties['isSmart']);
+ static::assertFalse($properties['isDisjoint']);
+ static::assertEquals('testi', $properties['smartGraphAttribute']);
+ }
+
+
+ public function testCreateAndDeleteSatelliteGraph()
+ {
+ if (!isCluster($this->connection)) {
+ // don't execute this test in a non-cluster
+ $this->markTestSkipped("test is only meaningful in cluster");
+ return;
+ }
+
+ if (!isEnterprise($this->connection)) {
+ // don't execute this test in community version
+ $this->markTestSkipped("test is only meaningful in enterprise version");
+ return;
+ }
+
+ $param1 = [];
+ $param1[] = 'lba' . '_' . static::$testsTimestamp;
+ $param1[] = 'blub' . '_' . static::$testsTimestamp;
+ $param2 = [];
+ $param2[] = 'bla' . '_' . static::$testsTimestamp;
+ $param2[] = 'blob' . '_' . static::$testsTimestamp;
+ $ed1 = EdgeDefinition::createDirectedRelation('directed' . '_' . static::$testsTimestamp, $param1, $param2);
+ $ed2 = EdgeDefinition::createUndirectedRelation('undirected' . '_' . static::$testsTimestamp, 'singleV' . '_' . static::$testsTimestamp);
+ $this->graph = new Graph('Graph1' . '_' . static::$testsTimestamp, [ "replicationFactor" => "satellite" ]);
+ $this->graph->addEdgeDefinition($ed1);
+ $this->graph->addEdgeDefinition($ed2);
+ static::assertFalse($this->graph->isSmart());
+ static::assertFalse($this->graph->isDisjoint());
+ static::assertEquals(1, $this->graph->getNumberOfShards());
+ static::assertEquals("satellite", $this->graph->getReplicationFactor());
+ $this->graphHandler = new GraphHandler($this->connection);
+ $result = $this->graphHandler->createGraph($this->graph);
+ static::assertEquals('Graph1' . '_' . static::$testsTimestamp, $result['_key'], 'Did not return Graph1!');
+ $properties = $this->graphHandler->properties('Graph1' . '_' . static::$testsTimestamp);
+ static::assertEquals('Graph1' . '_' . static::$testsTimestamp, $properties['_key'], 'Did not return Graph1!');
+ static::assertFalse($properties['isSmart']);
+ static::assertTrue($properties['isSatellite']);
+ static::assertEquals("satellite", $properties['replicationFactor']);
+ static::assertEquals(1, $properties['numberOfShards']);
+ }
+
+
+ public function testCreateAndDeleteGraphWithClusterOptions()
+ {
+ if (!isCluster($this->connection)) {
+ // don't execute this test in a non-cluster
+ $this->markTestSkipped("test is only meaningful in cluster");
+ return;
+ }
+
+ if (!isEnterprise($this->connection)) {
+ // don't execute this test in community version
+ $this->markTestSkipped("test is only meaningful in enterprise version");
+ return;
+ }
+
+ $param1 = [];
+ $param1[] = 'lba' . '_' . static::$testsTimestamp;
+ $param1[] = 'blub' . '_' . static::$testsTimestamp;
+ $param2 = [];
+ $param2[] = 'bla' . '_' . static::$testsTimestamp;
+ $param2[] = 'blob' . '_' . static::$testsTimestamp;
+ $ed1 = EdgeDefinition::createDirectedRelation('directed' . '_' . static::$testsTimestamp, $param1, $param2);
+ $ed2 = EdgeDefinition::createUndirectedRelation('undirected' . '_' . static::$testsTimestamp, 'singleV' . '_' . static::$testsTimestamp);
+ $this->graph = new Graph('Graph1' . '_' . static::$testsTimestamp, [ "replicationFactor" => 2, "numberOfShards" => 4 ]);
+ $this->graph->addEdgeDefinition($ed1);
+ $this->graph->addEdgeDefinition($ed2);
+ static::assertFalse($this->graph->isSmart());
+ static::assertFalse($this->graph->isDisjoint());
+ static::assertEquals(2, $this->graph->getReplicationFactor());
+ static::assertEquals(4, $this->graph->getNumberOfShards());
+ $this->graphHandler = new GraphHandler($this->connection);
+ $result = $this->graphHandler->createGraph($this->graph);
+ static::assertEquals('Graph1' . '_' . static::$testsTimestamp, $result['_key'], 'Did not return Graph1!');
+ $properties = $this->graphHandler->properties('Graph1' . '_' . static::$testsTimestamp);
+ static::assertEquals('Graph1' . '_' . static::$testsTimestamp, $properties['_key'], 'Did not return Graph1!');
+ static::assertFalse($properties['isSmart']);
+ static::assertEquals(2, $properties['replicationFactor']);
+ static::assertEquals(4, $properties['numberOfShards']);
+ }
+
+
/**
* Test creation of graph with definitions
*/
diff --git a/tests/StatementTest.php b/tests/StatementTest.php
index 51360397..b3168796 100644
--- a/tests/StatementTest.php
+++ b/tests/StatementTest.php
@@ -178,6 +178,56 @@ public function testStatisticsPeakMemoryUsage()
static::assertEquals($extra['stats']['peakMemoryUsage'], $cursor->getPeakMemoryUsage());
}
+ /**
+ * Test block cache settings
+ */
+ public function testStatementBlockCacheGetterSetter()
+ {
+ $connection = $this->connection;
+
+ $statement = new Statement($connection, ['query' => 'RETURN 1']);
+ static::assertNull($statement->getFillBlockCache());
+ $statement->setFillBlockCache();
+ static::assertTrue($statement->getFillBlockCache());
+ $statement->setFillBlockCache(false);
+ static::assertFalse($statement->getFillBlockCache());
+ }
+
+
+ /**
+ * Test block cache query
+ */
+ public function testStatementBlockCacheEnabled()
+ {
+ $connection = $this->connection;
+
+ $statement = new Statement($connection, ['query' => 'RETURN 1', 'fillBlockCache' => true]);
+ static::assertTrue($statement->getFillBlockCache());
+
+ // cannot really test the population of the block cache from here, as the value is only
+ // exposed via a server-global API and may be influenced by any other ongoing operation.
+ $cursor = $statement->execute();
+ $extra = $cursor->getExtra();
+ static::assertEquals([], $extra['warnings']);
+ }
+
+
+ /**
+ * Test block cache query
+ */
+ public function testStatementBlockCacheDisabled()
+ {
+ $connection = $this->connection;
+
+ $statement = new Statement($connection, ['query' => 'RETURN 1', 'fillBlockCache' => false]);
+ static::assertFalse($statement->getFillBlockCache());
+
+ // cannot really test the population of the block cache from here, as the value is only
+ // exposed via a server-global API and may be influenced by any other ongoing operation.
+ $cursor = $statement->execute();
+ $extra = $cursor->getExtra();
+ static::assertEquals([], $extra['warnings']);
+ }
/**
* Test statistics returned by query
diff --git a/tests/travis/setup_arangodb.sh b/tests/travis/setup_arangodb.sh
index 33763e23..cd839fd9 100644
--- a/tests/travis/setup_arangodb.sh
+++ b/tests/travis/setup_arangodb.sh
@@ -3,12 +3,12 @@
echo "PHP version: $TRAVIS_PHP_VERSION"
if [[ "$TRAVIS_PHP_VERSION" == "7.4" ]] ; then
-wget "https://phar.phpunit.de/phpunit-9.5.phar"
+wget --no-check-certificate "https://phar.phpunit.de/phpunit-9.5.phar"
mv phpunit-9.5.phar ./phpunit
fi
if [[ "$TRAVIS_PHP_VERSION" == "8.0" ]] ; then
-wget "https://phar.phpunit.de/phpunit-9.5.phar"
+wget --no-check-certificate "https://phar.phpunit.de/phpunit-9.5.phar"
mv phpunit-9.5.phar ./phpunit
fi
@@ -20,8 +20,8 @@ echo "./phpunit --version"
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
cd $DIR
-docker pull arangodb/arangodb-preview:3.9.0-nightly
-docker run -d -e ARANGO_ROOT_PASSWORD="test" -p 8529:8529 arangodb/arangodb-preview:3.9.0-nightly
+docker pull arangodb/arangodb-preview:3.9-nightly
+docker run -d -e ARANGO_ROOT_PASSWORD="test" -p 8529:8529 arangodb/arangodb-preview:3.9-nightly arangod --database.extended-names-databases true
sleep 2