summaryrefslogtreecommitdiff
path: root/src/__tests__/VyOSElasticModernFulltextStorageEngineTestCase.php
diff options
context:
space:
mode:
authorYuriy Andamasov <yuriy@vyos.io>2026-05-22 10:58:20 +0300
committerYuriy Andamasov <yuriy@vyos.io>2026-05-23 13:14:07 +0300
commit249feeb0a6d43b8f98f1e4d48e5cc3f6edc19998 (patch)
treed4dcd130aafc661bb859a228dc61bd6795b3ad0a /src/__tests__/VyOSElasticModernFulltextStorageEngineTestCase.php
parented0dee0333acf8a1c79845bba6455506c8210bad (diff)
downloadphorge-elasticsearch-modern-249feeb0a6d43b8f98f1e4d48e5cc3f6edc19998.tar.gz
phorge-elasticsearch-modern-249feeb0a6d43b8f98f1e4d48e5cc3f6edc19998.zip
Engine: Add getDocumentUri() helper for typeless document URLs
🤖 Generated by [robots](https://vyos.io)
Diffstat (limited to 'src/__tests__/VyOSElasticModernFulltextStorageEngineTestCase.php')
-rw-r--r--src/__tests__/VyOSElasticModernFulltextStorageEngineTestCase.php16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/__tests__/VyOSElasticModernFulltextStorageEngineTestCase.php b/src/__tests__/VyOSElasticModernFulltextStorageEngineTestCase.php
index 7c0755c..5ced477 100644
--- a/src/__tests__/VyOSElasticModernFulltextStorageEngineTestCase.php
+++ b/src/__tests__/VyOSElasticModernFulltextStorageEngineTestCase.php
@@ -66,4 +66,20 @@ final class VyOSElasticModernFulltextStorageEngineTestCase
}
}
+ public function testGetDocumentUri() {
+ $engine = id(new VyOSElasticModernFulltextStorageEngine())
+ ->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 = id(new VyOSElasticModernFulltextStorageEngine())
+ ->setVersion(7);
+ $uri_a = $engine->getDocumentUri('TASK', 'PHID-TASK-abc');
+ $uri_b = $engine->getDocumentUri('DREV', 'PHID-TASK-abc');
+ $this->assertEqual($uri_a, $uri_b);
+ }
+
}