function ResourceTest::testUriPaths
Same name in other branches
- 9 core/modules/rest/tests/src/Functional/ResourceTest.php \Drupal\Tests\rest\Functional\ResourceTest::testUriPaths()
- 10 core/modules/rest/tests/src/Functional/ResourceTest.php \Drupal\Tests\rest\Functional\ResourceTest::testUriPaths()
- 11.x core/modules/rest/tests/src/Functional/ResourceTest.php \Drupal\Tests\rest\Functional\ResourceTest::testUriPaths()
Tests that resource URI paths are formatted properly.
File
-
core/
modules/ rest/ tests/ src/ Functional/ ResourceTest.php, line 154
Class
- ResourceTest
- Tests the structure of a REST resource.
Namespace
Drupal\Tests\rest\FunctionalCode
public function testUriPaths() {
/** @var \Drupal\rest\Plugin\Type\ResourcePluginManager $manager */
$manager = \Drupal::service('plugin.manager.rest');
foreach ($manager->getDefinitions() as $resource => $definition) {
foreach ($definition['uri_paths'] as $key => $uri_path) {
$this->assertStringNotContainsString('//', $uri_path, 'The resource URI path does not have duplicate slashes.');
}
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.