function NoJavaScriptAnonymousTest::assertNoJavaScript
Passes if no JavaScript is found on the page.
@internal
1 call to NoJavaScriptAnonymousTest::assertNoJavaScript()
- NoJavaScriptAnonymousTest::testNoJavaScript in core/
modules/ system/ tests/ src/ Functional/ Common/ NoJavaScriptAnonymousTest.php - Tests that anonymous users are not served any JavaScript.
File
-
core/
modules/ system/ tests/ src/ Functional/ Common/ NoJavaScriptAnonymousTest.php, line 67
Class
- NoJavaScriptAnonymousTest
- Tests that anonymous users are not served any JavaScript.
Namespace
Drupal\Tests\system\Functional\CommonCode
protected function assertNoJavaScript() : void {
// Ensure drupalSettings is not set.
$settings = $this->getDrupalSettings();
$this->assertEmpty($settings, 'drupalSettings is not set.');
$this->assertSession()
->responseNotMatches('/\\.js/');
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.