X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=web%2Fcore%2Fmodules%2Ffield%2Ftests%2Fsrc%2FKernel%2FTimestamp%2FTimestampFormatterTest.php;fp=web%2Fcore%2Fmodules%2Ffield%2Ftests%2Fsrc%2FKernel%2FTimestamp%2FTimestampFormatterTest.php;h=9bb1f73acc3ee06f38b3651c9fe89143fb8f151c;hp=f71be314abf3fc94960649e8967b5f773b12332f;hb=0bf8d09d2542548982e81a441b1f16e75873a04f;hpb=74df008bdbb3a11eeea356744f39b802369bda3c diff --git a/web/core/modules/field/tests/src/Kernel/Timestamp/TimestampFormatterTest.php b/web/core/modules/field/tests/src/Kernel/Timestamp/TimestampFormatterTest.php index f71be314a..9bb1f73ac 100644 --- a/web/core/modules/field/tests/src/Kernel/Timestamp/TimestampFormatterTest.php +++ b/web/core/modules/field/tests/src/Kernel/Timestamp/TimestampFormatterTest.php @@ -2,8 +2,7 @@ namespace Drupal\Tests\field\Kernel\Timestamp; -use Drupal\Component\Utility\SafeMarkup; -use Drupal\Component\Utility\Unicode; +use Drupal\Component\Render\FormattableMarkup; use Drupal\Core\Entity\Display\EntityViewDisplayInterface; use Drupal\Core\Entity\FieldableEntityInterface; use Drupal\entity_test\Entity\EntityTest; @@ -55,7 +54,7 @@ class TimestampFormatterTest extends KernelTestBase { $this->entityType = 'entity_test'; $this->bundle = $this->entityType; - $this->fieldName = Unicode::strtolower($this->randomMachineName()); + $this->fieldName = mb_strtolower($this->randomMachineName()); $field_storage = FieldStorageConfig::create([ 'field_name' => $this->fieldName, @@ -156,7 +155,7 @@ class TimestampFormatterTest extends KernelTestBase { // Test a timestamp in the past $value = $request_time - 87654321; - $expected = SafeMarkup::format($past_format, ['@interval' => \Drupal::service('date.formatter')->formatTimeDiffSince($value, ['granularity' => $granularity])]); + $expected = new FormattableMarkup($past_format, ['@interval' => \Drupal::service('date.formatter')->formatTimeDiffSince($value, ['granularity' => $granularity])]); $component = $this->display->getComponent($this->fieldName); $component['type'] = 'timestamp_ago'; @@ -171,7 +170,7 @@ class TimestampFormatterTest extends KernelTestBase { // Test a timestamp in the future $value = $request_time + 87654321; - $expected = SafeMarkup::format($future_format, ['@interval' => \Drupal::service('date.formatter')->formatTimeDiffUntil($value, ['granularity' => $granularity])]); + $expected = new FormattableMarkup($future_format, ['@interval' => \Drupal::service('date.formatter')->formatTimeDiffUntil($value, ['granularity' => $granularity])]); $component = $this->display->getComponent($this->fieldName); $component['type'] = 'timestamp_ago';