public function viewsHandlerFieldFieldTest::_testFormatterSimpleFieldRender
3.x views_fieldapi.test | public viewsHandlerFieldFieldTest::_testFormatterSimpleFieldRender() |
Tests that fields with formatters runs as expected.
1 call to viewsHandlerFieldFieldTest::_testFormatterSimpleFieldRender()
- viewsHandlerFieldFieldTest::testFieldRender in tests/
field/ views_fieldapi.test
File
- tests/
field/ views_fieldapi.test, line 347 - Tests the fieldapi integration of viewsdata.
Class
- viewsHandlerFieldFieldTest
- Tests the field_field handler. @TODO Check a entity-type with bundles Check a entity-type without bundles Check locale:disabled, locale:enabled and locale:enabled with another language Check revisions
Code
public function _testFormatterSimpleFieldRender() {
$view = $this->getFieldView();
$view->display['default']->display_options['fields'][$this->fields[0]['field_name']]['type'] = 'text_trimmed';
$view->display['default']->display_options['fields'][$this->fields[0]['field_name']]['settings'] = array(
'trim_length' => 3,
);
$this->executeView($view);
// Take sure that the formatter works as expected.
// @TODO: actually there should be a specific formatter.
for ($i = 0; $i < 2; $i++) {
$rendered_field = $view->style_plugin->get_field($i, $this->fields[0]['field_name']);
$this->assertEqual(strlen($rendered_field), 3);
}
}