diff --git a/modules/taxonomy/taxonomy.test b/modules/taxonomy/taxonomy.test index 59794b6..e426723 100644 --- a/modules/taxonomy/taxonomy.test +++ b/modules/taxonomy/taxonomy.test @@ -138,7 +138,7 @@ class TaxonomyVocabularyFunctionalTest extends TaxonomyWebTestCase { taxonomy_vocabulary_delete($key); } // Confirm that no vocabularies are found in the database. - $this->assertFalse(taxonomy_get_vocabularies(), 'No vocabularies found in the database'); + $this->assertFalse(taxonomy_get_vocabularies(), 'No vocabularies found in the database.'); $this->drupalGet('admin/structure/taxonomy'); // Check the default message for no vocabularies. $this->assertText(t('No vocabularies available.'), 'No vocabularies were found.'); @@ -161,7 +161,7 @@ class TaxonomyVocabularyFunctionalTest extends TaxonomyWebTestCase { $vid = $vocabularies[count($vocabularies) - 1]->vid; entity_get_controller('taxonomy_vocabulary')->resetCache(); $vocabulary = taxonomy_vocabulary_load($vid); - $this->assertTrue($vocabulary, 'Vocabulary found in database'); + $this->assertTrue($vocabulary, 'Vocabulary found in database.'); // Delete the vocabulary. $edit = array(); @@ -171,9 +171,9 @@ class TaxonomyVocabularyFunctionalTest extends TaxonomyWebTestCase { // Confirm deletion. $this->drupalPost(NULL, NULL, t('Delete')); - $this->assertRaw(t('Deleted vocabulary %name.', array('%name' => $vocabulary->name)), 'Vocabulary deleted'); + $this->assertRaw(t('Deleted vocabulary %name.', array('%name' => $vocabulary->name)), 'Vocabulary deleted.'); entity_get_controller('taxonomy_vocabulary')->resetCache(); - $this->assertFalse(taxonomy_vocabulary_load($vid), 'Vocabulary is not found in the database'); + $this->assertFalse(taxonomy_vocabulary_load($vid), 'Vocabulary is not found in the database.'); } } @@ -215,7 +215,7 @@ class TaxonomyVocabularyTestCase extends TaxonomyWebTestCase { // Load the vocabulary with the same $vid from earlier. // This should return a vocabulary object since it now matches a real vid. $vocabulary = taxonomy_vocabulary_load($vid); - $this->assertTrue(!empty($vocabulary) && is_object($vocabulary), 'Vocabulary is an object'); + $this->assertTrue(!empty($vocabulary) && is_object($vocabulary), 'Vocabulary is an object.'); $this->assertEqual($vocabulary->vid, $vid, 'Valid vocabulary vid is the same as our previously invalid one.'); } @@ -275,7 +275,7 @@ class TaxonomyVocabularyTestCase extends TaxonomyWebTestCase { // Delete the vocabulary. taxonomy_vocabulary_delete($this->vocabulary->vid); $vocabularies = taxonomy_get_vocabularies(); - $this->assertTrue(!isset($vocabularies[$this->vocabulary->vid]), 'The vocabulary was deleted'); + $this->assertTrue(!isset($vocabularies[$this->vocabulary->vid]), 'The vocabulary was deleted.'); } /** @@ -302,7 +302,7 @@ class TaxonomyVocabularyTestCase extends TaxonomyWebTestCase { // Fetch the names for all vocabularies, confirm that they are keyed by // machine name. $names = taxonomy_vocabulary_get_names(); - $this->assertEqual($names[$vocabulary1->machine_name]->name, $vocabulary1->name, t('Vocabulary 1 name found.')); + $this->assertEqual($names[$vocabulary1->machine_name]->name, $vocabulary1->name, 'Vocabulary 1 name found.'); // Fetch all of the vocabularies using taxonomy_get_vocabularies(). // Confirm that the vocabularies are ordered by weight. @@ -406,7 +406,7 @@ class TaxonomyTermFunctionTestCase extends TaxonomyWebTestCase { // Delete a valid term. taxonomy_term_delete($valid_term->tid); $terms = taxonomy_term_load_multiple(array(), array('vid' => $vocabulary->vid)); - $this->assertTrue(empty($terms), 'Vocabulary is empty after deletion'); + $this->assertTrue(empty($terms), 'Vocabulary is empty after deletion.'); // Delete an invalid term. Should not throw any notices. taxonomy_term_delete(42); @@ -655,7 +655,7 @@ class TaxonomyTermTestCase extends TaxonomyWebTestCase { // Preview and verify the terms appear but are not created. $this->drupalPost('node/add/page', $edit, t('Preview')); foreach ($terms as $term) { - $this->assertText($term, 'The term appears on the node preview'); + $this->assertText($term, 'The term appears on the node preview.'); } $tree = taxonomy_get_tree($this->vocabulary->vid); $this->assertTrue(empty($tree), 'The terms are not created on preview.'); @@ -665,9 +665,9 @@ class TaxonomyTermTestCase extends TaxonomyWebTestCase { // Save, creating the terms. $this->drupalPost('node/add/page', $edit, t('Save')); - $this->assertRaw(t('@type %title has been created.', array('@type' => t('Basic page'), '%title' => $edit["title"])), 'The node was created successfully'); + $this->assertRaw(t('@type %title has been created.', array('@type' => t('Basic page'), '%title' => $edit["title"])), 'The node was created successfully.'); foreach ($terms as $term) { - $this->assertText($term, 'The term was saved and appears on the node page'); + $this->assertText($term, 'The term was saved and appears on the node page.'); } // Get the created terms. @@ -738,8 +738,8 @@ class TaxonomyTermTestCase extends TaxonomyWebTestCase { $url = url($path, array('absolute' => TRUE)); $result = drupal_http_request($url); $data = drupal_json_decode($result->data); - $this->assertEqual($data[$first_term->name], check_plain($first_term->name), 'Autocomplete returned the first matching term'); - $this->assertEqual($data[$second_term->name], check_plain($second_term->name), 'Autocomplete returned the second matching term'); + $this->assertEqual($data[$first_term->name], check_plain($first_term->name), 'Autocomplete returned the first matching term.'); + $this->assertEqual($data[$second_term->name], check_plain($second_term->name), 'Autocomplete returned the second matching term.'); // Try to autocomplete a term name that matches first term. // We should only get the first term in a json encoded string. @@ -914,7 +914,7 @@ class TaxonomyTermTestCase extends TaxonomyWebTestCase { // Check that the term was successfully created. $terms = taxonomy_get_term_by_name($edit['name']); $term = reset($terms); - $this->assertNotNull($term, 'Term found in database'); + $this->assertNotNull($term, 'Term found in database.'); $this->assertEqual($edit['name'], $term->name, 'Term name was successfully saved.'); $this->assertEqual($edit['description[value]'], $term->description, 'Term description was successfully saved.'); // Check that the parent tid is still there. The other parent () is @@ -1337,8 +1337,8 @@ class TaxonomyLoadMultipleTestCase extends TaxonomyWebTestCase { // Load the same terms again by tid. $terms2 = taxonomy_term_load_multiple(array_keys($terms)); - $this->assertEqual($count, count($terms2), 'Five terms were loaded by tid'); - $this->assertEqual($terms, $terms2, t('Both arrays contain the same terms')); + $this->assertEqual($count, count($terms2), 'Five terms were loaded by tid.'); + $this->assertEqual($terms, $terms2, 'Both arrays contain the same terms.'); // Load the terms by tid, with a condition on vid. $terms3 = taxonomy_term_load_multiple(array_keys($terms2), array('vid' => $vocabulary->vid)); @@ -1358,7 +1358,7 @@ class TaxonomyLoadMultipleTestCase extends TaxonomyWebTestCase { // Create a single term and load it by name. $term = $this->createTerm($vocabulary); $loaded_terms = taxonomy_term_load_multiple(array(), array('name' => $term->name)); - $this->assertEqual(count($loaded_terms), 1, 'One term was loaded'); + $this->assertEqual(count($loaded_terms), 1, 'One term was loaded.'); $loaded_term = reset($loaded_terms); $this->assertEqual($term->tid, $loaded_term->tid, 'Term loaded by name successfully.'); } @@ -1531,7 +1531,7 @@ class TaxonomyTermFieldTestCase extends TaxonomyWebTestCase { // Delete the vocabulary and verify that the widget is gone. taxonomy_vocabulary_delete($this->vocabulary->vid); $this->drupalGet('test-entity/add/test-bundle'); - $this->assertNoFieldByName("{$this->field_name}[$langcode]", '', 'Widget is not displayed'); + $this->assertNoFieldByName("{$this->field_name}[$langcode]", '', 'Widget is not displayed.'); } /** @@ -1648,7 +1648,7 @@ class TaxonomyTermFieldMultipleVocabularyTestCase extends TaxonomyWebTestCase { // Submit an entity with both terms. $langcode = LANGUAGE_NONE; $this->drupalGet('test-entity/add/test-bundle'); - $this->assertFieldByName("{$this->field_name}[$langcode][]", '', 'Widget is displayed'); + $this->assertFieldByName("{$this->field_name}[$langcode][]", '', 'Widget is displayed.'); $edit = array( "{$this->field_name}[$langcode][]" => array($term1->tid, $term2->tid), ); @@ -1687,7 +1687,7 @@ class TaxonomyTermFieldMultipleVocabularyTestCase extends TaxonomyWebTestCase { // The widget should still be displayed. $this->drupalGet('test-entity/add/test-bundle'); - $this->assertFieldByName("{$this->field_name}[$langcode][]", '', 'Widget is still displayed'); + $this->assertFieldByName("{$this->field_name}[$langcode][]", '', 'Widget is still displayed.'); // Term 1 should still pass validation. $edit = array(