protected function DateTimeNormalizerTest::setUp in Drupal 8
Same name and namespace in other branches
- 9 core/modules/serialization/tests/src/Unit/Normalizer/DateTimeNormalizerTest.php \Drupal\Tests\serialization\Unit\Normalizer\DateTimeNormalizerTest::setUp()
Overrides UnitTestCase::setUp
File
- core/
modules/ serialization/ tests/ src/ Unit/ Normalizer/ DateTimeNormalizerTest.php, line 41
Class
- DateTimeNormalizerTest
- Unit test coverage for @DataTypes implementing DateTimeInterface.
Namespace
Drupal\Tests\serialization\Unit\NormalizerCode
protected function setUp() {
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 DateTimeNormalizer($config_factory
->reveal());
$this->data = $this
->prophesize(DateTimeInterface::class);
}