Commit 794cf89a authored by Alex Pott's avatar Alex Pott
Browse files

Issue #2497585 by mpdonadio, cilefen, borisson_, pjonckiere: Simpletest should...

Issue #2497585 by mpdonadio, cilefen, borisson_, pjonckiere: Simpletest should set a system timezone in setUp
parent 57fb699b
Loading
Loading
Loading
Loading
+1 −1
Changes for core/modules/config_translation/src/Tests/ConfigTranslationUiTest.php: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -485,7 +485,7 @@ public function testDateFormatTranslation() {

      // Formatting the date 8 / 27 / 1985 @ 13:37 EST with pattern D should
      // display "Tue".
      $formatted_date = format_date(494015820, $id, NULL, NULL, 'fr');
      $formatted_date = format_date(494015820, $id, NULL, 'America/New_York', 'fr');
      $this->assertEqual($formatted_date, 'Tue', 'Got the right formatted date using the date format translation pattern.');
    }
  }
+1 −1
Changes for core/modules/locale/src/Tests/LocaleConfigTranslationTest.php: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -117,7 +117,7 @@ public function testConfigTranslation() {

    // Formatting the date 8 / 27 / 1985 @ 13:37 EST with pattern D should
    // display "Tue".
    $formatted_date = format_date(494015820, $type = 'medium', NULL, NULL, $this->langcode);
    $formatted_date = format_date(494015820, $type = 'medium', NULL, 'America/New_York', $this->langcode);
    $this->assertEqual($formatted_date, 'Tue', 'Got the right formatted date using the date format translation pattern.');

    // Assert strings from image module config are not available.
+1 −1
Changes for core/modules/rdf/src/CommonDataConverter.php: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -34,7 +34,7 @@ public static function rawValue($data) {
   *   Returns the ISO 8601 timestamp.
   */
  public static function dateIso8601Value($data) {
    return date_iso8601($data['value']);
    return \Drupal::service('date.formatter')->format($data['value'], 'custom', 'c', 'UTC');
  }

}
+2 −2
Changes for core/modules/rdf/src/Tests/CommentAttributesTest.php: 2 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -264,14 +264,14 @@ function _testBasicCommentRdfaMarkup($graph, CommentInterface $comment, $account
    // Comment date.
    $expected_value = array(
      'type' => 'literal',
      'value' => date('c', $comment->getCreatedTime()),
      'value' => format_date($comment->getCreatedTime(), 'custom', 'c', 'UTC'),
      'datatype' => 'http://www.w3.org/2001/XMLSchema#dateTime',
    );
    $this->assertTrue($graph->hasProperty($comment_uri, 'http://purl.org/dc/terms/date', $expected_value), 'Comment date found in RDF output (dc:date).');
    // Comment date.
    $expected_value = array(
      'type' => 'literal',
      'value' => date('c', $comment->getCreatedTime()),
      'value' => format_date($comment->getCreatedTime(), 'custom', 'c', 'UTC'),
      'datatype' => 'http://www.w3.org/2001/XMLSchema#dateTime',
    );
    $this->assertTrue($graph->hasProperty($comment_uri, 'http://purl.org/dc/terms/created', $expected_value), 'Comment date found in RDF output (dc:created).');
+2 −2
Changes for core/modules/rdf/src/Tests/StandardProfileTest.php: 2 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -356,7 +356,7 @@ protected function assertRdfaCommonNodeProperties($graph, NodeInterface $node, $
    // Created date.
    $expected_value = array(
      'type' => 'literal',
      'value' => date_iso8601($node->get('created')->value),
      'value' => format_date($node->get('created')->value, 'custom', 'c', 'UTC'),
      'lang' => 'en',
    );
    $this->assertTrue($graph->hasProperty($uri, 'http://schema.org/dateCreated', $expected_value), "$message_prefix created date was found (schema:dateCreated) in teaser.");
@@ -445,7 +445,7 @@ protected function assertRdfaNodeCommentProperties($graph) {
    // Comment created date.
    $expected_value = array(
      'type' => 'literal',
      'value' => date_iso8601($this->articleComment->get('created')->value),
      'value' => format_date($this->articleComment->get('created')->value, 'custom', 'c', 'UTC'),
      'lang' => 'en',
    );
    $this->assertTrue($graph->hasProperty($this->articleCommentUri, 'http://schema.org/dateCreated', $expected_value), 'Article comment created date was found (schema:dateCreated).');
Loading