diff --git a/core/modules/taxonomy/taxonomy.test b/core/modules/taxonomy/taxonomy.test index fb3b17c..3c3018e 100644 --- a/core/modules/taxonomy/taxonomy.test +++ b/core/modules/taxonomy/taxonomy.test @@ -182,8 +182,8 @@ class TaxonomyVocabularyFunctionalTest extends TaxonomyWebTestCase { // Delete the vocabulary. $edit = array(); $this->drupalPost('admin/structure/taxonomy/' . $vocabulary->machine_name . '/edit', $edit, t('Delete')); - $this->assertRaw(t('Are you sure you want to delete the vocabulary %name?', array('%name' => $vocabulary->name)), t('[confirm deletion] Asks for confirmation.')); - $this->assertText(t('Deleting a vocabulary will delete all the terms in it. This action cannot be undone.'), t('[confirm deletion] Inform that all terms will be deleted.')); + $this->assertRaw(t('Are you sure you want to delete the vocabulary %name?', array('%name' => $vocabulary->name)), '[confirm deletion] Asks for confirmation.'); + $this->assertText(t('Deleting a vocabulary will delete all the terms in it. This action cannot be undone.'), '[confirm deletion] Inform that all terms will be deleted.'); // Confirm deletion. $this->drupalPost(NULL, NULL, t('Delete')); @@ -224,7 +224,7 @@ class TaxonomyVocabularyUnitTest extends TaxonomyWebTestCase { $vid = count($vocabularies) + 1; $vocabulary = taxonomy_vocabulary_load($vid); // This should not return an object because no such vocabulary exists. - $this->assertTrue(empty($vocabulary), t('No object loaded.')); + $this->assertTrue(empty($vocabulary), 'No object loaded.'); // Create a new vocabulary. $this->createVocabulary(); @@ -709,22 +709,22 @@ class TaxonomyTermTestCase extends TaxonomyWebTestCase { $this->drupalGet('node/' . $node->nid); foreach ($term_names as $term_name) { - $this->assertText($term_name, t('The term %name appears on the node page after two terms, %deleted1 and %deleted2, were deleted', array('%name' => $term_name, '%deleted1' => $term_objects['term1']->name, '%deleted2' => $term_objects['term2']->name))); + $this->assertText($term_name, format_string('The term %name appears on the node page after two terms, %deleted1 and %deleted2, were deleted', array('%name' => $term_name, '%deleted1' => $term_objects['term1']->name, '%deleted2' => $term_objects['term2']->name))); } - $this->assertNoText($term_objects['term1']->name, t('The deleted term %name does not appear on the node page.', array('%name' => $term_objects['term1']->name))); - $this->assertNoText($term_objects['term2']->name, t('The deleted term %name does not appear on the node page.', array('%name' => $term_objects['term2']->name))); + $this->assertNoText($term_objects['term1']->name, format_string('The deleted term %name does not appear on the node page.', array('%name' => $term_objects['term1']->name))); + $this->assertNoText($term_objects['term2']->name, format_string('The deleted term %name does not appear on the node page.', array('%name' => $term_objects['term2']->name))); // Test autocomplete on term 3, which contains a comma. // The term will be quoted, and the " will be encoded in unicode (\u0022). $input = substr($term_objects['term3']->name, 0, 3); $this->drupalGet('taxonomy/autocomplete/taxonomy_' . $this->vocabulary->machine_name . '/' . $input); - $this->assertRaw('{"\u0022' . $term_objects['term3']->name . '\u0022":"' . $term_objects['term3']->name . '"}', t('Autocomplete returns term %term_name after typing the first 3 letters.', array('%term_name' => $term_objects['term3']->name))); + $this->assertRaw('{"\u0022' . $term_objects['term3']->name . '\u0022":"' . $term_objects['term3']->name . '"}', format_string('Autocomplete returns term %term_name after typing the first 3 letters.', array('%term_name' => $term_objects['term3']->name))); // Test autocomplete on term 4 - it is alphanumeric only, so no extra // quoting. $input = substr($term_objects['term4']->name, 0, 3); $this->drupalGet('taxonomy/autocomplete/taxonomy_' . $this->vocabulary->machine_name . '/' . $input); - $this->assertRaw('{"' . $term_objects['term4']->name . '":"' . $term_objects['term4']->name . '"}', t('Autocomplete returns term %term_name after typing the first 3 letters.', array('%term_name' => $term_objects['term4']->name))); + $this->assertRaw('{"' . $term_objects['term4']->name . '":"' . $term_objects['term4']->name . '"}', format_string('Autocomplete returns term %term_name after typing the first 3 letters.', array('%term_name' => $term_objects['term4']->name))); // Test taxonomy autocomplete with a nonexistent field. $field_name = $this->randomName(); @@ -1356,7 +1356,7 @@ class TaxonomyLoadMultipleUnitTest extends TaxonomyWebTestCase { // Load the terms from the vocabulary. $terms = taxonomy_term_load_multiple(NULL, array('vid' => $vocabulary->vid)); $count = count($terms); - $this->assertTrue($count == 5, t('Correct number of terms were loaded. !count terms.', array('!count' => $count))); + $this->assertTrue($count == 5, format_string('Correct number of terms were loaded. !count terms.', array('!count' => $count))); // Load the same terms again by tid. $terms2 = taxonomy_term_load_multiple(array_keys($terms)); @@ -1800,7 +1800,7 @@ class TaxonomyTokenReplaceTestCase extends TaxonomyWebTestCase { foreach ($tests as $input => $expected) { $output = token_replace($input, array('term' => $term1), array('language' => $language_interface)); - $this->assertEqual($output, $expected, t('Sanitized taxonomy term token %token replaced.', array('%token' => $input))); + $this->assertEqual($output, $expected, format_string('Sanitized taxonomy term token %token replaced.', array('%token' => $input))); } // Generate and test sanitized tokens for term2. @@ -1820,7 +1820,7 @@ class TaxonomyTokenReplaceTestCase extends TaxonomyWebTestCase { foreach ($tests as $input => $expected) { $output = token_replace($input, array('term' => $term2), array('language' => $language_interface)); - $this->assertEqual($output, $expected, t('Sanitized taxonomy term token %token replaced.', array('%token' => $input))); + $this->assertEqual($output, $expected, format_string('Sanitized taxonomy term token %token replaced.', array('%token' => $input))); } // Generate and test unsanitized tokens. @@ -1831,7 +1831,7 @@ class TaxonomyTokenReplaceTestCase extends TaxonomyWebTestCase { foreach ($tests as $input => $expected) { $output = token_replace($input, array('term' => $term2), array('language' => $language_interface, 'sanitize' => FALSE)); - $this->assertEqual($output, $expected, t('Unsanitized taxonomy term token %token replaced.', array('%token' => $input))); + $this->assertEqual($output, $expected, format_string('Unsanitized taxonomy term token %token replaced.', array('%token' => $input))); } // Generate and test sanitized tokens. @@ -1843,11 +1843,11 @@ class TaxonomyTokenReplaceTestCase extends TaxonomyWebTestCase { $tests['[vocabulary:term-count]'] = 2; // Test to make sure that we generated something for each token. - $this->assertFalse(in_array(0, array_map('strlen', $tests)), t('No empty tokens generated.')); + $this->assertFalse(in_array(0, array_map('strlen', $tests)), 'No empty tokens generated.'); foreach ($tests as $input => $expected) { $output = token_replace($input, array('vocabulary' => $this->vocabulary), array('language' => $language_interface)); - $this->assertEqual($output, $expected, t('Sanitized taxonomy vocabulary token %token replaced.', array('%token' => $input))); + $this->assertEqual($output, $expected, format_string('Sanitized taxonomy vocabulary token %token replaced.', array('%token' => $input))); } // Generate and test unsanitized tokens. @@ -1856,7 +1856,7 @@ class TaxonomyTokenReplaceTestCase extends TaxonomyWebTestCase { foreach ($tests as $input => $expected) { $output = token_replace($input, array('vocabulary' => $this->vocabulary), array('language' => $language_interface, 'sanitize' => FALSE)); - $this->assertEqual($output, $expected, t('Unsanitized taxonomy vocabulary token %token replaced.', array('%token' => $input))); + $this->assertEqual($output, $expected, format_string('Unsanitized taxonomy vocabulary token %token replaced.', array('%token' => $input))); } }