function Handle::register

Same name in other branches
  1. 9 core/lib/Drupal/Component/Assertion/Handle.php \Drupal\Component\Assertion\Handle::register()
  2. 10 core/lib/Drupal/Component/Assertion/Handle.php \Drupal\Component\Assertion\Handle::register()
  3. 11.x core/lib/Drupal/Component/Assertion/Handle.php \Drupal\Component\Assertion\Handle::register()

Ensures exceptions are thrown when an assertion fails.

5 calls to Handle::register()
bootstrap.php in core/tests/bootstrap.php
Autoloader for Drupal PHPUnit testing.
DrupalKernel::bootEnvironment in core/lib/Drupal/Core/DrupalKernel.php
Setup a consistent PHP environment.
example.settings.local.php in sites/example.settings.local.php
Local development override configuration feature.
example.settings.local.php in core/assets/scaffold/files/example.settings.local.php
Local development override configuration feature.
TestBase::run in core/modules/simpletest/src/TestBase.php
Run all tests in this class.

File

core/lib/Drupal/Component/Assertion/Handle.php, line 17

Class

Handle
Handler for runtime assertion failures.

Namespace

Drupal\Component\Assertion

Code

public static function register() {
    // Since we're using exceptions, turn error warnings off.
    assert_options(ASSERT_WARNING, FALSE);
    // Turn exception throwing on.
    assert_options(ASSERT_EXCEPTION, TRUE);
}

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