protected function ImageFieldAttributesTest::setUp in Drupal 10        
                          
                  
                        Same name and namespace in other branches
- 8 core/modules/rdf/tests/src/Functional/ImageFieldAttributesTest.php \Drupal\Tests\rdf\Functional\ImageFieldAttributesTest::setUp()
- 9 core/modules/rdf/tests/src/Functional/ImageFieldAttributesTest.php \Drupal\Tests\rdf\Functional\ImageFieldAttributesTest::setUp()
File
 
   - core/modules/rdf/tests/src/Functional/ImageFieldAttributesTest.php, line 66
Class
  
  - ImageFieldAttributesTest 
- Tests the RDFa markup of imagefields.
Namespace
  Drupal\Tests\rdf\Functional
Code
protected function setUp() : void {
  parent::setUp();
  $this->fieldName = 'field_image';
  
  $this
    ->createImageField($this->fieldName, 'article');
  
  rdf_get_mapping('node', 'article')
    ->setFieldMapping($this->fieldName, [
    'properties' => [
      'og:image',
    ],
    'mapping_type' => 'rel',
  ])
    ->setBundleMapping([
    'types' => [],
  ])
    ->save();
  
  $image = current($this
    ->drupalGetTestFiles('image'));
  
  $nid = $this
    ->uploadNodeImage($image, $this->fieldName, 'article', $this
    ->randomMachineName());
  $this->node = Node::load($nid);
  $this->file = File::load($this->node->{$this->fieldName}->target_id);
  
  $this->baseUri = Url::fromRoute('<front>', [], [
    'absolute' => TRUE,
  ])
    ->toString();
}