diff --git a/core/modules/hal/lib/Drupal/hal/Normalizer/EntityNormalizer.php b/core/modules/hal/lib/Drupal/hal/Normalizer/EntityNormalizer.php index 34c769f..dacc33e 100644 --- a/core/modules/hal/lib/Drupal/hal/Normalizer/EntityNormalizer.php +++ b/core/modules/hal/lib/Drupal/hal/Normalizer/EntityNormalizer.php @@ -34,7 +34,7 @@ public function normalize($entity, $format = NULL, array $context = array()) { 'curies' => array( array( // @todo Make this configurable. - 'href' => url('relations'), + 'href' => url('relations') . '/{rel}', 'name' => 'site', 'templated' => TRUE, ), diff --git a/core/modules/hal/lib/Drupal/hal/Tests/NormalizerTestBase.php b/core/modules/hal/lib/Drupal/hal/Tests/NormalizerTestBase.php index 691a05c..8d1e8e1 100644 --- a/core/modules/hal/lib/Drupal/hal/Tests/NormalizerTestBase.php +++ b/core/modules/hal/lib/Drupal/hal/Tests/NormalizerTestBase.php @@ -22,7 +22,7 @@ * * @var array */ - public static $modules = array('entity_reference', 'field', 'field_sql_storage', 'language', 'serialization', 'system', 'text'); + public static $modules = array('entity_test', 'entity_reference', 'field', 'field_sql_storage', 'hal', 'language', 'serialization', 'system', 'text', 'user'); /** * The format being tested. @@ -36,13 +36,13 @@ */ function setUp() { parent::setUp(); - $this->installSchema('system', 'variable'); - $this->installSchema('system', 'url_alias'); - $this->installSchema('field', 'field_config'); - $this->installSchema('field', 'field_config_instance'); + $this->installSchema('system', array('variable', 'url_alias')); + $this->installSchema('field', array('field_config', 'field_config_instance')); + $this->installSchema('user', array('users')); + $this->installSchema('language', array('language')); + $this->installSchema('entity_test', array('entity_test')); - // English must be added before entity_test is enabled. - $this->enableModules(array('language')); + // Add English as a language. $english = new Language(array( 'langcode' => 'en', 'name' => 'English', @@ -55,9 +55,22 @@ function setUp() { )); language_save($german); - $this->enableModules(array('entity_test', 'hal', 'user')); + // Create the test text field. + $field = array( + 'field_name' => 'field_test_text', + 'type' => 'text', + 'cardinality' => 1, + 'translatable' => FALSE, + ); + field_create_field($field); + $instance = array( + 'entity_type' => 'entity_test', + 'field_name' => 'field_test_text', + 'bundle' => 'entity_test', + ); + field_create_instance($instance); - // Create the test field. + // Create the test entity reference field. $field = array( 'translatable' => TRUE, 'settings' => array( @@ -67,8 +80,6 @@ function setUp() { 'type' => 'entity_reference', ); field_create_field($field); - - // Create the test field instance. $instance = array( 'entity_type' => 'entity_test', 'field_name' => 'field_test_entity_reference',