comparison core/modules/rdf/tests/src/Functional/NodeAttributesTest.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\node\Functional\NodeTestBase; 6 use Drupal\Tests\node\Functional\NodeTestBase;
6 7
7 /** 8 /**
8 * Tests the RDFa markup of Nodes. 9 * Tests the RDFa markup of Nodes.
9 * 10 *
45 $node = $this->drupalCreateNode([ 46 $node = $this->drupalCreateNode([
46 'type' => 'article', 47 'type' => 'article',
47 'title' => $this->randomMachineName(8) . "'", 48 'title' => $this->randomMachineName(8) . "'",
48 ]); 49 ]);
49 50
50 $node_uri = $node->url('canonical', ['absolute' => TRUE]); 51 $node_uri = $node->toUrl('canonical', ['absolute' => TRUE])->toString();
51 $base_uri = \Drupal::url('<front>', [], ['absolute' => TRUE]); 52 $base_uri = Url::fromRoute('<front>', [], ['absolute' => TRUE])->toString();
52 53
53 // Parses front page where the node is displayed in its teaser form. 54 // Parses front page where the node is displayed in its teaser form.
54 $parser = new \EasyRdf_Parser_Rdfa(); 55 $parser = new \EasyRdf_Parser_Rdfa();
55 $graph = new \EasyRdf_Graph(); 56 $graph = new \EasyRdf_Graph();
56 $parser->parse($graph, $this->drupalGet('node/' . $node->id()), 'rdfa', $base_uri); 57 $parser->parse($graph, $this->drupalGet('node/' . $node->id()), 'rdfa', $base_uri);