| 1 |
<?php |
<?php |
| 2 |
// $Id: text.test,v 1.10 2009/08/22 00:58:53 webchick Exp $ |
// $Id: combo.test,v 1.1 2009/09/05 13:41:30 bjaspan Exp $ |
| 3 |
|
|
| 4 |
class ComboFieldTestCase extends DrupalWebTestCase { |
class ComboFieldTestCase extends DrupalWebTestCase { |
| 5 |
public static function getInfo() { |
public static function getInfo() { |
| 162 |
), |
), |
| 163 |
), |
), |
| 164 |
), |
), |
| 165 |
|
1 => array( |
| 166 |
|
'card_1' => array( |
| 167 |
|
'zxx' => array( |
| 168 |
|
0 => array( |
| 169 |
|
'value' => 'c1 delta 1 card_1 delta 0', |
| 170 |
|
'format' => 0, |
| 171 |
|
), |
| 172 |
|
), |
| 173 |
|
), |
| 174 |
|
'card_3' => array( |
| 175 |
|
'zxx' => array( |
| 176 |
|
0 => array( |
| 177 |
|
'value' => 'c1 delta 1 card_3 delta 0', |
| 178 |
|
'format' => 0, |
| 179 |
|
), |
| 180 |
|
1 => array( |
| 181 |
|
'value' => 'c1 delta 1 card_3 delta 1', |
| 182 |
|
'format' => 0, |
| 183 |
|
), |
| 184 |
|
), |
| 185 |
|
), |
| 186 |
|
'card_unlim' => array( |
| 187 |
|
'zxx' => array( |
| 188 |
|
0 => array( |
| 189 |
|
'value' => 'c1 delta 1 card_unlim delta 0', |
| 190 |
|
'format' => 0, |
| 191 |
|
), |
| 192 |
|
1 => array( |
| 193 |
|
'value' => 'c1 delta 1 card_unlim delta 1', |
| 194 |
|
'format' => 0, |
| 195 |
|
), |
| 196 |
|
2 => array( |
| 197 |
|
'value' => 'c1 delta 1 card_unlim delta 2', |
| 198 |
|
'format' => 0, |
| 199 |
|
), |
| 200 |
|
3 => array( |
| 201 |
|
'value' => 'c1 delta 1 card_unlim delta 3', |
| 202 |
|
'format' => 0, |
| 203 |
|
), |
| 204 |
|
), |
| 205 |
|
), |
| 206 |
|
), |
| 207 |
), |
), |
| 208 |
); |
); |
| 209 |
$insert_entity->c1['zxx'][1] = $insert_entity->c1['zxx'][0]; |
//$insert_entity->c1['zxx'][1] = $insert_entity->c1['zxx'][0]; |
| 210 |
|
|
| 211 |
field_attach_insert('test_entity', $insert_entity); |
field_attach_insert('test_entity', $insert_entity); |
| 212 |
$this->assertTrue(isset($insert_entity->c1['zxx'][0]['deltas']), 'Combo field deltas is set'); |
$this->assertTrue(isset($insert_entity->c1['zxx'][0]['deltas']), 'Combo field deltas is set'); |
| 213 |
|
|
| 214 |
// Verifying loading the combo entity created by saving the test_entity. |
// Verifying loading the combo entity created by saving the test_entity. |
| 215 |
$combo_entity = _combo_create_entity('test_entity', $insert_entity, $combo_field, NULL /* TODO NOT USED */); |
$combo_entity = _combo_create_entity('test_entity', $insert_entity, $combo_field, 0 /* TODO delta */); |
| 216 |
field_attach_load('combo', array($combo_entity->id => $combo_entity)); |
field_attach_load('combo', array($combo_entity->id => $combo_entity)); |
| 217 |
// TODO: recursive_array_compare is really not the comparison I |
// TODO: recursive_array_compare is really not the comparison I |
| 218 |
// want, so I have to unset the 'safe' item. |
// want, so I have to unset the 'safe' item. |