protected function RadioactivityFieldTypeTest::setUp in Radioactivity 8.3
Same name and namespace in other branches
- 4.0.x tests/src/Kernel/RadioactivityFieldTypeTest.php \Drupal\Tests\radioactivity\Kernel\RadioactivityFieldTypeTest::setUp()
Set the default field storage backend for fields created during tests.
Overrides FieldKernelTestBase::setUp
File
- tests/
src/ Kernel/ RadioactivityFieldTypeTest.php, line 50
Class
- RadioactivityFieldTypeTest
- @coversDefaultClass \Drupal\radioactivity\Plugin\Field\FieldType\RadioactivityField @group radioactivity
Namespace
Drupal\Tests\radioactivity\KernelCode
protected function setUp() : void {
parent::setUp();
// Mock Time::getRequestTime.
$dateTime = $this
->getMockBuilder(TimeInterface::class)
->disableOriginalConstructor()
->getMock();
$dateTime
->expects($this
->any())
->method('getRequestTime')
->willReturnCallback(function () {
return $this->requestTime;
});
$this->container
->set('datetime.time', $dateTime);
}