Commit d3e67cc0 authored by Gábor Hojtsy's avatar Gábor Hojtsy

Issue #3075831 by mr.baileys: Failing assertions when bundle ID contains only numbers

parent f62303eb
......@@ -102,7 +102,7 @@ public function all() {
$resource_types = [];
foreach ($this->entityTypeManager->getDefinitions() as $entity_type) {
$resource_types = array_merge($resource_types, array_map(function ($bundle) use ($entity_type) {
return $this->createResourceType($entity_type, $bundle);
return $this->createResourceType($entity_type, (string) $bundle);
}, array_keys($this->entityTypeBundleInfo->getBundleInfo($entity_type->id()))));
}
foreach ($resource_types as $resource_type) {
......
......@@ -51,6 +51,9 @@ protected function setUp() {
NodeType::create([
'type' => 'page',
])->save();
NodeType::create([
'type' => '42',
])->save();
$this->resourceTypeRepository = $this->container->get('jsonapi.resource_type.repository');
}
......@@ -92,6 +95,7 @@ public function testGet($entity_type_id, $bundle, $entity_class) {
public function getProvider() {
return [
['node', 'article', 'Drupal\node\Entity\Node'],
['node', '42', 'Drupal\node\Entity\Node'],
['node_type', 'node_type', 'Drupal\node\Entity\NodeType'],
['menu', 'menu', 'Drupal\system\Entity\Menu'],
];
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment