Commit 827b39b4 authored by alexpott's avatar alexpott

Issue #2384167 by tibbsa: Clean-up DateTime module test members — ensure...

Issue #2384167 by tibbsa: Clean-up DateTime module test members — ensure property definition and use of camelCase naming convention
parent e55610f8
......@@ -35,6 +35,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.
*
......@@ -83,13 +90,13 @@ protected function setUp() {
))
->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 @@ function testDateField() {
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 @@ function testDateField() {
}
// 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 @@ function testDatetimeField() {
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 @@ function testDatetimeField() {
}
// 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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment