public function RestResourceConfigTest::testCalculateDependencies in Drupal 10
Same name and namespace in other branches
- 8 core/modules/rest/tests/src/Kernel/Entity/RestResourceConfigTest.php \Drupal\Tests\rest\Kernel\Entity\RestResourceConfigTest::testCalculateDependencies()
- 9 core/modules/rest/tests/src/Kernel/Entity/RestResourceConfigTest.php \Drupal\Tests\rest\Kernel\Entity\RestResourceConfigTest::testCalculateDependencies()
@covers ::calculateDependencies
File
- core/
modules/ rest/ tests/ src/ Kernel/ Entity/ RestResourceConfigTest.php, line 30
Class
- RestResourceConfigTest
- @coversDefaultClass \Drupal\rest\Entity\RestResourceConfig
Namespace
Drupal\Tests\rest\Kernel\EntityCode
public function testCalculateDependencies() {
$rest_config = RestResourceConfig::create([
'plugin_id' => 'entity:entity_test',
'granularity' => RestResourceConfigInterface::METHOD_GRANULARITY,
'configuration' => [
'GET' => [
'supported_auth' => [
'cookie',
],
'supported_formats' => [
'json',
],
],
'POST' => [
'supported_auth' => [
'basic_auth',
],
'supported_formats' => [
'json',
],
],
],
]);
$rest_config
->calculateDependencies();
$this
->assertEquals([
'module' => [
'basic_auth',
'entity_test',
'serialization',
'user',
],
], $rest_config
->getDependencies());
}