diff options
Diffstat (limited to 'modules/field')
-rw-r--r-- | modules/field/modules/field_sql_storage/field_sql_storage.module | 6 | ||||
-rw-r--r-- | modules/field/modules/list/list.test | 14 | ||||
-rw-r--r-- | modules/field/tests/field.test | 3 |
3 files changed, 12 insertions, 11 deletions
diff --git a/modules/field/modules/field_sql_storage/field_sql_storage.module b/modules/field/modules/field_sql_storage/field_sql_storage.module index 20ccc690b..c7c7d7b10 100644 --- a/modules/field/modules/field_sql_storage/field_sql_storage.module +++ b/modules/field/modules/field_sql_storage/field_sql_storage.module @@ -487,7 +487,11 @@ function field_sql_storage_field_storage_query($field_id, $conditions, $options) foreach ($conditions as $condition) { // A condition is either a (column, value, operator) triple, or a // (column, value) pair with implied operator. - @list($column, $value, $operator) = $condition; + list($column, $value) = $condition; + $operator = NULL; + if (isset($condition[2])) { + $operator = $condition[2]; + } // Translate operator and value if needed. switch ($operator) { case 'STARTS_WITH': diff --git a/modules/field/modules/list/list.test b/modules/field/modules/list/list.test index 684b60ec3..a954fde92 100644 --- a/modules/field/modules/list/list.test +++ b/modules/field/modules/list/list.test @@ -91,32 +91,28 @@ class ListFieldTestCase extends DrupalWebTestCase { /** * List module UI tests. */ -class ListFieldUITestCase extends DrupalWebTestCase { - public static function getInfo() { +class ListFieldUITestCase extends FieldUITestCase { + public static function getInfo() { return array( 'name' => 'List field UI tests', 'description' => 'Test the List field UI functionality.', 'group' => 'Field types', ); } - - function setUp() { - FieldUITestCase::setUp(); - } - + /** * Tests that allowed values are properly validated in the UI. */ function testAllowedValues() { $element_name = "field[settings][allowed_values]"; - + //Test 'List' field type. $admin_path = $this->createListFieldAndEdit('list'); //Check that non-integer keys are rejected. $edit = array($element_name => "1.1|one\n"); $this->drupalPost($admin_path, $edit, t('Save settings')); $this->assertText("keys must be integers", t('Form vaildation failed.')); - + // Test 'List (number)' field type. $admin_path = $this->createListFieldAndEdit('list_number'); //Check that non-numeric keys are rejected. diff --git a/modules/field/tests/field.test b/modules/field/tests/field.test index a0290c1eb..286d1a493 100644 --- a/modules/field/tests/field.test +++ b/modules/field/tests/field.test @@ -17,8 +17,9 @@ class FieldTestCase extends DrupalWebTestCase { */ function setUp() { // Call parent::setUp(). + // @see http://www.php.net/manual/en/function.call-user-func-array.php#73105 $args = func_get_args(); - call_user_func_array(array('parent', 'setUp'), $args); + call_user_func_array(array($this, 'parent::setUp'), $args); // Set default storage backend. variable_set('field_storage_default', $this->default_storage); } |