comparison core/modules/rdf/tests/src/Functional/TaxonomyAttributesTest.php @ 5:12f9dff5fda9 tip

Update to Drupal core 8.7.1
author Chris Cannam
date Thu, 09 May 2019 15:34:47 +0100
parents c75dbcec494b
children
comparison
equal deleted inserted replaced
4:a9cd425dd02b 5:12f9dff5fda9
1 <?php 1 <?php
2 2
3 namespace Drupal\Tests\rdf\Functional; 3 namespace Drupal\Tests\rdf\Functional;
4 4
5 use Drupal\Core\Url;
5 use Drupal\Tests\taxonomy\Functional\TaxonomyTestBase; 6 use Drupal\Tests\taxonomy\Functional\TaxonomyTestBase;
6 7
7 /** 8 /**
8 * Tests the RDFa markup of Taxonomy terms. 9 * Tests the RDFa markup of Taxonomy terms.
9 * 10 *
42 /** 43 /**
43 * Creates a random term and ensures the RDF output is correct. 44 * Creates a random term and ensures the RDF output is correct.
44 */ 45 */
45 public function testTaxonomyTermRdfaAttributes() { 46 public function testTaxonomyTermRdfaAttributes() {
46 $term = $this->createTerm($this->vocabulary); 47 $term = $this->createTerm($this->vocabulary);
47 $term_uri = $term->url('canonical', ['absolute' => TRUE]); 48 $term_uri = $term->toUrl('canonical', ['absolute' => TRUE])->toString();
48 49
49 // Parses the term's page and checks that the RDF output is correct. 50 // Parses the term's page and checks that the RDF output is correct.
50 $parser = new \EasyRdf_Parser_Rdfa(); 51 $parser = new \EasyRdf_Parser_Rdfa();
51 $graph = new \EasyRdf_Graph(); 52 $graph = new \EasyRdf_Graph();
52 $base_uri = \Drupal::url('<front>', [], ['absolute' => TRUE]); 53 $base_uri = Url::fromRoute('<front>', [], ['absolute' => TRUE])->toString();
53 $parser->parse($graph, $this->drupalGet('taxonomy/term/' . $term->id()), 'rdfa', $base_uri); 54 $parser->parse($graph, $this->drupalGet('taxonomy/term/' . $term->id()), 'rdfa', $base_uri);
54 55
55 // Inspects RDF graph output. 56 // Inspects RDF graph output.
56 // Term type. 57 // Term type.
57 $expected_value = [ 58 $expected_value = [