You are here

protected function DateTimeIso8601NormalizerTest::setUp in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/serialization/tests/src/Unit/Normalizer/DateTimeIso8601NormalizerTest.php \Drupal\Tests\serialization\Unit\Normalizer\DateTimeIso8601NormalizerTest::setUp()
  2. 9 core/modules/serialization/tests/src/Unit/Normalizer/DateTimeIso8601NormalizerTest.php \Drupal\Tests\serialization\Unit\Normalizer\DateTimeIso8601NormalizerTest::setUp()

Overrides UnitTestCase::setUp

File

core/modules/serialization/tests/src/Unit/Normalizer/DateTimeIso8601NormalizerTest.php, line 48

Class

DateTimeIso8601NormalizerTest
Unit test coverage for the "datetime_iso8601" @DataType.

Namespace

Drupal\Tests\serialization\Unit\Normalizer

Code

protected function setUp() : void {
  parent::setUp();
  $system_date_config = $this
    ->prophesize(ImmutableConfig::class);
  $system_date_config
    ->get('timezone.default')
    ->willReturn('Australia/Sydney');
  $config_factory = $this
    ->prophesize(ConfigFactoryInterface::class);
  $config_factory
    ->get('system.date')
    ->willReturn($system_date_config
    ->reveal());
  $this->normalizer = new DateTimeIso8601Normalizer($config_factory
    ->reveal());
  $this->data = $this
    ->prophesize(DateTimeIso8601::class);
}