You are here

public function MetatagTagTypesTest::todoTestUrl in Metatag 8

Check URL handling.

@todo Finish.

File

tests/src/Functional/MetatagTagTypesTest.php, line 175

Class

MetatagTagTypesTest
Verify that different meta tag API options are supported.

Namespace

Drupal\Tests\metatag\Functional

Code

public function todoTestUrl() {

  // {@code}
  // $save_label = (floatval(\Drupal::VERSION) <= 8.3) ? $this->t('Save and publish') : $this->t('Save');
  // // Tests meta tags with URLs work.
  // $this->drupalGet($this->entity_add_path);
  // $this->assertSession()->statusCodeEquals(200);
  // $edit = [
  //   'name[0][value]' => 'UrlTags',
  //   'user_id[0][target_id]' => 'foo (' . $this->adminUser->id() . ')',
  //   'field_metatag[0][advanced][original_source]' => 'https://example.com/foo.html',
  // ];
  // $this->drupalPostForm(NULL, $edit, $save_label);
  // $entities = entity_load_multiple_by_properties('entity_test', [
  //   'name' => 'UrlTags',
  // ]);
  // $this->assertEquals(count($entities), 1, 'Entity was saved');
  // $entity = reset($entities);
  // $this->drupalGet($this->entity_base_path . '/' . $entity->id());
  // $this->assertSession()->statusCodeEquals(200);
  // $elements = $this->cssSelect("meta[name='original-source']");
  // $this->assertTrue(count($elements) === 1, 'Found original source metatag from defaults');
  // $this->assertEquals($edit['field_metatag[0][advanced][original_source]'], (string) $elements[0]['content']);
  // {@endcode}
}