function DateTest::setUpDateFormatterStub

Initializes the $dateFormatterStub property.

2 calls to DateTest::setUpDateFormatterStub()
DateTest::testFormatTimeDiffSince in core/tests/Drupal/Tests/Core/Datetime/DateTest.php
Tests the formatTimeDiffSince method.
DateTest::testFormatTimeDiffUntil in core/tests/Drupal/Tests/Core/Datetime/DateTest.php
Tests the formatTimeDiffUntil method.

File

core/tests/Drupal/Tests/Core/Datetime/DateTest.php, line 105

Class

DateTest
Tests Drupal\Core\Datetime\DateFormatter.

Namespace

Drupal\Tests\Core\Datetime

Code

protected function setUpDateFormatterStub() : void {
  $this->dateFormatterStub = $this->getMockBuilder(DateFormatter::class)
    ->setConstructorArgs([
    $this->entityTypeManager,
    $this->languageManager,
    $this->stringTranslation,
    $this->getConfigFactoryStub(),
    $this->requestStack,
  ])
    ->onlyMethods([
    'formatDiff',
  ])
    ->getMock();
}

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