diff --git a/core/modules/rdf/src/Tests/NodeAttributesTest.php b/core/modules/rdf/src/Tests/NodeAttributesTest.php index 43f736a..417c053 100644 --- a/core/modules/rdf/src/Tests/NodeAttributesTest.php +++ b/core/modules/rdf/src/Tests/NodeAttributesTest.php @@ -83,14 +83,14 @@ function testNodeAttributes() { // Node date. $expected_value = array( 'type' => 'literal', - 'value' => date('c', $node->getCreatedTime()), + 'value' => \Drupal::service('date.formatter')->format($node->getCreatedTime(), 'custom', 'c', 'UTC'), 'datatype' => 'http://www.w3.org/2001/XMLSchema#dateTime', ); $this->assertTrue($graph->hasProperty($node_uri, 'http://purl.org/dc/terms/date', $expected_value), 'Node date found in RDF output (dc:date).'); // Node date. $expected_value = array( 'type' => 'literal', - 'value' => date('c', $node->getCreatedTime()), + 'value' => \Drupal::service('date.formatter')->format($node->getCreatedTime(), 'custom', 'c', 'UTC'), 'datatype' => 'http://www.w3.org/2001/XMLSchema#dateTime', ); $this->assertTrue($graph->hasProperty($node_uri, 'http://purl.org/dc/terms/created', $expected_value), 'Node date found in RDF output (dc:created).'); diff --git a/core/modules/simpletest/src/Tests/TimeZoneTest.php b/core/modules/simpletest/src/Tests/TimeZoneTest.php new file mode 100644 index 0000000..00c93f6 --- /dev/null +++ b/core/modules/simpletest/src/Tests/TimeZoneTest.php @@ -0,0 +1,42 @@ +adminUser = $this->drupalCreateUser(['administer site configuration']); + } + + /** + * Tests that user accounts have the default time zone set. + */ + function testAccountTimeZones() { + $expected = 'Australia/Sydney'; + $this->assertEqual($this->rootUser->getTimeZone(), $expected, 'Root user has correct time zone.'); + $this->assertEqual($this->adminUser->getTimeZone(), $expected, 'Admin user has correct time zone.'); + } + +} diff --git a/core/modules/simpletest/src/WebTestBase.php b/core/modules/simpletest/src/WebTestBase.php index 3d674543..0e1a047 100644 --- a/core/modules/simpletest/src/WebTestBase.php +++ b/core/modules/simpletest/src/WebTestBase.php @@ -992,6 +992,7 @@ protected function initUserSession() { 'name' => 'admin', 'mail' => 'admin@example.com', 'pass_raw' => $this->randomMachineName(), + 'timezone' => date_default_timezone_get(), )); // The child site derives its session name from the database prefix when