function AssertLegacyTrait::assertResponse

Same name in other branches
  1. 9 core/tests/Drupal/FunctionalTests/AssertLegacyTrait.php \Drupal\FunctionalTests\AssertLegacyTrait::assertResponse()

Asserts the page responds with the specified response code.

Parameters

int $code: Response code. For example 200 is a successful page request. For a list of all codes see http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html.

Deprecated in drupal:8.2.0 and is removed from drupal:10.0.0. Use $this->assertSession()->statusCodeEquals() instead.

6 calls to AssertLegacyTrait::assertResponse()
AjaxPageStateTest::testMultipleLibrariesAreNotLoaded in core/modules/system/tests/src/Functional/Render/AjaxPageStateTest.php
Test if multiple libraries can be excluded.
BlockContextMappingUpdateTest::testUpdateHookN in core/modules/block/tests/src/Functional/Update/BlockContextMappingUpdateTest.php
Tests that block context mapping is updated properly.
FileUsageTemporaryDeletionConfigurationUpdateTest::testUpdateHookN in core/modules/file/tests/src/Functional/Update/FileUsageTemporaryDeletionConfigurationUpdateTest.php
Tests that make_unused_managed_files_temporary conditions are correct.
InstallerCustomConfigDirectoryCreateTest::testInstaller in core/tests/Drupal/FunctionalTests/Installer/InstallerCustomConfigDirectoryCreateTest.php
Verifies that installation succeeded.
InstallerExistingSettingsMismatchProfileTest::testInstaller in core/tests/Drupal/FunctionalTests/Installer/InstallerExistingSettingsMismatchProfileTest.php
Verifies that installation succeeded.

... See full list

1 method overrides AssertLegacyTrait::assertResponse()
UncaughtExceptionTest::assertResponse in core/tests/Drupal/FunctionalTests/Bootstrap/UncaughtExceptionTest.php
Asserts the page responds with the specified response code.

File

core/tests/Drupal/FunctionalTests/AssertLegacyTrait.php, line 210

Class

AssertLegacyTrait
Provides convenience methods for assertions in browser tests.

Namespace

Drupal\FunctionalTests

Code

protected function assertResponse($code) {
    $this->assertSession()
        ->statusCodeEquals($code);
}

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