You are here

protected function XmlSitemapTestBase::assertSitemapLink in XML sitemap 8

Same name and namespace in other branches
  1. 2.x tests/src/Functional/XmlSitemapTestBase.php \Drupal\Tests\xmlsitemap\Functional\XmlSitemapTestBase::assertSitemapLink()

Assert Sitemap Link.

1 call to XmlSitemapTestBase::assertSitemapLink()
XmlSitemapMultilingualNodeTest::testNodeLanguageData in tests/src/Functional/XmlSitemapMultilingualNodeTest.php
Test language for sitemap node links.

File

tests/src/Functional/XmlSitemapTestBase.php, line 198

Class

XmlSitemapTestBase
Helper test class with some added functions for testing.

Namespace

Drupal\Tests\xmlsitemap\Functional

Code

protected function assertSitemapLink($entity_type, $entity_id = NULL) {
  if (is_array($entity_type)) {
    $links = $this->linkStorage
      ->loadMultiple($entity_type);
    $link = $links ? reset($links) : FALSE;
  }
  else {
    $link = $this->linkStorage
      ->load($entity_type, $entity_id);
  }
  $this
    ->assertIsArray($link, 'Link loaded.');
  return $link;
}