function StandardPerformanceTest::testLogin
Same name and namespace in other branches
- 10 core/profiles/standard/tests/src/FunctionalJavascript/StandardPerformanceTest.php \Drupal\Tests\standard\FunctionalJavascript\StandardPerformanceTest::testLogin()
Tests the performance of logging in.
1 call to StandardPerformanceTest::testLogin()
- StandardPerformanceTest::testStandardPerformance in core/
profiles/ standard/ tests/ src/ FunctionalJavascript/ StandardPerformanceTest.php - Tests performance of the standard profile.
File
-
core/
profiles/ standard/ tests/ src/ FunctionalJavascript/ StandardPerformanceTest.php, line 113
Class
- StandardPerformanceTest
- Tests the performance of basic functionality in the standard profile.
Namespace
Drupal\Tests\standard\FunctionalJavascriptCode
protected function testLogin() : void {
// Create a user and log them in to warm all caches. Manually submit the
// form so that we repeat the same steps when recording performance data. Do
// this twice so that any caches which take two requests to warm are also
// covered.
for ($i = 0; $i < 2; $i++) {
$this->drupalGet('');
$this->submitLoginForm($this->user);
$this->drupalLogout();
}
$this->drupalGet('');
$performance_data = $this->collectPerformanceData(function () {
$this->submitLoginForm($this->user);
}, 'standardLogin');
$this->assertQueriesByName('standardLogin', $performance_data->getQueries());
$this->assertMetricsByName('standardLogin', $performance_data);
$this->drupalLogout();
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.