Skip to content
This repository has been archived by the owner on Jul 27, 2022. It is now read-only.

Commit

Permalink
ISAICP-6467: Entity type aliases are intended to be human readable.
Browse files Browse the repository at this point in the history
  • Loading branch information
pfrenssen committed Jun 14, 2021
1 parent 4412a62 commit cff3a5b
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions tests/src/Traits/EntityTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,22 +75,22 @@ protected static function getEntityByLabel(string $entity_type_id, string $label
*/
protected static function entityTypeAliases(): array {
return [
'asset_distribution' => 'rdf_entity',
'asset_release' => 'rdf_entity',
'contact_information' => 'rdf_entity',
'collection' => 'rdf_entity',
'contact information' => 'rdf_entity',
'content' => 'node',
'custom_page' => 'node',
'custom page' => 'node',
'discussion' => 'node',
'distribution' => 'rdf_entity',
'document' => 'node',
'event' => 'node',
'glossary' => 'node',
'group' => 'rdf_entity',
'news' => 'node',
'owner' => 'rdf_entity',
'release' => 'rdf_entity',
'solution' => 'rdf_entity',
'spdx_licence' => 'rdf_entity',
'tallinn_report' => 'node',
'spdx licence' => 'rdf_entity',
'tallinn report' => 'node',
];
}

Expand Down Expand Up @@ -138,13 +138,13 @@ protected static function translateBundle(string $bundle): string {
*/
protected static function bundleAliases(): array {
return [
'news' => 'news',
'custom page' => 'custom_page',
'event' => 'event',
'discussion' => 'discussion',
'document' => 'document',
'distribution' => 'asset_distribution',
'document' => 'document',
'event' => 'event',
'glossary' => 'glossary',
'news' => 'news',
'release' => 'asset_release',
'spdx licence' => 'spdx_licence',
'tallinn report' => 'tallinn_report',
Expand Down Expand Up @@ -223,9 +223,9 @@ public function visitEntityForm(string $action, string $title, string $bundle):
throw new \InvalidArgumentException('Only "edit" and "delete" actions are allowed.');
}

$bundle = $this->translateBundle($bundle);
$entity_type_id = $this->translateEntityTypeAlias($bundle);

$bundle = $this->translateBundle($bundle);
$node = $this->getEntityByLabel($entity_type_id, $title, $bundle);
$path = $node->toUrl("{$action}-form")->getInternalPath();
$this->visitPath($path);
Expand Down

0 comments on commit cff3a5b

Please sign in to comment.