MultifieldTestBase.test in Multifield 7
File
tests/MultifieldTestBase.test
View source
<?php
abstract class MultifieldTestBase extends DrupalWebTestCase {
protected $profile = 'testing';
public function setUp() {
$args = func_get_args();
$modules = isset($args[0]) && is_array($args[0]) ? $args[0] : array();
parent::setUp(array_merge(array(
'multifield',
'field_test',
), $modules));
}
public function submitEntity($entity_type, $entity) {
$form = array(
'#parents' => array(),
);
$form_state = array(
'values' => array(),
);
field_attach_submit($entity_type, $entity, $form, $form_state);
}
public function saveTestEntity($entity) {
$this
->submitEntity('test_entity', $entity);
field_test_entity_save($entity);
return field_test_entity_test_load($entity->ftid);
}
}