Issue #2035087 by lazysoundsystem, Crell, Cottser: Remove remaining t() from test assert messages in views and views_ui
parent
73063ee49a
commit
317230271a
|
|
@ -38,7 +38,7 @@ class BasicTest extends ViewUnitTestBase {
|
|||
$this->executeView($view);
|
||||
|
||||
// Verify the result.
|
||||
$this->assertEqual(5, count($view->result), t('The number of returned rows match.'));
|
||||
$this->assertEqual(5, count($view->result), 'The number of returned rows match.');
|
||||
$this->assertIdenticalResultset($view, $this->dataSet(), array(
|
||||
'views_test_data_name' => 'name',
|
||||
'views_test_data_age' => 'age',
|
||||
|
|
@ -97,7 +97,7 @@ class BasicTest extends ViewUnitTestBase {
|
|||
);
|
||||
|
||||
// Verify the result.
|
||||
$this->assertEqual(3, count($view->result), t('The number of returned rows match.'));
|
||||
$this->assertEqual(3, count($view->result), 'The number of returned rows match.');
|
||||
$this->assertIdenticalResultSet($view, $dataset, array(
|
||||
'views_test_data_name' => 'name',
|
||||
'views_test_data_age' => 'age',
|
||||
|
|
@ -123,7 +123,7 @@ class BasicTest extends ViewUnitTestBase {
|
|||
);
|
||||
|
||||
// Verify the result.
|
||||
$this->assertEqual(1, count($view->result), t('The number of returned rows match.'));
|
||||
$this->assertEqual(1, count($view->result), 'The number of returned rows match.');
|
||||
$this->assertIdenticalResultSet($view, $dataset, array(
|
||||
'views_test_data_name' => 'name',
|
||||
'views_test_data_age' => 'age',
|
||||
|
|
@ -136,7 +136,7 @@ class BasicTest extends ViewUnitTestBase {
|
|||
// Build the expected result.
|
||||
$dataset = $this->dataSet();
|
||||
|
||||
$this->assertEqual(5, count($view->result), t('The number of returned rows match.'));
|
||||
$this->assertEqual(5, count($view->result), 'The number of returned rows match.');
|
||||
$this->assertIdenticalResultSet($view, $dataset, array(
|
||||
'views_test_data_name' => 'name',
|
||||
'views_test_data_age' => 'age',
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@
|
|||
|
||||
namespace Drupal\views\Tests\Handler;
|
||||
|
||||
use Drupal\Component\Utility\String;
|
||||
use Drupal\views\Tests\ViewUnitTestBase;
|
||||
|
||||
/**
|
||||
|
|
@ -199,10 +200,10 @@ class SortDateTest extends ViewUnitTestBase {
|
|||
$this->executeView($view);
|
||||
|
||||
// Verify the result.
|
||||
$this->assertEqual(count($this->dataSet()), count($view->result), t('The number of returned rows match.'));
|
||||
$this->assertEqual(count($this->dataSet()), count($view->result), 'The number of returned rows match.');
|
||||
$this->assertIdenticalResultset($view, $this->expectedResultSet($granularity, $reverse), array(
|
||||
'views_test_data_name' => 'name',
|
||||
), t('Result is returned correctly when ordering by granularity @granularity, @reverse.', array('@granularity' => $granularity, '@reverse' => $reverse ? t('reverse') : t('forward'))));
|
||||
), String::format('Result is returned correctly when ordering by granularity @granularity, @reverse.', array('@granularity' => $granularity, '@reverse' => $reverse ? 'reverse' : 'forward')));
|
||||
$view->destroy();
|
||||
unset($view);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -76,7 +76,7 @@ class SortRandomTest extends ViewUnitTestBase {
|
|||
$this->executeView($view);
|
||||
|
||||
// Verify the result.
|
||||
$this->assertEqual(count($this->dataSet()), count($view->result), t('The number of returned rows match.'));
|
||||
$this->assertEqual(count($this->dataSet()), count($view->result), 'The number of returned rows match.');
|
||||
$this->assertIdenticalResultset($view, $this->dataSet(), array(
|
||||
'views_test_data_name' => 'name',
|
||||
'views_test_data_age' => 'age',
|
||||
|
|
@ -85,7 +85,7 @@ class SortRandomTest extends ViewUnitTestBase {
|
|||
// Execute a random view, we expect the result set to be different.
|
||||
$view_random = $this->getBasicRandomView();
|
||||
$this->executeView($view_random);
|
||||
$this->assertEqual(count($this->dataSet()), count($view_random->result), t('The number of returned rows match.'));
|
||||
$this->assertEqual(count($this->dataSet()), count($view_random->result), 'The number of returned rows match.');
|
||||
$this->assertNotIdenticalResultset($view_random, $view->result, array(
|
||||
'views_test_data_name' => 'views_test_data_name',
|
||||
'views_test_data_age' => 'views_test_data_name',
|
||||
|
|
@ -94,7 +94,7 @@ class SortRandomTest extends ViewUnitTestBase {
|
|||
// Execute a second random view, we expect the result set to be different again.
|
||||
$view_random_2 = $this->getBasicRandomView();
|
||||
$this->executeView($view_random_2);
|
||||
$this->assertEqual(count($this->dataSet()), count($view_random_2->result), t('The number of returned rows match.'));
|
||||
$this->assertEqual(count($this->dataSet()), count($view_random_2->result), 'The number of returned rows match.');
|
||||
$this->assertNotIdenticalResultset($view_random, $view->result, array(
|
||||
'views_test_data_name' => 'views_test_data_name',
|
||||
'views_test_data_age' => 'views_test_data_name',
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ class SortTest extends ViewUnitTestBase {
|
|||
$this->executeView($view);
|
||||
|
||||
// Verify the result.
|
||||
$this->assertEqual(count($this->dataSet()), count($view->result), t('The number of returned rows match.'));
|
||||
$this->assertEqual(count($this->dataSet()), count($view->result), 'The number of returned rows match.');
|
||||
$this->assertIdenticalResultset($view, $this->orderResultSet($this->dataSet(), 'age'), array(
|
||||
'views_test_data_name' => 'name',
|
||||
'views_test_data_age' => 'age',
|
||||
|
|
@ -75,7 +75,7 @@ class SortTest extends ViewUnitTestBase {
|
|||
$this->executeView($view);
|
||||
|
||||
// Verify the result.
|
||||
$this->assertEqual(count($this->dataSet()), count($view->result), t('The number of returned rows match.'));
|
||||
$this->assertEqual(count($this->dataSet()), count($view->result), 'The number of returned rows match.');
|
||||
$this->assertIdenticalResultset($view, $this->orderResultSet($this->dataSet(), 'age', TRUE), array(
|
||||
'views_test_data_name' => 'name',
|
||||
'views_test_data_age' => 'age',
|
||||
|
|
@ -104,7 +104,7 @@ class SortTest extends ViewUnitTestBase {
|
|||
$this->executeView($view);
|
||||
|
||||
// Verify the result.
|
||||
$this->assertEqual(count($this->dataSet()), count($view->result), t('The number of returned rows match.'));
|
||||
$this->assertEqual(count($this->dataSet()), count($view->result), 'The number of returned rows match.');
|
||||
$this->assertIdenticalResultset($view, $this->orderResultSet($this->dataSet(), 'name'), array(
|
||||
'views_test_data_name' => 'name',
|
||||
'views_test_data_age' => 'age',
|
||||
|
|
@ -128,7 +128,7 @@ class SortTest extends ViewUnitTestBase {
|
|||
$this->executeView($view);
|
||||
|
||||
// Verify the result.
|
||||
$this->assertEqual(count($this->dataSet()), count($view->result), t('The number of returned rows match.'));
|
||||
$this->assertEqual(count($this->dataSet()), count($view->result), 'The number of returned rows match.');
|
||||
$this->assertIdenticalResultset($view, $this->orderResultSet($this->dataSet(), 'name', TRUE), array(
|
||||
'views_test_data_name' => 'name',
|
||||
'views_test_data_age' => 'age',
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@ class AccessTest extends PluginTestBase {
|
|||
$view = views_get_view('test_access_none');
|
||||
$view->setDisplay();
|
||||
|
||||
$this->assertTrue($view->display_handler->access($this->admin_user), t('Admin-Account should be able to access the view everytime'));
|
||||
$this->assertTrue($view->display_handler->access($this->admin_user), 'Admin-Account should be able to access the view everytime');
|
||||
$this->assertTrue($view->display_handler->access($this->web_user));
|
||||
$this->assertTrue($view->display_handler->access($this->normal_user));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@ class CacheTest extends PluginTestBase {
|
|||
|
||||
$this->executeView($view);
|
||||
// Verify the result.
|
||||
$this->assertEqual(5, count($view->result), t('The number of returned rows match.'));
|
||||
$this->assertEqual(5, count($view->result), 'The number of returned rows match.');
|
||||
|
||||
// Add another man to the beatles.
|
||||
$record = array(
|
||||
|
|
@ -79,7 +79,7 @@ class CacheTest extends PluginTestBase {
|
|||
|
||||
$this->executeView($view);
|
||||
// Verify the result.
|
||||
$this->assertEqual(5, count($view->result), t('The number of returned rows match.'));
|
||||
$this->assertEqual(5, count($view->result), 'The number of returned rows match.');
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -98,7 +98,7 @@ class CacheTest extends PluginTestBase {
|
|||
|
||||
$this->executeView($view);
|
||||
// Verify the result.
|
||||
$this->assertEqual(5, count($view->result), t('The number of returned rows match.'));
|
||||
$this->assertEqual(5, count($view->result), 'The number of returned rows match.');
|
||||
|
||||
// Add another man to the beatles.
|
||||
$record = array(
|
||||
|
|
@ -119,7 +119,7 @@ class CacheTest extends PluginTestBase {
|
|||
|
||||
$this->executeView($view);
|
||||
// Verify the result.
|
||||
$this->assertEqual(6, count($view->result), t('The number of returned rows match.'));
|
||||
$this->assertEqual(6, count($view->result), 'The number of returned rows match.');
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -260,7 +260,7 @@ class PagerTest extends PluginTestBase {
|
|||
$view->pager = NULL;
|
||||
$output = $view->render();
|
||||
$output = drupal_render($output);
|
||||
$this->assertEqual(preg_match('/<ul class="pager">/', $output), 0, t('The pager is not rendered.'));
|
||||
$this->assertEqual(preg_match('/<ul class="pager">/', $output), 0, 'The pager is not rendered.');
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -196,7 +196,7 @@ class StyleTest extends ViewTestBase {
|
|||
// The newer api passes the value of the grouping as well.
|
||||
$sets_new_rendered = $view->style_plugin->renderGrouping($view->result, $view->style_plugin->options['grouping'], TRUE);
|
||||
|
||||
$this->assertEqual($sets_new_rendered, $expected, t('The style plugins should proper group the results with grouping by the rendered output.'));
|
||||
$this->assertEqual($sets_new_rendered, $expected, 'The style plugins should proper group the results with grouping by the rendered output.');
|
||||
|
||||
// Don't test stripped case, because the actual value is not stripped.
|
||||
if (!$stripped) {
|
||||
|
|
@ -214,7 +214,7 @@ class StyleTest extends ViewTestBase {
|
|||
unset($expected['Job: Drummer']);
|
||||
unset($expected['Drummer']['rows']['Age: 28']);
|
||||
|
||||
$this->assertEqual($sets_new_value, $expected, t('The style plugins should proper group the results with grouping by the value.'));
|
||||
$this->assertEqual($sets_new_value, $expected, 'The style plugins should proper group the results with grouping by the value.');
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -135,7 +135,7 @@ class BasicTest extends WizardTestBase {
|
|||
$this->assertNoText($node2->label());
|
||||
|
||||
// Make sure the listing page doesn't show disabled default views.
|
||||
$this->assertNoText('tracker', t('Default tracker view does not show on the listing page.'));
|
||||
$this->assertNoText('tracker', 'Default tracker view does not show on the listing page.');
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -72,7 +72,7 @@ class ItemsPerPageTest extends WizardTestBase {
|
|||
$pos4 = strpos($content, $node4->label());
|
||||
$pos3 = strpos($content, $node3->label());
|
||||
$pos2 = strpos($content, $node2->label());
|
||||
$this->assertTrue($pos5 < $pos4 && $pos4 < $pos3 && $pos3 < $pos2, t('The nodes appear in the expected order in the page display.'));
|
||||
$this->assertTrue($pos5 < $pos4 && $pos4 < $pos3 && $pos3 < $pos2, 'The nodes appear in the expected order in the page display.');
|
||||
|
||||
// Confirm that the block is listed in the block administration UI.
|
||||
$this->drupalGet('admin/structure/block/list/block_plugin_ui:' . config('system.theme')->get('default') . '/add');
|
||||
|
|
@ -93,7 +93,7 @@ class ItemsPerPageTest extends WizardTestBase {
|
|||
$pos5 = strpos($content, $node5->label());
|
||||
$pos4 = strpos($content, $node4->label());
|
||||
$pos3 = strpos($content, $node3->label());
|
||||
$this->assertTrue($pos5 < $pos4 && $pos4 < $pos3, t('The nodes appear in the expected order in the block display.'));
|
||||
$this->assertTrue($pos5 < $pos4 && $pos4 < $pos3, 'The nodes appear in the expected order in the block display.');
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@ class SortingTest extends WizardTestBase {
|
|||
$pos1 = strpos($content, $node1->label());
|
||||
$pos2 = strpos($content, $node2->label());
|
||||
$pos3 = strpos($content, $node3->label());
|
||||
$this->assertTrue($pos1 < $pos2 && $pos2 < $pos3, t('The nodes appear in the expected order in a view that sorts by oldest first.'));
|
||||
$this->assertTrue($pos1 < $pos2 && $pos2 < $pos3, 'The nodes appear in the expected order in a view that sorts by oldest first.');
|
||||
|
||||
// Create a view that sorts newest first.
|
||||
$view2 = array();
|
||||
|
|
@ -78,7 +78,7 @@ class SortingTest extends WizardTestBase {
|
|||
$pos3 = strpos($content, $node3->label());
|
||||
$pos2 = strpos($content, $node2->label());
|
||||
$pos1 = strpos($content, $node1->label());
|
||||
$this->assertTrue($pos3 < $pos2 && $pos2 < $pos1, t('The nodes appear in the expected order in a view that sorts by newest first.'));
|
||||
$this->assertTrue($pos3 < $pos2 && $pos2 < $pos1, 'The nodes appear in the expected order in a view that sorts by newest first.');
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -84,7 +84,7 @@ class ExposedFormUITest extends UITestBase {
|
|||
// Now check the sort criteria.
|
||||
$this->drupalGet('admin/structure/views/nojs/config-item/test_exposed_admin_ui/default/sort/created');
|
||||
$this->helperButtonHasLabel('edit-options-expose-button-button', t('Expose sort'));
|
||||
$this->assertNoFieldById('edit-options-expose-label', '', t('Make sure no label field is shown'));
|
||||
$this->assertNoFieldById('edit-options-expose-label', '', 'Make sure no label field is shown');
|
||||
|
||||
// Click the Grouped Filters button.
|
||||
$this->drupalGet('admin/structure/views/nojs/config-item/test_exposed_admin_ui/default/filter/type');
|
||||
|
|
@ -140,7 +140,7 @@ class ExposedFormUITest extends UITestBase {
|
|||
$edit["options[group_info][group_items][3][value][article]"] = TRUE;
|
||||
$edit["options[group_info][group_items][3][value][page]"] = TRUE;
|
||||
$this->drupalPost(NULL, $edit, t('Apply'));
|
||||
$this->assertRaw(t('The title is required if value for this item is defined.'), t('Group items should have a title'));
|
||||
$this->assertRaw(t('The title is required if value for this item is defined.'), 'Group items should have a title');
|
||||
|
||||
// Un-expose the filter.
|
||||
$this->drupalGet('admin/structure/views/nojs/config-item/test_exposed_admin_ui/default/filter/type');
|
||||
|
|
@ -157,6 +157,6 @@ class ExposedFormUITest extends UITestBase {
|
|||
$this->drupalPost('admin/structure/views/nojs/config-item/test_exposed_admin_ui/default/sort/created', $edit, t('Expose sort'));
|
||||
// Check the label of the expose button.
|
||||
$this->helperButtonHasLabel('edit-options-expose-button-button', t('Hide sort'));
|
||||
$this->assertFieldById('edit-options-expose-label', '', t('Make sure a label field is shown'));
|
||||
$this->assertFieldById('edit-options-expose-label', '', 'Make sure a label field is shown');
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue