function PerformanceTest::testPagesAnonymous

Same name in other branches
  1. 11.x core/profiles/demo_umami/tests/src/FunctionalJavascript/PerformanceTest.php \Drupal\Tests\demo_umami\FunctionalJavascript\PerformanceTest::testPagesAnonymous()

Just load the front page.

File

core/profiles/demo_umami/tests/src/FunctionalJavascript/PerformanceTest.php, line 24

Class

PerformanceTest
Tests demo_umami profile performance.

Namespace

Drupal\Tests\demo_umami\FunctionalJavascript

Code

public function testPagesAnonymous() : void {
    $performance_data = $this->collectPerformanceData(function () {
        $this->drupalGet('<front>');
    });
    $this->assertSession()
        ->pageTextContains('Umami');
    $this->assertSame(2, $performance_data->getStylesheetCount());
    $this->assertSame(1, $performance_data->getScriptCount());
    $performance_data = $this->collectPerformanceData(function () {
        $this->drupalGet('node/1');
    });
    $this->assertSame(2, $performance_data->getStylesheetCount());
    $this->assertSame(1, $performance_data->getScriptCount());
}

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