diff --git a/core/lib/Drupal/Core/Datetime/DateFormatter.php b/core/lib/Drupal/Core/Datetime/DateFormatter.php index dc51d58..7b56e77 100644 --- a/core/lib/Drupal/Core/Datetime/DateFormatter.php +++ b/core/lib/Drupal/Core/Datetime/DateFormatter.php @@ -254,17 +254,4 @@ protected function country() { return $this->country; } - /** - * Setter for country code. - * - * @param string $country_code - * String country code. - * - * @return $this - */ - public function setCountryCode($country_code) { - $this->country = $country_code; - return $this; - } - } diff --git a/core/tests/Drupal/Tests/Core/Datetime/DateTest.php b/core/tests/Drupal/Tests/Core/Datetime/DateTest.php index 12f5fea..4534ccd 100644 --- a/core/tests/Drupal/Tests/Core/Datetime/DateTest.php +++ b/core/tests/Drupal/Tests/Core/Datetime/DateTest.php @@ -56,6 +56,11 @@ protected function setUp() { $this->languageManager = $this->getMock('Drupal\Core\Language\LanguageManagerInterface'); $this->stringTranslation = $this->getMock('Drupal\Core\StringTranslation\TranslationInterface'); + $config_factory = $this->getConfigFactoryStub(['system.date' => ['country' => ['default' => 'GB']]]); + $container = new ContainerBuilder(); + $container->set('config.factory', $config_factory); + \Drupal::setContainer($container); + $this->dateFormatter = new DateFormatter($this->entityManager, $this->languageManager, $this->stringTranslation, $this->getConfigFactoryStub()); } @@ -143,7 +148,6 @@ public function testFormatIntervalZeroSecond() { public function testGetSampleDateFormats() { include_once $this->root . '/core/includes/common.inc'; $timestamp = strtotime('2015-03-22 14:23:00'); - $this->dateFormatter->setCountryCode('GB'); $expected = $this->dateFormatter->getSampleDateFormats('en', $timestamp, 'Europe/London'); // Removed characters related to timezone 'e' and 'T', as test does not have