From dd5d0f619a7465ebde55fc0412c838a944383995 Mon Sep 17 00:00:00 2001 From: Jennifer Hodgdon Date: Wed, 3 Oct 2012 09:53:46 -0700 Subject: [PATCH] Issue #1797200 by pillarsdotnet, boombatower, solotandem, ZenDoodles, sun, xjm, yched, Damien Tournoud: (crediting those who worked on previous versions of this patch as well) Remove t() from test assertions in node module --- .../node/Tests/NodeAccessBaseTableTest.php | 6 ++-- .../node/Tests/NodeAccessLanguageTest.php | 2 +- .../node/Tests/NodeAccessRecordsTest.php | 34 +++++++++--------- .../lib/Drupal/node/Tests/NodeAdminTest.php | 12 +++---- .../node/Tests/NodeBlockFunctionalTest.php | 36 +++++++++---------- .../lib/Drupal/node/Tests/NodeBlockTest.php | 4 +-- .../node/Tests/NodeBuildContentTest.php | 2 +- .../Drupal/node/Tests/NodeCreationTest.php | 14 ++++---- .../Tests/NodeFieldMultilingualTestCase.php | 16 ++++----- .../node/Tests/NodeLoadMultipleTest.php | 20 +++++------ .../node/Tests/NodePostSettingsTest.php | 4 +-- .../Drupal/node/Tests/NodeQueryAlterTest.php | 10 +++--- .../Drupal/node/Tests/NodeRSSContentTest.php | 8 ++--- .../Drupal/node/Tests/NodeRevisionsTest.php | 16 ++++----- .../lib/Drupal/node/Tests/NodeSaveTest.php | 18 +++++----- .../Drupal/node/Tests/NodeTitleXSSTest.php | 8 ++--- .../node/Tests/NodeTokenReplaceTest.php | 2 +- .../node/Tests/NodeTypePersistenceTest.php | 24 ++++++------- .../lib/Drupal/node/Tests/NodeTypeTest.php | 34 +++++++++--------- .../lib/Drupal/node/Tests/PageEditTest.php | 14 ++++---- .../lib/Drupal/node/Tests/PagePreviewTest.php | 22 ++++++------ .../lib/Drupal/node/Tests/PageViewTest.php | 2 +- .../Drupal/node/Tests/SummaryLengthTest.php | 2 +- 23 files changed, 155 insertions(+), 155 deletions(-) diff --git a/core/modules/node/lib/Drupal/node/Tests/NodeAccessBaseTableTest.php b/core/modules/node/lib/Drupal/node/Tests/NodeAccessBaseTableTest.php index e5253a880ee..a8e36b221a4 100644 --- a/core/modules/node/lib/Drupal/node/Tests/NodeAccessBaseTableTest.php +++ b/core/modules/node/lib/Drupal/node/Tests/NodeAccessBaseTableTest.php @@ -84,7 +84,7 @@ class NodeAccessBaseTableTest extends NodeTestBase { $this->drupalPost('node/add/article', $edit, t('Save')); $nid = db_query('SELECT nid FROM {node} WHERE title = :title', array(':title' => $edit['title']))->fetchField(); $private_status = db_query('SELECT private FROM {node_access_test} where nid = :nid', array(':nid' => $nid))->fetchField(); - $this->assertTrue($is_private == $private_status, t('The private status of the node was properly set in the node_access_test table.')); + $this->assertTrue($is_private == $private_status, 'The private status of the node was properly set in the node_access_test table.'); if ($is_private) { $private_nodes[] = $nid; } @@ -94,8 +94,8 @@ class NodeAccessBaseTableTest extends NodeTestBase { } $this->publicTid = db_query('SELECT tid FROM {taxonomy_term_data} WHERE name = :name', array(':name' => 'public'))->fetchField(); $this->privateTid = db_query('SELECT tid FROM {taxonomy_term_data} WHERE name = :name', array(':name' => 'private'))->fetchField(); - $this->assertTrue($this->publicTid, t('Public tid was found')); - $this->assertTrue($this->privateTid, t('Private tid was found')); + $this->assertTrue($this->publicTid, 'Public tid was found'); + $this->assertTrue($this->privateTid, 'Private tid was found'); foreach ($simple_users as $this->webUser) { $this->drupalLogin($this->webUser); // Check own nodes to see that all are readable. diff --git a/core/modules/node/lib/Drupal/node/Tests/NodeAccessLanguageTest.php b/core/modules/node/lib/Drupal/node/Tests/NodeAccessLanguageTest.php index 7de9d745b32..021e22804dd 100644 --- a/core/modules/node/lib/Drupal/node/Tests/NodeAccessLanguageTest.php +++ b/core/modules/node/lib/Drupal/node/Tests/NodeAccessLanguageTest.php @@ -65,7 +65,7 @@ class NodeAccessLanguageTest extends NodeTestBase { // Tests the default access provided for a published Hungarian node. $web_user = $this->drupalCreateUser(array('access content')); $node = $this->drupalCreateNode(array('body' => array('hu' => array(array())), 'langcode' => 'hu')); - $this->assertTrue($node->langcode == 'hu', t('Node created as Hungarian.')); + $this->assertTrue($node->langcode == 'hu', 'Node created as Hungarian.'); $expected_node_access = array('view' => TRUE, 'update' => FALSE, 'delete' => FALSE); $this->assertNodeAccess($expected_node_access, $node, $web_user); diff --git a/core/modules/node/lib/Drupal/node/Tests/NodeAccessRecordsTest.php b/core/modules/node/lib/Drupal/node/Tests/NodeAccessRecordsTest.php index 4c5598ae372..07a00cf3dd4 100644 --- a/core/modules/node/lib/Drupal/node/Tests/NodeAccessRecordsTest.php +++ b/core/modules/node/lib/Drupal/node/Tests/NodeAccessRecordsTest.php @@ -33,44 +33,44 @@ class NodeAccessRecordsTest extends NodeTestBase { function testNodeAccessRecords() { // Create an article node. $node1 = $this->drupalCreateNode(array('type' => 'article')); - $this->assertTrue(node_load($node1->nid), t('Article node created.')); + $this->assertTrue(node_load($node1->nid), 'Article node created.'); // Check to see if grants added by node_test_node_access_records made it in. $records = db_query('SELECT realm, gid FROM {node_access} WHERE nid = :nid', array(':nid' => $node1->nid))->fetchAll(); - $this->assertEqual(count($records), 1, t('Returned the correct number of rows.')); - $this->assertEqual($records[0]->realm, 'test_article_realm', t('Grant with article_realm acquired for node without alteration.')); - $this->assertEqual($records[0]->gid, 1, t('Grant with gid = 1 acquired for node without alteration.')); + $this->assertEqual(count($records), 1, 'Returned the correct number of rows.'); + $this->assertEqual($records[0]->realm, 'test_article_realm', 'Grant with article_realm acquired for node without alteration.'); + $this->assertEqual($records[0]->gid, 1, 'Grant with gid = 1 acquired for node without alteration.'); // Create an unpromoted "Basic page" node. $node2 = $this->drupalCreateNode(array('type' => 'page', 'promote' => 0)); - $this->assertTrue(node_load($node2->nid), t('Unpromoted basic page node created.')); + $this->assertTrue(node_load($node2->nid), 'Unpromoted basic page node created.'); // Check to see if grants added by node_test_node_access_records made it in. $records = db_query('SELECT realm, gid FROM {node_access} WHERE nid = :nid', array(':nid' => $node2->nid))->fetchAll(); - $this->assertEqual(count($records), 1, t('Returned the correct number of rows.')); - $this->assertEqual($records[0]->realm, 'test_page_realm', t('Grant with page_realm acquired for node without alteration.')); - $this->assertEqual($records[0]->gid, 1, t('Grant with gid = 1 acquired for node without alteration.')); + $this->assertEqual(count($records), 1, 'Returned the correct number of rows.'); + $this->assertEqual($records[0]->realm, 'test_page_realm', 'Grant with page_realm acquired for node without alteration.'); + $this->assertEqual($records[0]->gid, 1, 'Grant with gid = 1 acquired for node without alteration.'); // Create an unpromoted, unpublished "Basic page" node. $node3 = $this->drupalCreateNode(array('type' => 'page', 'promote' => 0, 'status' => 0)); - $this->assertTrue(node_load($node3->nid), t('Unpromoted, unpublished basic page node created.')); + $this->assertTrue(node_load($node3->nid), 'Unpromoted, unpublished basic page node created.'); // Check to see if grants added by node_test_node_access_records made it in. $records = db_query('SELECT realm, gid FROM {node_access} WHERE nid = :nid', array(':nid' => $node3->nid))->fetchAll(); - $this->assertEqual(count($records), 1, t('Returned the correct number of rows.')); - $this->assertEqual($records[0]->realm, 'test_page_realm', t('Grant with page_realm acquired for node without alteration.')); - $this->assertEqual($records[0]->gid, 1, t('Grant with gid = 1 acquired for node without alteration.')); + $this->assertEqual(count($records), 1, 'Returned the correct number of rows.'); + $this->assertEqual($records[0]->realm, 'test_page_realm', 'Grant with page_realm acquired for node without alteration.'); + $this->assertEqual($records[0]->gid, 1, 'Grant with gid = 1 acquired for node without alteration.'); // Create a promoted "Basic page" node. $node4 = $this->drupalCreateNode(array('type' => 'page', 'promote' => 1)); - $this->assertTrue(node_load($node4->nid), t('Promoted basic page node created.')); + $this->assertTrue(node_load($node4->nid), 'Promoted basic page node created.'); // Check to see if grant added by node_test_node_access_records was altered // by node_test_node_access_records_alter. $records = db_query('SELECT realm, gid FROM {node_access} WHERE nid = :nid', array(':nid' => $node4->nid))->fetchAll(); - $this->assertEqual(count($records), 1, t('Returned the correct number of rows.')); - $this->assertEqual($records[0]->realm, 'test_alter_realm', t('Altered grant with alter_realm acquired for node.')); - $this->assertEqual($records[0]->gid, 2, t('Altered grant with gid = 2 acquired for node.')); + $this->assertEqual(count($records), 1, 'Returned the correct number of rows.'); + $this->assertEqual($records[0]->realm, 'test_alter_realm', 'Altered grant with alter_realm acquired for node.'); + $this->assertEqual($records[0]->gid, 2, 'Altered grant with gid = 2 acquired for node.'); // Check to see if we can alter grants with hook_node_grants_alter(). $operations = array('view', 'update', 'delete'); @@ -87,6 +87,6 @@ class NodeAccessRecordsTest extends NodeTestBase { // empty $grants array is returned. $node6 = $this->drupalCreateNode(array('status' => 0, 'disable_node_access' => TRUE)); $records = db_query('SELECT realm, gid FROM {node_access} WHERE nid = :nid', array(':nid' => $node6->nid))->fetchAll(); - $this->assertEqual(count($records), 0, t('Returned no records for unpublished node.')); + $this->assertEqual(count($records), 0, 'Returned no records for unpublished node.'); } } diff --git a/core/modules/node/lib/Drupal/node/Tests/NodeAdminTest.php b/core/modules/node/lib/Drupal/node/Tests/NodeAdminTest.php index d89100d9d8e..3c027657da3 100644 --- a/core/modules/node/lib/Drupal/node/Tests/NodeAdminTest.php +++ b/core/modules/node/lib/Drupal/node/Tests/NodeAdminTest.php @@ -94,7 +94,7 @@ class NodeAdminTest extends NodeTestBase { $this->assertLinkByHref('node/' . $node->nid . '/edit'); $this->assertLinkByHref('node/' . $node->nid . '/delete'); // Verify tableselect. - $this->assertFieldByName('nodes[' . $node->nid . ']', '', t('Tableselect found.')); + $this->assertFieldByName('nodes[' . $node->nid . ']', '', 'Tableselect found.'); } // Verify filtering by publishing status. @@ -103,7 +103,7 @@ class NodeAdminTest extends NodeTestBase { ); $this->drupalPost(NULL, $edit, t('Filter')); - $this->assertRaw(t('where %property is %value', array('%property' => t('status'), '%value' => 'published')), t('Content list is filtered by status.')); + $this->assertRaw(t('where %property is %value', array('%property' => t('status'), '%value' => 'published')), 'Content list is filtered by status.'); $this->assertLinkByHref('node/' . $nodes['published_page']->nid . '/edit'); $this->assertLinkByHref('node/' . $nodes['published_article']->nid . '/edit'); @@ -115,8 +115,8 @@ class NodeAdminTest extends NodeTestBase { ); $this->drupalPost(NULL, $edit, t('Refine')); - $this->assertRaw(t('where %property is %value', array('%property' => t('status'), '%value' => 'published')), t('Content list is filtered by status.')); - $this->assertRaw(t('and where %property is %value', array('%property' => t('type'), '%value' => 'Basic page')), t('Content list is filtered by content type.')); + $this->assertRaw(t('where %property is %value', array('%property' => t('status'), '%value' => 'published')), 'Content list is filtered by status.'); + $this->assertRaw(t('and where %property is %value', array('%property' => t('type'), '%value' => 'Basic page')), 'Content list is filtered by content type.'); $this->assertLinkByHref('node/' . $nodes['published_page']->nid . '/edit'); $this->assertNoLinkByHref('node/' . $nodes['published_article']->nid . '/edit'); @@ -139,7 +139,7 @@ class NodeAdminTest extends NodeTestBase { $this->assertNoLinkByHref('node/' . $nodes['unpublished_page_1']->nid . '/delete'); // Verify no tableselect. - $this->assertNoFieldByName('nodes[' . $nodes['published_page']->nid . ']', '', t('No tableselect found.')); + $this->assertNoFieldByName('nodes[' . $nodes['published_page']->nid . ']', '', 'No tableselect found.'); // Verify unpublished content is displayed with permission. $this->drupalLogout(); @@ -157,7 +157,7 @@ class NodeAdminTest extends NodeTestBase { $this->assertNoLinkByHref('node/' . $nodes['unpublished_page_1']->nid . '/delete'); // Verify no tableselect. - $this->assertNoFieldByName('nodes[' . $nodes['unpublished_page_2']->nid . ']', '', t('No tableselect found.')); + $this->assertNoFieldByName('nodes[' . $nodes['unpublished_page_2']->nid . ']', '', 'No tableselect found.'); // Verify node access can be bypassed. $this->drupalLogout(); diff --git a/core/modules/node/lib/Drupal/node/Tests/NodeBlockFunctionalTest.php b/core/modules/node/lib/Drupal/node/Tests/NodeBlockFunctionalTest.php index 0c86de2b972..edcb0075bd6 100644 --- a/core/modules/node/lib/Drupal/node/Tests/NodeBlockFunctionalTest.php +++ b/core/modules/node/lib/Drupal/node/Tests/NodeBlockFunctionalTest.php @@ -51,7 +51,7 @@ class NodeBlockFunctionalTest extends NodeTestBase { 'blocks[node_recent][region]' => 'sidebar_first', ); $this->drupalPost('admin/structure/block', $edit, t('Save blocks')); - $this->assertText(t('The block settings have been updated.'), t('Block saved to first sidebar region.')); + $this->assertText(t('The block settings have been updated.'), 'Block saved to first sidebar region.'); // Set block title and variables. $block = array( @@ -59,11 +59,11 @@ class NodeBlockFunctionalTest extends NodeTestBase { 'node_recent_block_count' => 2, ); $this->drupalPost('admin/structure/block/manage/node/recent/configure', $block, t('Save block')); - $this->assertText(t('The block configuration has been saved.'), t('Block saved.')); + $this->assertText(t('The block configuration has been saved.'), 'Block saved.'); // Test that block is not visible without nodes $this->drupalGet(''); - $this->assertText(t('No content available.'), t('Block with "No content available." found.')); + $this->assertText(t('No content available.'), 'Block with "No content available." found.'); // Add some test nodes. $default_settings = array('uid' => $this->web_user->uid, 'type' => 'article'); @@ -89,16 +89,16 @@ class NodeBlockFunctionalTest extends NodeTestBase { // see the block. $this->drupalLogout(); $this->drupalGet(''); - $this->assertNoText($block['title'], t('Block was not found.')); + $this->assertNoText($block['title'], 'Block was not found.'); // Test that only the 2 latest nodes are shown. $this->drupalLogin($this->web_user); - $this->assertNoText($node1->label(), t('Node not found in block.')); - $this->assertText($node2->label(), t('Node found in block.')); - $this->assertText($node3->label(), t('Node found in block.')); + $this->assertNoText($node1->label(), 'Node not found in block.'); + $this->assertText($node2->label(), 'Node found in block.'); + $this->assertText($node3->label(), 'Node found in block.'); // Check to make sure nodes are in the right order. - $this->assertTrue($this->xpath('//div[@id="block-node-recent"]/div/table/tbody/tr[position() = 1]/td/div/a[text() = "' . $node3->label() . '"]'), t('Nodes were ordered correctly in block.')); + $this->assertTrue($this->xpath('//div[@id="block-node-recent"]/div/table/tbody/tr[position() = 1]/td/div/a[text() = "' . $node3->label() . '"]'), 'Nodes were ordered correctly in block.'); // Set the number of recent nodes to show to 10. $this->drupalLogout(); @@ -107,7 +107,7 @@ class NodeBlockFunctionalTest extends NodeTestBase { 'node_recent_block_count' => 10, ); $this->drupalPost('admin/structure/block/manage/node/recent/configure', $block, t('Save block')); - $this->assertText(t('The block configuration has been saved.'), t('Block saved.')); + $this->assertText(t('The block configuration has been saved.'), 'Block saved.'); // Post an additional node. $node4 = $this->drupalCreateNode($default_settings); @@ -117,10 +117,10 @@ class NodeBlockFunctionalTest extends NodeTestBase { // Test that all four nodes are shown. $this->drupalGet(''); - $this->assertText($node1->label(), t('Node found in block.')); - $this->assertText($node2->label(), t('Node found in block.')); - $this->assertText($node3->label(), t('Node found in block.')); - $this->assertText($node4->label(), t('Node found in block.')); + $this->assertText($node1->label(), 'Node found in block.'); + $this->assertText($node2->label(), 'Node found in block.'); + $this->assertText($node3->label(), 'Node found in block.'); + $this->assertText($node4->label(), 'Node found in block.'); // Create the custom block. $custom_block = array(); @@ -135,19 +135,19 @@ class NodeBlockFunctionalTest extends NodeTestBase { $this->drupalPost('admin/structure/block/add', $custom_block, t('Save block')); $bid = db_query("SELECT bid FROM {block_custom} WHERE info = :info", array(':info' => $custom_block['info']))->fetchField(); - $this->assertTrue($bid, t('Custom block with visibility rule was created.')); + $this->assertTrue($bid, 'Custom block with visibility rule was created.'); // Verify visibility rules. $this->drupalGet(''); - $this->assertNoText($custom_block['title'], t('Block was displayed on the front page.')); + $this->assertNoText($custom_block['title'], 'Block was displayed on the front page.'); $this->drupalGet('node/add/article'); - $this->assertText($custom_block['title'], t('Block was displayed on the node/add/article page.')); + $this->assertText($custom_block['title'], 'Block was displayed on the node/add/article page.'); $this->drupalGet('node/' . $node1->nid); - $this->assertText($custom_block['title'], t('Block was displayed on the node/N.')); + $this->assertText($custom_block['title'], 'Block was displayed on the node/N.'); // Delete the created custom block & verify that it's been deleted. $this->drupalPost('admin/structure/block/manage/block/' . $bid . '/delete', array(), t('Delete')); $bid = db_query("SELECT 1 FROM {block_node_type} WHERE module = 'block' AND delta = :delta", array(':delta' => $bid))->fetchField(); - $this->assertFalse($bid, t('Custom block was deleted.')); + $this->assertFalse($bid, 'Custom block was deleted.'); } } diff --git a/core/modules/node/lib/Drupal/node/Tests/NodeBlockTest.php b/core/modules/node/lib/Drupal/node/Tests/NodeBlockTest.php index 9aca3cfedb6..3775ac05d97 100644 --- a/core/modules/node/lib/Drupal/node/Tests/NodeBlockTest.php +++ b/core/modules/node/lib/Drupal/node/Tests/NodeBlockTest.php @@ -35,12 +35,12 @@ class NodeBlockTest extends NodeTestBase { function testSearchFormBlock() { // Set block title to confirm that the interface is available. $this->drupalPost('admin/structure/block/manage/node/syndicate/configure', array('title' => $this->randomName(8)), t('Save block')); - $this->assertText(t('The block configuration has been saved.'), t('Block configuration set.')); + $this->assertText(t('The block configuration has been saved.'), 'Block configuration set.'); // Set the block to a region to confirm block is available. $edit = array(); $edit['blocks[node_syndicate][region]'] = 'footer'; $this->drupalPost('admin/structure/block', $edit, t('Save blocks')); - $this->assertText(t('The block settings have been updated.'), t('Block successfully move to footer region.')); + $this->assertText(t('The block settings have been updated.'), 'Block successfully move to footer region.'); } } diff --git a/core/modules/node/lib/Drupal/node/Tests/NodeBuildContentTest.php b/core/modules/node/lib/Drupal/node/Tests/NodeBuildContentTest.php index 2b0dbebb1ee..3f4d360a940 100644 --- a/core/modules/node/lib/Drupal/node/Tests/NodeBuildContentTest.php +++ b/core/modules/node/lib/Drupal/node/Tests/NodeBuildContentTest.php @@ -31,6 +31,6 @@ class NodeBuildContentTest extends NodeTestBase { $content = node_build_content($node); // If the property doesn't exist it means the node->content was rebuilt. - $this->assertFalse(isset($content['test_content_property']), t('Node content was emptied prior to being built.')); + $this->assertFalse(isset($content['test_content_property']), 'Node content was emptied prior to being built.'); } } diff --git a/core/modules/node/lib/Drupal/node/Tests/NodeCreationTest.php b/core/modules/node/lib/Drupal/node/Tests/NodeCreationTest.php index f7763d2a65a..241af5f0ca6 100644 --- a/core/modules/node/lib/Drupal/node/Tests/NodeCreationTest.php +++ b/core/modules/node/lib/Drupal/node/Tests/NodeCreationTest.php @@ -48,11 +48,11 @@ class NodeCreationTest extends NodeTestBase { $this->drupalPost('node/add/page', $edit, t('Save')); // Check that the Basic page has been created. - $this->assertRaw(t('!post %title has been created.', array('!post' => 'Basic page', '%title' => $edit["title"])), t('Basic page created.')); + $this->assertRaw(t('!post %title has been created.', array('!post' => 'Basic page', '%title' => $edit["title"])), 'Basic page created.'); // Check that the node exists in the database. $node = $this->drupalGetNodeByTitle($edit["title"]); - $this->assertTrue($node, t('Node found in database.')); + $this->assertTrue($node, 'Node found in database.'); } /** @@ -79,21 +79,21 @@ class NodeCreationTest extends NodeTestBase { if (Database::getConnection()->supportsTransactions()) { // Check that the node does not exist in the database. $node = $this->drupalGetNodeByTitle($edit['title']); - $this->assertFalse($node, t('Transactions supported, and node not found in database.')); + $this->assertFalse($node, 'Transactions supported, and node not found in database.'); } else { // Check that the node exists in the database. $node = $this->drupalGetNodeByTitle($edit['title']); - $this->assertTrue($node, t('Transactions not supported, and node found in database.')); + $this->assertTrue($node, 'Transactions not supported, and node found in database.'); // Check that the failed rollback was logged. $records = db_query("SELECT wid FROM {watchdog} WHERE message LIKE 'Explicit rollback failed%'")->fetchAll(); - $this->assertTrue(count($records) > 0, t('Transactions not supported, and rollback error logged to watchdog.')); + $this->assertTrue(count($records) > 0, 'Transactions not supported, and rollback error logged to watchdog.'); } // Check that the rollback error was logged. $records = db_query("SELECT wid FROM {watchdog} WHERE variables LIKE '%Test exception for rollback.%'")->fetchAll(); - $this->assertTrue(count($records) > 0, t('Rollback explanatory error logged to watchdog.')); + $this->assertTrue(count($records) > 0, 'Rollback explanatory error logged to watchdog.'); } /** @@ -112,6 +112,6 @@ class NodeCreationTest extends NodeTestBase { $this->drupalPost('node/add/page', $edit, t('Save')); // Check that the user was redirected to the home page. - $this->assertText(t('Welcome to Drupal'), t('The user is redirected to the home page.')); + $this->assertText(t('Welcome to Drupal'), 'The user is redirected to the home page.'); } } diff --git a/core/modules/node/lib/Drupal/node/Tests/NodeFieldMultilingualTestCase.php b/core/modules/node/lib/Drupal/node/Tests/NodeFieldMultilingualTestCase.php index b96dae98b7e..838f8557de4 100644 --- a/core/modules/node/lib/Drupal/node/Tests/NodeFieldMultilingualTestCase.php +++ b/core/modules/node/lib/Drupal/node/Tests/NodeFieldMultilingualTestCase.php @@ -56,7 +56,7 @@ class NodeFieldMultilingualTestCase extends WebTestBase { 'node_type_language_hidden' => FALSE, ); $this->drupalPost('admin/structure/types/manage/page', $edit, t('Save content type')); - $this->assertRaw(t('The content type %type has been updated.', array('%type' => 'Basic page')), t('Basic page content type has been updated.')); + $this->assertRaw(t('The content type %type has been updated.', array('%type' => 'Basic page')), 'Basic page content type has been updated.'); // Make node body translatable. $field = field_info_field('body'); @@ -83,10 +83,10 @@ class NodeFieldMultilingualTestCase extends WebTestBase { // Check that the node exists in the database. $node = $this->drupalGetNodeByTitle($edit[$title_key]); - $this->assertTrue($node, t('Node found in database.')); + $this->assertTrue($node, 'Node found in database.'); $assert = isset($node->body['en']) && !isset($node->body[LANGUAGE_NOT_SPECIFIED]) && $node->body['en'][0]['value'] == $body_value; - $this->assertTrue($assert, t('Field language correctly set.')); + $this->assertTrue($assert, 'Field language correctly set.'); // Change node language. $this->drupalGet("node/$node->nid/edit"); @@ -96,20 +96,20 @@ class NodeFieldMultilingualTestCase extends WebTestBase { ); $this->drupalPost(NULL, $edit, t('Save')); $node = $this->drupalGetNodeByTitle($edit[$title_key], TRUE); - $this->assertTrue($node, t('Node found in database.')); + $this->assertTrue($node, 'Node found in database.'); $assert = isset($node->body['it']) && !isset($node->body['en']) && $node->body['it'][0]['value'] == $body_value; - $this->assertTrue($assert, t('Field language correctly changed.')); + $this->assertTrue($assert, 'Field language correctly changed.'); // Enable content language URL detection. language_negotiation_set(LANGUAGE_TYPE_CONTENT, array(LANGUAGE_NEGOTIATION_URL => 0)); // Test multilingual field language fallback logic. $this->drupalGet("it/node/$node->nid"); - $this->assertRaw($body_value, t('Body correctly displayed using Italian as requested language')); + $this->assertRaw($body_value, 'Body correctly displayed using Italian as requested language'); $this->drupalGet("node/$node->nid"); - $this->assertRaw($body_value, t('Body correctly displayed using English as requested language')); + $this->assertRaw($body_value, 'Body correctly displayed using English as requested language'); } /* @@ -131,7 +131,7 @@ class NodeFieldMultilingualTestCase extends WebTestBase { // Check that the node exists in the database. $node = $this->drupalGetNodeByTitle($edit[$title_key]); - $this->assertTrue($node, t('Node found in database.')); + $this->assertTrue($node, 'Node found in database.'); // Check if node body is showed. $this->drupalGet("node/$node->nid"); diff --git a/core/modules/node/lib/Drupal/node/Tests/NodeLoadMultipleTest.php b/core/modules/node/lib/Drupal/node/Tests/NodeLoadMultipleTest.php index 637574d9c51..815ab1b84ed 100644 --- a/core/modules/node/lib/Drupal/node/Tests/NodeLoadMultipleTest.php +++ b/core/modules/node/lib/Drupal/node/Tests/NodeLoadMultipleTest.php @@ -37,15 +37,15 @@ class NodeLoadMultipleTest extends NodeTestBase { // Confirm that promoted nodes appear in the default node listing. $this->drupalGet('node'); - $this->assertText($node1->label(), t('Node title appears on the default listing.')); - $this->assertText($node2->label(), t('Node title appears on the default listing.')); - $this->assertNoText($node3->label(), t('Node title does not appear in the default listing.')); - $this->assertNoText($node4->label(), t('Node title does not appear in the default listing.')); + $this->assertText($node1->label(), 'Node title appears on the default listing.'); + $this->assertText($node2->label(), 'Node title appears on the default listing.'); + $this->assertNoText($node3->label(), 'Node title does not appear in the default listing.'); + $this->assertNoText($node4->label(), 'Node title does not appear in the default listing.'); // Load nodes with only a condition. Nodes 3 and 4 will be loaded. $nodes = entity_load_multiple_by_properties('node', array('promote' => 0)); - $this->assertEqual($node3->label(), $nodes[$node3->nid]->label(), t('Node was loaded.')); - $this->assertEqual($node4->label(), $nodes[$node4->nid]->label(), t('Node was loaded.')); + $this->assertEqual($node3->label(), $nodes[$node3->nid]->label(), 'Node was loaded.'); + $this->assertEqual($node4->label(), $nodes[$node4->nid]->label(), 'Node was loaded.'); $count = count($nodes); $this->assertTrue($count == 2, t('@count nodes loaded.', array('@count' => $count))); @@ -53,11 +53,11 @@ class NodeLoadMultipleTest extends NodeTestBase { $nodes = node_load_multiple(array(1, 2, 4)); $count = count($nodes); $this->assertTrue(count($nodes) == 3, t('@count nodes loaded', array('@count' => $count))); - $this->assertTrue(isset($nodes[$node1->nid]), t('Node is correctly keyed in the array')); - $this->assertTrue(isset($nodes[$node2->nid]), t('Node is correctly keyed in the array')); - $this->assertTrue(isset($nodes[$node4->nid]), t('Node is correctly keyed in the array')); + $this->assertTrue(isset($nodes[$node1->nid]), 'Node is correctly keyed in the array'); + $this->assertTrue(isset($nodes[$node2->nid]), 'Node is correctly keyed in the array'); + $this->assertTrue(isset($nodes[$node4->nid]), 'Node is correctly keyed in the array'); foreach ($nodes as $node) { - $this->assertTrue(is_object($node), t('Node is an object')); + $this->assertTrue(is_object($node), 'Node is an object'); } } } diff --git a/core/modules/node/lib/Drupal/node/Tests/NodePostSettingsTest.php b/core/modules/node/lib/Drupal/node/Tests/NodePostSettingsTest.php index 9ce688a603c..375d50f520f 100644 --- a/core/modules/node/lib/Drupal/node/Tests/NodePostSettingsTest.php +++ b/core/modules/node/lib/Drupal/node/Tests/NodePostSettingsTest.php @@ -46,7 +46,7 @@ class NodePostSettingsTest extends NodeTestBase { // Check that the post information is displayed. $node = $this->drupalGetNodeByTitle($edit["title"]); $elements = $this->xpath('//*[contains(@class,:class)]', array(':class' => 'submitted')); - $this->assertEqual(count($elements), 1, t('Post information is displayed.')); + $this->assertEqual(count($elements), 1, 'Post information is displayed.'); } /** @@ -68,6 +68,6 @@ class NodePostSettingsTest extends NodeTestBase { // Check that the post information is displayed. $node = $this->drupalGetNodeByTitle($edit["title"]); - $this->assertNoRaw('', t('Post information is not displayed.')); + $this->assertNoRaw('