comparison core/modules/rdf/tests/src/Functional/ImageFieldAttributesTest.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\image\Entity\ImageStyle; 6 use Drupal\image\Entity\ImageStyle;
6 use Drupal\Tests\image\Functional\ImageFieldTestBase; 7 use Drupal\Tests\image\Functional\ImageFieldTestBase;
7 use Drupal\node\Entity\Node; 8 use Drupal\node\Entity\Node;
8 use Drupal\file\Entity\File; 9 use Drupal\file\Entity\File;
9 use Drupal\Tests\TestFileCreationTrait; 10 use Drupal\Tests\TestFileCreationTrait;
91 $html = \Drupal::service('renderer')->renderRoot($node_render_array); 92 $html = \Drupal::service('renderer')->renderRoot($node_render_array);
92 93
93 // Parse the teaser. 94 // Parse the teaser.
94 $parser = new \EasyRdf_Parser_Rdfa(); 95 $parser = new \EasyRdf_Parser_Rdfa();
95 $graph = new \EasyRdf_Graph(); 96 $graph = new \EasyRdf_Graph();
96 $base_uri = \Drupal::url('<front>', [], ['absolute' => TRUE]); 97 $base_uri = Url::fromRoute('<front>', [], ['absolute' => TRUE])->toString();
97 $parser->parse($graph, $html, 'rdfa', $base_uri); 98 $parser->parse($graph, $html, 'rdfa', $base_uri);
98 99
99 // Construct the node and image URIs for testing. 100 // Construct the node and image URIs for testing.
100 $node_uri = $this->node->url('canonical', ['absolute' => TRUE]); 101 $node_uri = $this->node->toUrl('canonical', ['absolute' => TRUE])->toString();
101 $image_uri = ImageStyle::load('medium')->buildUrl($this->file->getFileUri()); 102 $image_uri = ImageStyle::load('medium')->buildUrl($this->file->getFileUri());
102 103
103 // Test relations from node to image. 104 // Test relations from node to image.
104 $expected_value = [ 105 $expected_value = [
105 'type' => 'uri', 106 'type' => 'uri',