Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. ConstraintValidatorTestCase.php

function ConstraintValidatorTestCase::setDefaultTimezone

1 call to ConstraintValidatorTestCase::setDefaultTimezone()
ConstraintValidatorTestCase::setUp in vendor/symfony/validator/Test/ConstraintValidatorTestCase.php
This method is called before each test.

File

vendor/symfony/validator/Test/ConstraintValidatorTestCase.php, line 105

Class

ConstraintValidatorTestCase
A test case to ease testing Constraint Validators.

Namespace

Symfony\Component\Validator\Test

Code

protected function setDefaultTimezone(?string $defaultTimezone) {
    // Make sure this method cannot be called twice before calling
    // also restoreDefaultTimezone()
    if (null === $this->defaultTimezone) {
        $this->defaultTimezone = date_default_timezone_get();
        date_default_timezone_set($defaultTimezone);
    }
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal