function PaginationAJAXTest::assertNoDuplicateAssetsOnPage

Same name in other branches
  1. 9 core/modules/views/tests/src/FunctionalJavascript/PaginationAJAXTest.php \Drupal\Tests\views\FunctionalJavascript\PaginationAJAXTest::assertNoDuplicateAssetsOnPage()
  2. 8.9.x core/modules/views/tests/src/FunctionalJavascript/PaginationAJAXTest.php \Drupal\Tests\views\FunctionalJavascript\PaginationAJAXTest::assertNoDuplicateAssetsOnPage()
  3. 10 core/modules/views/tests/src/FunctionalJavascript/PaginationAJAXTest.php \Drupal\Tests\views\FunctionalJavascript\PaginationAJAXTest::assertNoDuplicateAssetsOnPage()

Assert that assets are not loaded twice on a page.

@internal

2 calls to PaginationAJAXTest::assertNoDuplicateAssetsOnPage()
PaginationAJAXTest::testBasicPagination in core/modules/views/tests/src/FunctionalJavascript/PaginationAJAXTest.php
Tests if pagination via AJAX works for the "Content" View.
PaginationAJAXTest::testDefaultFilterPagination in core/modules/views/tests/src/FunctionalJavascript/PaginationAJAXTest.php
Tests if pagination via AJAX works for the filter with default value.

File

core/modules/views/tests/src/FunctionalJavascript/PaginationAJAXTest.php, line 247

Class

PaginationAJAXTest
Tests the click sorting AJAX functionality of Views exposed forms.

Namespace

Drupal\Tests\views\FunctionalJavascript

Code

protected function assertNoDuplicateAssetsOnPage() : void {
    
    /** @var \Behat\Mink\Element\NodeElement[] $scripts */
    $scripts = $this->getSession()
        ->getPage()
        ->findAll('xpath', '//script');
    $script_src = [];
    foreach ($scripts as $script) {
        $this->assertNotContains($script->getAttribute('src'), $script_src);
        $script_src[] = $script->getAttribute('src');
    }
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.