summaryrefslogtreecommitdiffstats
path: root/tests/src/Kernel/Matchers/AssertResultUriTrait.php
diff options
context:
space:
mode:
Diffstat (limited to 'tests/src/Kernel/Matchers/AssertResultUriTrait.php')
-rw-r--r--tests/src/Kernel/Matchers/AssertResultUriTrait.php29
1 files changed, 0 insertions, 29 deletions
diff --git a/tests/src/Kernel/Matchers/AssertResultUriTrait.php b/tests/src/Kernel/Matchers/AssertResultUriTrait.php
deleted file mode 100644
index 0f3da62..0000000
--- a/tests/src/Kernel/Matchers/AssertResultUriTrait.php
+++ /dev/null
@@ -1,29 +0,0 @@
-<?php
-
-namespace Drupal\Tests\linkit\Kernel\Matchers;
-
-use Drupal\linkit\MatcherInterface;
-use Drupal\linkit\Suggestion\SuggestionCollection;
-
-/**
- * Provides helper methods for assertions.
- */
-trait AssertResultUriTrait {
-
- /**
- * Assert that paths are formatted as an URI with the entity: scheme.
- *
- * @param \Drupal\linkit\MatcherInterface $plugin
- * A matcher plugin.
- * @param \Drupal\linkit\Suggestion\SuggestionCollection $suggestions
- * A collection of suggestions.
- */
- public function assertResultUri(MatcherInterface $plugin, SuggestionCollection $suggestions) {
- $entity_type = $plugin->getPluginDefinition()['target_entity'];
- $substitution_id = $plugin->getConfiguration()['settings']['substitution_type'];
- foreach ($suggestions->getSuggestions() as $suggestion) {
- $this->assertTrue(preg_match("/^entity:" . $substitution_id . "\\/" . $entity_type . "\\/\\w+$/i", $suggestion->getPath()), 'Result URI correct formatted.');
- }
- }
-
-}