summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Pott2014-12-11 15:41:47 +0100
committerAlex Pott2014-12-11 15:41:47 +0100
commit827b39b4c97f84634cc5cf4cfa670d07198036be (patch)
treedea46c725e193b25100a34ffb2f5d88724d9c7ef
parente55610f88df8c96cc9b724475cbbb03fe956f333 (diff)
Issue #2384167 by tibbsa: Clean-up DateTime module test members — ensure property definition and use of camelCase naming convention
-rw-r--r--core/modules/datetime/src/Tests/DateTimeFieldTest.php31
1 files changed, 19 insertions, 12 deletions
diff --git a/core/modules/datetime/src/Tests/DateTimeFieldTest.php b/core/modules/datetime/src/Tests/DateTimeFieldTest.php
index 4bf3196..2de16ee 100644
--- a/core/modules/datetime/src/Tests/DateTimeFieldTest.php
+++ b/core/modules/datetime/src/Tests/DateTimeFieldTest.php
@@ -36,6 +36,13 @@ class DateTimeFieldTest extends WebTestBase {
public static $modules = array('node', 'entity_test', 'datetime', 'field_ui');
/**
+ * An array of display options to pass to entity_get_display()
+ *
+ * @var array
+ */
+ protected $displayOptions;
+
+ /**
* A field storage to use in this test class.
*
* @var \Drupal\field\Entity\FieldStorageConfig
@@ -83,13 +90,13 @@ class DateTimeFieldTest extends WebTestBase {
))
->save();
- $this->display_options = array(
+ $this->displayOptions = array(
'type' => 'datetime_default',
'label' => 'hidden',
'settings' => array('format_type' => 'medium'),
);
entity_get_display($this->field->entity_type, $this->field->bundle, 'full')
- ->setComponent($field_name, $this->display_options)
+ ->setComponent($field_name, $this->displayOptions)
->save();
}
@@ -131,9 +138,9 @@ class DateTimeFieldTest extends WebTestBase {
foreach ($options as $setting => $values) {
foreach ($values as $new_value) {
// Update the entity display settings.
- $this->display_options['settings'] = array($setting => $new_value);
+ $this->displayOptions['settings'] = array($setting => $new_value);
entity_get_display($this->field->entity_type, $this->field->bundle, 'full')
- ->setComponent($field_name, $this->display_options)
+ ->setComponent($field_name, $this->displayOptions)
->save();
$this->renderTestEntity($id);
@@ -149,10 +156,10 @@ class DateTimeFieldTest extends WebTestBase {
}
// Verify that the plain formatter works.
- $this->display_options['type'] = 'datetime_plain';
- $this->display_options['settings'] = array();
+ $this->displayOptions['type'] = 'datetime_plain';
+ $this->displayOptions['settings'] = array();
entity_get_display($this->field->entity_type, $this->field->bundle, 'full')
- ->setComponent($field_name, $this->display_options)
+ ->setComponent($field_name, $this->displayOptions)
->save();
$expected = $date->format(DATETIME_DATE_STORAGE_FORMAT);
$this->renderTestEntity($id);
@@ -197,9 +204,9 @@ class DateTimeFieldTest extends WebTestBase {
foreach ($options as $setting => $values) {
foreach ($values as $new_value) {
// Update the entity display settings.
- $this->display_options['settings'] = array($setting => $new_value);
+ $this->displayOptions['settings'] = array($setting => $new_value);
entity_get_display($this->field->entity_type, $this->field->bundle, 'full')
- ->setComponent($field_name, $this->display_options)
+ ->setComponent($field_name, $this->displayOptions)
->save();
$this->renderTestEntity($id);
@@ -215,10 +222,10 @@ class DateTimeFieldTest extends WebTestBase {
}
// Verify that the plain formatter works.
- $this->display_options['type'] = 'datetime_plain';
- $this->display_options['settings'] = array();
+ $this->displayOptions['type'] = 'datetime_plain';
+ $this->displayOptions['settings'] = array();
entity_get_display($this->field->entity_type, $this->field->bundle, 'full')
- ->setComponent($field_name, $this->display_options)
+ ->setComponent($field_name, $this->displayOptions)
->save();
$expected = $date->format(DATETIME_DATETIME_STORAGE_FORMAT);
$this->renderTestEntity($id);