You are here

protected function ViewsBaseUrlFieldTest::assertViewsBaseUrlLinkNoSettings in Views base url 2.0.x

Same name and namespace in other branches
  1. 8 tests/src/Functional/ViewsBaseUrlFieldTest.php \Drupal\Tests\views_base_url\Functional\ViewsBaseUrlFieldTest::assertViewsBaseUrlLinkNoSettings()

Tests views base url field when `show_link` enabled and no link settings.

3 calls to ViewsBaseUrlFieldTest::assertViewsBaseUrlLinkNoSettings()
ViewsBaseUrlFieldTest::testViewsBaseUrlLinkNoLinkPath in tests/src/Functional/ViewsBaseUrlFieldTest.php
Tests views base url field when `show_link` enabled and no `link_path`.
ViewsBaseUrlFieldTest::testViewsBaseUrlLinkNoLinkQuery in tests/src/Functional/ViewsBaseUrlFieldTest.php
Tests views base url field when `show_link` enabled and no `link_query`.
ViewsBaseUrlFieldTest::testViewsBaseUrlLinkNoLinkText in tests/src/Functional/ViewsBaseUrlFieldTest.php
Tests views base url field when `show_link` enabled and no `link_text` set.

File

tests/src/Functional/ViewsBaseUrlFieldTest.php, line 128

Class

ViewsBaseUrlFieldTest
Basic test for views base url.

Namespace

Drupal\Tests\views_base_url\Functional

Code

protected function assertViewsBaseUrlLinkNoSettings() {
  global $base_url;
  $this
    ->drupalGet('views-base-url-link-no-settings-test');
  $this
    ->assertResponse(200);
  $elements = $this
    ->xpath('//div[contains(@class,"view-views-base-url-link-no-settings-test")]/div[@class="view-content"]/div[contains(@class,"views-row")]');
  $this
    ->assertEqual(count($elements), $this->nodeCount, t('There are @count rows', [
    '@count' => $this->nodeCount,
  ]));
  $link_path = $base_url;
  $link_text = $link_path;
  $elements = $this
    ->xpath('//a[@href=:path and text()=:text]', [
    ':path' => $link_path,
    ':text' => $link_text,
  ]);
  $this
    ->assertEqual(count($elements), $this->nodeCount, 'Views base url rendered as link with no settings set');
}