diff --git a/core/modules/rdf/src/Tests/TaxonomyAttributesTest.php b/core/modules/rdf/src/Tests/TaxonomyAttributesTest.php index 8d3c43f..1f38396 100644 --- a/core/modules/rdf/src/Tests/TaxonomyAttributesTest.php +++ b/core/modules/rdf/src/Tests/TaxonomyAttributesTest.php @@ -7,6 +7,7 @@ namespace Drupal\rdf\Tests; +use Drupal\taxonomy\Entity\Term; use Drupal\taxonomy\Tests\TaxonomyTestBase; /** @@ -17,6 +18,13 @@ class TaxonomyAttributesTest extends TaxonomyTestBase { /** + * Vocabulary to use in tests. + * + * @var \Drupal\taxonomy\VocabularyInterface + */ + protected $vocabulary; + + /** * Modules to enable. * * @var array @@ -72,6 +80,14 @@ function testTaxonomyTermRdfaAttributes() { ); $this->assertTrue($graph->hasProperty($term_uri, 'http://www.w3.org/2004/02/skos/core#prefLabel', $expected_value), 'Term label found in RDF output (skos:prefLabel).'); + $term = Term::create(array( + 'vid' => $this->vocabulary->id(), + 'name' => $this->randomName('Foo'), + )); + + $view = \Drupal::entityManager()->getViewBuilder('taxonomy_term')->view($term); + drupal_render($view); + // @todo Add test for term description once it is a field: // https://drupal.org/node/569434 } diff --git a/core/modules/rdf/src/Tests/UserAttributesTest.php b/core/modules/rdf/src/Tests/UserAttributesTest.php index a6d11d3..97f6dff 100644 --- a/core/modules/rdf/src/Tests/UserAttributesTest.php +++ b/core/modules/rdf/src/Tests/UserAttributesTest.php @@ -105,5 +105,16 @@ function testUserAttributesInMarkup() { $this->assertTrue($graph->hasProperty($account_uri, 'http://xmlns.com/foaf/0.1/name', $expected_value), 'User name found in RDF output (foaf:name).'); } + + // Create a user. + $edit = array(); + $edit['name'] = !empty($name) ? $name : $this->randomName(); + $edit['mail'] = $edit['name'] . '@example.com'; + $edit['pass'] = user_password(); + $edit['status'] = 1; + + $account = entity_create('user', $edit); + $view = \Drupal::entityManager()->getViewBuilder('user')->view($account); + drupal_render($view); } }