diff --git a/core/tests/Drupal/FunctionalTests/Datetime/TimestampTest.php b/core/tests/Drupal/FunctionalTests/Datetime/TimestampTest.php index 4e7d989..9e79453 100644 --- a/core/tests/Drupal/FunctionalTests/Datetime/TimestampTest.php +++ b/core/tests/Drupal/FunctionalTests/Datetime/TimestampTest.php @@ -14,13 +14,13 @@ /** * Tests the functionality of Timestamp core field UI. * - * @group somegroup + * @group field */ class TimestampTest extends BrowserTestBase { /** - * An array of display options to pass to entity_get_display() + * An array of display options to pass to entity_get_display(). * * @var array */ @@ -111,6 +111,10 @@ public function testWidget() { // Display creation form. $this->drupalGet('entity_test/add'); + // Make sure the "datetime_timestamp" widget is on the page. + $fields = $this->xpath('//div[contains(@class, "field--widget-datetime-timestamp") and @id="edit-field-timestamp-wrapper"]'); + $this->assertEquals(1, count($fields)); + // Look for the widget elements and make sure they are empty. $this->assertSession()->fieldExists('field_timestamp[0][value][date]'); $this->assertSession()->fieldValueEquals('field_timestamp[0][value][date]', ''); @@ -121,10 +125,10 @@ public function testWidget() { $date_format = DateFormat::load('html_date')->getPattern(); $time_format = DateFormat::load('html_time')->getPattern(); - $edit = array( + $edit = [ 'field_timestamp[0][value][date]' => $date->format($date_format), 'field_timestamp[0][value][time]' => $date->format($time_format), - ); + ]; $this->drupalPostForm(NULL, $edit, 'Save'); // Make sure the submitted date is set as the default in the widget.