Commit 3fdf6a1c authored by webchick's avatar webchick
Browse files

Issue #2002348 by baldwinlouie, heddn, sillygwailo: Rename Views method...

Issue #2002348 by baldwinlouie, heddn, sillygwailo: Rename Views method advanced_render() to advancedRender().
parent 2be9d02f
......@@ -77,16 +77,16 @@ public function testFileExtensionTarOption() {
$this->executeView($view);
// Test without the tar option.
$this->assertEqual($view->field['name']->advanced_render($view->result[0]), 'png');
$this->assertEqual($view->field['name']->advanced_render($view->result[1]), 'tar');
$this->assertEqual($view->field['name']->advanced_render($view->result[2]), 'gz');
$this->assertEqual($view->field['name']->advanced_render($view->result[3]), '');
$this->assertEqual($view->field['name']->advancedRender($view->result[0]), 'png');
$this->assertEqual($view->field['name']->advancedRender($view->result[1]), 'tar');
$this->assertEqual($view->field['name']->advancedRender($view->result[2]), 'gz');
$this->assertEqual($view->field['name']->advancedRender($view->result[3]), '');
// Test with the tar option.
$view->field['name']->options['extension_detect_tar'] = TRUE;
$this->assertEqual($view->field['name']->advanced_render($view->result[0]), 'png');
$this->assertEqual($view->field['name']->advanced_render($view->result[1]), 'tar');
$this->assertEqual($view->field['name']->advanced_render($view->result[2]), 'tar.gz');
$this->assertEqual($view->field['name']->advanced_render($view->result[3]), '');
$this->assertEqual($view->field['name']->advancedRender($view->result[0]), 'png');
$this->assertEqual($view->field['name']->advancedRender($view->result[1]), 'tar');
$this->assertEqual($view->field['name']->advancedRender($view->result[2]), 'tar.gz');
$this->assertEqual($view->field['name']->advancedRender($view->result[3]), '');
}
}
......@@ -46,8 +46,8 @@ public function testField() {
));
$this->executeView($view);
$this->assertEqual($view->field['langcode']->advanced_render($view->result[0]), 'English');
$this->assertEqual($view->field['langcode']->advanced_render($view->result[1]), 'Lolspeak');
$this->assertEqual($view->field['langcode']->advancedRender($view->result[0]), 'English');
$this->assertEqual($view->field['langcode']->advancedRender($view->result[1]), 'Lolspeak');
}
}
......@@ -51,7 +51,7 @@ public function testRole() {
$view->row_index = 0;
// The role field is populated during pre_render.
$view->field['rid']->pre_render($view->result);
$render = $view->field['rid']->advanced_render($view->result[0]);
$render = $view->field['rid']->advancedRender($view->result[0]);
$this->assertEqual($rolename_b . $rolename_a, $render, 'View test_views_handler_field_role renders role assigned to user in the correct order.');
$this->assertFalse(strpos($render, $rolename_not_assigned), 'View test_views_handler_field_role does not render a role not assigned to a user.');
......
......@@ -38,25 +38,25 @@ public function testUserName() {
$view->field['name']->options['link_to_user'] = TRUE;
$username = $view->result[0]->users_name = $this->randomName();
$view->result[0]->uid = 1;
$render = $view->field['name']->advanced_render($view->result[0]);
$render = $view->field['name']->advancedRender($view->result[0]);
$this->assertTrue(strpos($render, $username) !== FALSE, 'If link to user is checked the username should be part of the output.');
$this->assertTrue(strpos($render, 'user/1') !== FALSE, 'If link to user is checked the link to the user should appear as well.');
$view->field['name']->options['link_to_user'] = FALSE;
$username = $view->result[0]->users_name = $this->randomName();
$view->result[0]->uid = 1;
$render = $view->field['name']->advanced_render($view->result[0]);
$render = $view->field['name']->advancedRender($view->result[0]);
$this->assertIdentical($render, $username, 'If the user is not linked the username should be printed out for a normal user.');
$view->result[0]->uid = 0;
$anon_name = config('user.settings')->get('anonymous');
$view->result[0]->users_name = '';
$render = $view->field['name']->advanced_render($view->result[0]);
$render = $view->field['name']->advancedRender($view->result[0]);
$this->assertIdentical($render, $anon_name , 'For user0 it should use the default anonymous name by default.');
$view->field['name']->options['overwrite_anonymous'] = TRUE;
$anon_name = $view->field['name']->options['anonymous_text'] = $this->randomName();
$render = $view->field['name']->advanced_render($view->result[0]);
$render = $view->field['name']->advancedRender($view->result[0]);
$this->assertIdentical($render, $anon_name , 'For user0 it should use the configured anonymous text if overwrite_anonymous is checked.');
}
......
......@@ -1108,7 +1108,7 @@ function render($values) {
* This renders a field normally, then decides if render-as-link and
* text-replacement rendering is necessary.
*/
function advanced_render($values) {
public function advancedRender($values) {
if ($this->allowAdvancedRender() && method_exists($this, 'render_item')) {
$raw_items = $this->get_items($values);
// If there are no items, set the original value to NULL.
......
......@@ -59,31 +59,31 @@ public function testFieldBoolean() {
$this->executeView($view);
// This is john, which has no age, there are no custom formats defined, yet.
$this->assertEqual(t('No'), $view->field['age']->advanced_render($view->result[0]));
$this->assertEqual(t('Yes'), $view->field['age']->advanced_render($view->result[1]));
$this->assertEqual(t('No'), $view->field['age']->advancedRender($view->result[0]));
$this->assertEqual(t('Yes'), $view->field['age']->advancedRender($view->result[1]));
// Reverse the output.
$view->field['age']->options['not'] = TRUE;
$this->assertEqual(t('Yes'), $view->field['age']->advanced_render($view->result[0]));
$this->assertEqual(t('No'), $view->field['age']->advanced_render($view->result[1]));
$this->assertEqual(t('Yes'), $view->field['age']->advancedRender($view->result[0]));
$this->assertEqual(t('No'), $view->field['age']->advancedRender($view->result[1]));
unset($view->field['age']->options['not']);
// Use another output format.
$view->field['age']->options['type'] = 'true-false';
$this->assertEqual(t('False'), $view->field['age']->advanced_render($view->result[0]));
$this->assertEqual(t('True'), $view->field['age']->advanced_render($view->result[1]));
$this->assertEqual(t('False'), $view->field['age']->advancedRender($view->result[0]));
$this->assertEqual(t('True'), $view->field['age']->advancedRender($view->result[1]));
// test awesome unicode.
$view->field['age']->options['type'] = 'unicode-yes-no';
$this->assertEqual('✖', $view->field['age']->advanced_render($view->result[0]));
$this->assertEqual('✔', $view->field['age']->advanced_render($view->result[1]));
$this->assertEqual('✖', $view->field['age']->advancedRender($view->result[0]));
$this->assertEqual('✔', $view->field['age']->advancedRender($view->result[1]));
// Set a custom output format.
$view->field['age']->formats['test'] = array(t('Test-True'), t('Test-False'));
$view->field['age']->options['type'] = 'test';
$this->assertEqual(t('Test-False'), $view->field['age']->advanced_render($view->result[0]));
$this->assertEqual(t('Test-True'), $view->field['age']->advanced_render($view->result[1]));
$this->assertEqual(t('Test-False'), $view->field['age']->advancedRender($view->result[0]));
$this->assertEqual(t('Test-True'), $view->field['age']->advancedRender($view->result[1]));
}
}
......@@ -93,7 +93,7 @@ protected function assertRenderedDatesEqual($view, $map, $timezone = NULL) {
else {
$message = t('Value %value in %format format matches.', $t_args);
}
$actual_result = $view->field['created']->advanced_render($view->result[0]);
$actual_result = $view->field['created']->advancedRender($view->result[0]);
$this->assertEqual($expected_result, $actual_result, $message);
}
}
......
......@@ -63,16 +63,16 @@ public function testFieldFileSize() {
$this->executeView($view);
// Test with the formatted option.
$this->assertEqual($view->field['age']->advanced_render($view->result[0]), '');
$this->assertEqual($view->field['age']->advanced_render($view->result[1]), '10 bytes');
$this->assertEqual($view->field['age']->advanced_render($view->result[2]), '1000 bytes');
$this->assertEqual($view->field['age']->advanced_render($view->result[3]), '9.77 KB');
$this->assertEqual($view->field['age']->advancedRender($view->result[0]), '');
$this->assertEqual($view->field['age']->advancedRender($view->result[1]), '10 bytes');
$this->assertEqual($view->field['age']->advancedRender($view->result[2]), '1000 bytes');
$this->assertEqual($view->field['age']->advancedRender($view->result[3]), '9.77 KB');
// Test with the bytes option.
$view->field['age']->options['file_size_display'] = 'bytes';
$this->assertEqual($view->field['age']->advanced_render($view->result[0]), '');
$this->assertEqual($view->field['age']->advanced_render($view->result[1]), 10);
$this->assertEqual($view->field['age']->advanced_render($view->result[2]), 1000);
$this->assertEqual($view->field['age']->advanced_render($view->result[3]), 10000);
$this->assertEqual($view->field['age']->advancedRender($view->result[0]), '');
$this->assertEqual($view->field['age']->advancedRender($view->result[1]), 10);
$this->assertEqual($view->field['age']->advancedRender($view->result[2]), 1000);
$this->assertEqual($view->field['age']->advancedRender($view->result[3]), 10000);
}
}
......@@ -188,13 +188,13 @@ public function testFieldTokens() {
$expected_output_1 = "$row->views_test_data_name $row->views_test_data_name";
$expected_output_2 = "$row->views_test_data_name $row->views_test_data_name $row->views_test_data_name";
$output = $name_field_0->advanced_render($row);
$output = $name_field_0->advancedRender($row);
$this->assertEqual($output, $expected_output_0);
$output = $name_field_1->advanced_render($row);
$output = $name_field_1->advancedRender($row);
$this->assertEqual($output, $expected_output_1);
$output = $name_field_2->advanced_render($row);
$output = $name_field_2->advancedRender($row);
$this->assertEqual($output, $expected_output_2);
}
......@@ -204,7 +204,7 @@ public function testFieldTokens() {
$random_text = $this->randomName();
$job_field->setTestValue($random_text);
$output = $job_field->advanced_render($row);
$output = $job_field->advancedRender($row);
$this->assertSubString($output, $random_text, format_string('Make sure the self token (!value) appears in the output (!output)', array('!value' => $random_text, '!output' => $output)));
}
......@@ -263,22 +263,22 @@ function _testHideIfEmpty() {
// Test a valid string.
$view->result[0]->{$column_map_reversed['name']} = $random_name;
$render = $view->field['name']->advanced_render($view->result[0]);
$render = $view->field['name']->advancedRender($view->result[0]);
$this->assertIdentical($render, $random_name, 'By default, a string should not be treated as empty.');
// Test an empty string.
$view->result[0]->{$column_map_reversed['name']} = "";
$render = $view->field['name']->advanced_render($view->result[0]);
$render = $view->field['name']->advancedRender($view->result[0]);
$this->assertIdentical($render, "", 'By default, "" should not be treated as empty.');
// Test zero as an integer.
$view->result[0]->{$column_map_reversed['name']} = 0;
$render = $view->field['name']->advanced_render($view->result[0]);
$render = $view->field['name']->advancedRender($view->result[0]);
$this->assertIdentical($render, '0', 'By default, 0 should not be treated as empty.');
// Test zero as a string.
$view->result[0]->{$column_map_reversed['name']} = "0";
$render = $view->field['name']->advanced_render($view->result[0]);
$render = $view->field['name']->advancedRender($view->result[0]);
$this->assertIdentical($render, "0", 'By default, "0" should not be treated as empty.');
// Test when results are not rewritten and non-zero empty values are hidden.
......@@ -288,22 +288,22 @@ function _testHideIfEmpty() {
// Test a valid string.
$view->result[0]->{$column_map_reversed['name']} = $random_name;
$render = $view->field['name']->advanced_render($view->result[0]);
$render = $view->field['name']->advancedRender($view->result[0]);
$this->assertIdentical($render, $random_name, 'If hide_empty is checked, a string should not be treated as empty.');
// Test an empty string.
$view->result[0]->{$column_map_reversed['name']} = "";
$render = $view->field['name']->advanced_render($view->result[0]);
$render = $view->field['name']->advancedRender($view->result[0]);
$this->assertIdentical($render, "", 'If hide_empty is checked, "" should be treated as empty.');
// Test zero as an integer.
$view->result[0]->{$column_map_reversed['name']} = 0;
$render = $view->field['name']->advanced_render($view->result[0]);
$render = $view->field['name']->advancedRender($view->result[0]);
$this->assertIdentical($render, '0', 'If hide_empty is checked, but not empty_zero, 0 should not be treated as empty.');
// Test zero as a string.
$view->result[0]->{$column_map_reversed['name']} = "0";
$render = $view->field['name']->advanced_render($view->result[0]);
$render = $view->field['name']->advancedRender($view->result[0]);
$this->assertIdentical($render, "0", 'If hide_empty is checked, but not empty_zero, "0" should not be treated as empty.');
// Test when results are not rewritten and all empty values are hidden.
......@@ -313,12 +313,12 @@ function _testHideIfEmpty() {
// Test zero as an integer.
$view->result[0]->{$column_map_reversed['name']} = 0;
$render = $view->field['name']->advanced_render($view->result[0]);
$render = $view->field['name']->advancedRender($view->result[0]);
$this->assertIdentical($render, "", 'If hide_empty and empty_zero are checked, 0 should be treated as empty.');
// Test zero as a string.
$view->result[0]->{$column_map_reversed['name']} = "0";
$render = $view->field['name']->advanced_render($view->result[0]);
$render = $view->field['name']->advancedRender($view->result[0]);
$this->assertIdentical($render, "", 'If hide_empty and empty_zero are checked, "0" should be treated as empty.');
// Test when results are rewritten to a valid string and non-zero empty
......@@ -331,22 +331,22 @@ function _testHideIfEmpty() {
// Test a valid string.
$view->result[0]->{$column_map_reversed['name']} = $random_value;
$render = $view->field['name']->advanced_render($view->result[0]);
$render = $view->field['name']->advancedRender($view->result[0]);
$this->assertIdentical($render, $random_name, 'If the rewritten string is not empty, it should not be treated as empty.');
// Test an empty string.
$view->result[0]->{$column_map_reversed['name']} = "";
$render = $view->field['name']->advanced_render($view->result[0]);
$render = $view->field['name']->advancedRender($view->result[0]);
$this->assertIdentical($render, $random_name, 'If the rewritten string is not empty, "" should not be treated as empty.');
// Test zero as an integer.
$view->result[0]->{$column_map_reversed['name']} = 0;
$render = $view->field['name']->advanced_render($view->result[0]);
$render = $view->field['name']->advancedRender($view->result[0]);
$this->assertIdentical($render, $random_name, 'If the rewritten string is not empty, 0 should not be treated as empty.');
// Test zero as a string.
$view->result[0]->{$column_map_reversed['name']} = "0";
$render = $view->field['name']->advanced_render($view->result[0]);
$render = $view->field['name']->advancedRender($view->result[0]);
$this->assertIdentical($render, $random_name, 'If the rewritten string is not empty, "0" should not be treated as empty.');
// Test when results are rewritten to an empty string and non-zero empty results are hidden.
......@@ -358,22 +358,22 @@ function _testHideIfEmpty() {
// Test a valid string.
$view->result[0]->{$column_map_reversed['name']} = $random_name;
$render = $view->field['name']->advanced_render($view->result[0]);
$render = $view->field['name']->advancedRender($view->result[0]);
$this->assertIdentical($render, $random_name, 'If the rewritten string is empty, it should not be treated as empty.');
// Test an empty string.
$view->result[0]->{$column_map_reversed['name']} = "";
$render = $view->field['name']->advanced_render($view->result[0]);
$render = $view->field['name']->advancedRender($view->result[0]);
$this->assertIdentical($render, "", 'If the rewritten string is empty, "" should be treated as empty.');
// Test zero as an integer.
$view->result[0]->{$column_map_reversed['name']} = 0;
$render = $view->field['name']->advanced_render($view->result[0]);
$render = $view->field['name']->advancedRender($view->result[0]);
$this->assertIdentical($render, '0', 'If the rewritten string is empty, 0 should not be treated as empty.');
// Test zero as a string.
$view->result[0]->{$column_map_reversed['name']} = "0";
$render = $view->field['name']->advanced_render($view->result[0]);
$render = $view->field['name']->advancedRender($view->result[0]);
$this->assertIdentical($render, "0", 'If the rewritten string is empty, "0" should not be treated as empty.');
// Test when results are rewritten to zero as a string and non-zero empty
......@@ -386,22 +386,22 @@ function _testHideIfEmpty() {
// Test a valid string.
$view->result[0]->{$column_map_reversed['name']} = $random_name;
$render = $view->field['name']->advanced_render($view->result[0]);
$render = $view->field['name']->advancedRender($view->result[0]);
$this->assertIdentical($render, "0", 'If the rewritten string is zero and empty_zero is not checked, the string rewritten as 0 should not be treated as empty.');
// Test an empty string.
$view->result[0]->{$column_map_reversed['name']} = "";
$render = $view->field['name']->advanced_render($view->result[0]);
$render = $view->field['name']->advancedRender($view->result[0]);
$this->assertIdentical($render, "0", 'If the rewritten string is zero and empty_zero is not checked, "" rewritten as 0 should not be treated as empty.');
// Test zero as an integer.
$view->result[0]->{$column_map_reversed['name']} = 0;
$render = $view->field['name']->advanced_render($view->result[0]);
$render = $view->field['name']->advancedRender($view->result[0]);
$this->assertIdentical($render, "0", 'If the rewritten string is zero and empty_zero is not checked, 0 should not be treated as empty.');
// Test zero as a string.
$view->result[0]->{$column_map_reversed['name']} = "0";
$render = $view->field['name']->advanced_render($view->result[0]);
$render = $view->field['name']->advancedRender($view->result[0]);
$this->assertIdentical($render, "0", 'If the rewritten string is zero and empty_zero is not checked, "0" should not be treated as empty.');
// Test when results are rewritten to a valid string and non-zero empty
......@@ -414,22 +414,22 @@ function _testHideIfEmpty() {
// Test a valid string.
$view->result[0]->{$column_map_reversed['name']} = $random_name;
$render = $view->field['name']->advanced_render($view->result[0]);
$render = $view->field['name']->advancedRender($view->result[0]);
$this->assertIdentical($render, $random_value, 'If the original and rewritten strings are valid, it should not be treated as empty.');
// Test an empty string.
$view->result[0]->{$column_map_reversed['name']} = "";
$render = $view->field['name']->advanced_render($view->result[0]);
$render = $view->field['name']->advancedRender($view->result[0]);
$this->assertIdentical($render, "", 'If either the original or rewritten string is invalid, "" should be treated as empty.');
// Test zero as an integer.
$view->result[0]->{$column_map_reversed['name']} = 0;
$render = $view->field['name']->advanced_render($view->result[0]);
$render = $view->field['name']->advancedRender($view->result[0]);
$this->assertIdentical($render, $random_value, 'If the original and rewritten strings are valid, 0 should not be treated as empty.');
// Test zero as a string.
$view->result[0]->{$column_map_reversed['name']} = "0";
$render = $view->field['name']->advanced_render($view->result[0]);
$render = $view->field['name']->advancedRender($view->result[0]);
$this->assertIdentical($render, $random_value, 'If the original and rewritten strings are valid, "0" should not be treated as empty.');
// Test when results are rewritten to zero as a string and all empty
......@@ -442,22 +442,22 @@ function _testHideIfEmpty() {
// Test a valid string.
$view->result[0]->{$column_map_reversed['name']} = $random_name;
$render = $view->field['name']->advanced_render($view->result[0]);
$render = $view->field['name']->advancedRender($view->result[0]);
$this->assertIdentical($render, "", 'If the rewritten string is zero, it should be treated as empty.');
// Test an empty string.
$view->result[0]->{$column_map_reversed['name']} = "";
$render = $view->field['name']->advanced_render($view->result[0]);
$render = $view->field['name']->advancedRender($view->result[0]);
$this->assertIdentical($render, "", 'If the rewritten string is zero, "" should be treated as empty.');
// Test zero as an integer.
$view->result[0]->{$column_map_reversed['name']} = 0;
$render = $view->field['name']->advanced_render($view->result[0]);
$render = $view->field['name']->advancedRender($view->result[0]);
$this->assertIdentical($render, "", 'If the rewritten string is zero, 0 should not be treated as empty.');
// Test zero as a string.
$view->result[0]->{$column_map_reversed['name']} = "0";
$render = $view->field['name']->advanced_render($view->result[0]);
$render = $view->field['name']->advancedRender($view->result[0]);
$this->assertIdentical($render, "", 'If the rewritten string is zero, "0" should not be treated as empty.');
}
......@@ -474,27 +474,27 @@ function _testEmptyText() {
$empty_text = $view->field['name']->options['empty'] = $this->randomName();
$view->result[0]->{$column_map_reversed['name']} = "";
$render = $view->field['name']->advanced_render($view->result[0]);
$render = $view->field['name']->advancedRender($view->result[0]);
$this->assertIdentical($render, $empty_text, 'If a field is empty, the empty text should be used for the output.');
$view->result[0]->{$column_map_reversed['name']} = "0";
$render = $view->field['name']->advanced_render($view->result[0]);
$render = $view->field['name']->advancedRender($view->result[0]);
$this->assertIdentical($render, "0", 'If a field is 0 and empty_zero is not checked, the empty text should not be used for the output.');
$view->result[0]->{$column_map_reversed['name']} = "0";
$view->field['name']->options['empty_zero'] = TRUE;
$render = $view->field['name']->advanced_render($view->result[0]);
$render = $view->field['name']->advancedRender($view->result[0]);
$this->assertIdentical($render, $empty_text, 'If a field is 0 and empty_zero is checked, the empty text should be used for the output.');
$view->result[0]->{$column_map_reversed['name']} = "";
$view->field['name']->options['alter']['alter_text'] = TRUE;
$alter_text = $view->field['name']->options['alter']['text'] = $this->randomName();
$view->field['name']->options['hide_alter_empty'] = FALSE;
$render = $view->field['name']->advanced_render($view->result[0]);
$render = $view->field['name']->advancedRender($view->result[0]);
$this->assertIdentical($render, $alter_text, 'If a field is empty, some rewrite text exists, but hide_alter_empty is not checked, render the rewrite text.');
$view->field['name']->options['hide_alter_empty'] = TRUE;
$render = $view->field['name']->advanced_render($view->result[0]);
$render = $view->field['name']->advancedRender($view->result[0]);
$this->assertIdentical($render, $empty_text, 'If a field is empty, some rewrite text exists, and hide_alter_empty is checked, use the empty text.');
}
......
......@@ -58,7 +58,7 @@ public function testFieldUrl() {
$this->executeView($view);
$this->assertEqual('John', $view->field['name']->advanced_render($view->result[0]));
$this->assertEqual('John', $view->field['name']->advancedRender($view->result[0]));
// Make the url a link.
$view->destroy();
......@@ -75,7 +75,7 @@ public function testFieldUrl() {
$this->executeView($view);
$this->assertEqual(l('John', 'John'), $view->field['name']->advanced_render($view->result[0]));
$this->assertEqual(l('John', 'John'), $view->field['name']->advancedRender($view->result[0]));
}
}
......@@ -442,18 +442,18 @@ public function testTextRendering() {
$row = $view->result[0];
$name_field->options['alter']['strip_tags'] = TRUE;
$output = $name_field->advanced_render($row);
$output = $name_field->advancedRender($row);
$this->assertSubString($output, $random_text, 'Find text without html if stripping of views field output is enabled.');
$this->assertNotSubString($output, $html_text, 'Find no text with the html if stripping of views field output is enabled.');
// Tests preserving of html tags.
$name_field->options['alter']['preserve_tags'] = '<div>';
$output = $name_field->advanced_render($row);
$output = $name_field->advancedRender($row);
$this->assertSubString($output, $random_text, 'Find text without html if stripping of views field output is enabled but a div is allowed.');
$this->assertSubString($output, $html_text, 'Find text with the html if stripping of views field output is enabled but a div is allowed.');
$name_field->options['alter']['strip_tags'] = FALSE;
$output = $name_field->advanced_render($row);
$output = $name_field->advancedRender($row);
$this->assertSubString($output, $random_text, 'Find text without html if stripping of views field output is disabled.');
$this->assertSubString($output, $html_text, 'Find text with the html if stripping of views field output is disabled.');
......@@ -462,13 +462,13 @@ public function testTextRendering() {
$views_test_data_name = $row->views_test_data_name;
$row->views_test_data_name = ' ' . $views_test_data_name . ' ';
$name_field->options['alter']['trim_whitespace'] = TRUE;
$output = $name_field->advanced_render($row);
$output = $name_field->advancedRender($row);
$this->assertSubString($output, $views_test_data_name, 'Make sure the trimmed text can be found if trimming is enabled.');
$this->assertNotSubString($output, $row->views_test_data_name, 'Make sure the untrimmed text can be found if trimming is enabled.');
$name_field->options['alter']['trim_whitespace'] = FALSE;
$output = $name_field->advanced_render($row);
$output = $name_field->advancedRender($row);
$this->assertSubString($output, $views_test_data_name, 'Make sure the trimmed text can be found if trimming is disabled.');
$this->assertSubString($output, $row->views_test_data_name, 'Make sure the untrimmed text can be found if trimming is disabled.');
......@@ -481,12 +481,12 @@ public function testTextRendering() {
$name_field->options['alter']['max_length'] = 5;
$trimmed_name = drupal_substr($row->views_test_data_name, 0, 5);
$output = $name_field->advanced_render($row);
$output = $name_field->advancedRender($row);
$this->assertSubString($output, $trimmed_name, format_string('Make sure the trimmed output (!trimmed) appears in the rendered output (!output).', array('!trimmed' => $trimmed_name, '!output' => $output)));
$this->assertNotSubString($output, $row->views_test_data_name, format_string("Make sure the untrimmed value (!untrimmed) shouldn't appear in the rendered output (!output).", array('!untrimmed' => $row->views_test_data_name, '!output' => $output)));
$name_field->options['alter']['max_length'] = 9;
$output = $name_field->advanced_render($row);
$output = $name_field->advancedRender($row);
$this->assertSubString($output, $trimmed_name, format_string('Make sure the untrimmed (!untrimmed) output appears in the rendered output (!output).', array('!trimmed' => $trimmed_name, '!output' => $output)));
// Take word_boundary into account for the tests.
......@@ -526,7 +526,7 @@ public function testTextRendering() {
foreach ($touples as $touple) {
$row->views_test_data_name = $touple['value'];
$output = $name_field->advanced_render($row);
$output = $name_field->advancedRender($row);
if ($touple['trimmed']) {
$this->assertNotSubString($output, $touple['value'], format_string('The untrimmed value (!untrimmed) should not appear in the trimmed output (!output).', array('!untrimmed' => $touple['value'], '!output' => $output)));
......@@ -543,22 +543,22 @@ public function testTextRendering() {
$name_field->options['alter']['more_link_text'] = $more_text = $this->randomName();
$name_field->options['alter']['more_link_path'] = $more_path = $this->randomName();
$output = $name_field->advanced_render($row);
$output = $name_field->advancedRender($row);
$this->assertSubString($output, $more_text, 'Make sure a read more text is displayed if the output got trimmed');
$this->assertTrue($this->xpathContent($output, '//a[contains(@href, :path)]', array(':path' => $more_path)), 'Make sure the read more link points to the right destination.');
$name_field->options['alter']['more_link'] = FALSE;
$output = $name_field->advanced_render($row);
$output = $name_field->advancedRender($row);
$this->assertNotSubString($output, $more_text, 'Make sure no read more text appears.');
$this->assertFalse($this->xpathContent($output, '//a[contains(@href, :path)]', array(':path' => $more_path)), 'Make sure no read more link appears.');
// Check for the ellipses.
$row->views_test_data_name = $this->randomName(8);
$name_field->options['alter']['max_length'] = 5;
$output = $name_field->advanced_render($row);
$output = $name_field->advancedRender($row);
$this->assertSubString($output, '...', 'An ellipsis should appear if the output is trimmed');
$name_field->options['alter']['max_length'] = 10;
$output = $name_field->advanced_render($row);
$output = $name_field->advancedRender($row);
$this->assertNotSubString($output, '...', 'No ellipsis should appear if the output is not trimmed');
}
......
......@@ -66,7 +66,7 @@ public function testFieldXss() {
$counter = 0;
foreach ($this->dataHelper() as $input => $expected_result) {
$view->result[$counter]->views_test_data_name = $input;
$this