summaryrefslogtreecommitdiff
path: root/src/__tests__/VyOSElasticModernFulltextStorageEngineTestCase.php
diff options
context:
space:
mode:
authorYuriy Andamasov <yuriy@andamasov.com>2026-05-23 14:22:49 +0300
committerGitHub <noreply@github.com>2026-05-23 14:22:49 +0300
commit556b5a5faa958adb9956750a8b88c74c43db6fe5 (patch)
tree750dbd2010e0cf90cea60b1c0687ce44492f97d5 /src/__tests__/VyOSElasticModernFulltextStorageEngineTestCase.php
parentc75bb17724896fb0eff97fcefce01c3a2ce9d049 (diff)
parentdaa340590037e7a3d87f123078cc450dcbcfbca9 (diff)
downloadphorge-elasticsearch-modern-556b5a5faa958adb9956750a8b88c74c43db6fe5.tar.gz
phorge-elasticsearch-modern-556b5a5faa958adb9956750a8b88c74c43db6fe5.zip
Merge pull request #5 from vyos/task/e2-getdocumenturi
E2: Add getDocumentUri() helper
Diffstat (limited to 'src/__tests__/VyOSElasticModernFulltextStorageEngineTestCase.php')
-rw-r--r--src/__tests__/VyOSElasticModernFulltextStorageEngineTestCase.php14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/__tests__/VyOSElasticModernFulltextStorageEngineTestCase.php b/src/__tests__/VyOSElasticModernFulltextStorageEngineTestCase.php
index 7c0755c..3a96bac 100644
--- a/src/__tests__/VyOSElasticModernFulltextStorageEngineTestCase.php
+++ b/src/__tests__/VyOSElasticModernFulltextStorageEngineTestCase.php
@@ -66,4 +66,18 @@ final class VyOSElasticModernFulltextStorageEngineTestCase
}
}
+ public function testGetDocumentUri() {
+ $engine = $this->newEngine()->setVersion(7);
+ $uri = $engine->getDocumentUri('TASK', 'PHID-TASK-abc');
+ $this->assertEqual('/_doc/PHID-TASK-abc', $uri);
+ }
+
+ public function testGetDocumentUriIgnoresType() {
+ // The typeless API does not encode the doc type in the URL.
+ $engine = $this->newEngine()->setVersion(7);
+ $uri_a = $engine->getDocumentUri('TASK', 'PHID-TASK-abc');
+ $uri_b = $engine->getDocumentUri('DREV', 'PHID-TASK-abc');
+ $this->assertEqual($uri_a, $uri_b);
+ }
+
}