function DrupalTagsHandlingTestCase::assertTags

7.x common.test DrupalTagsHandlingTestCase::assertTags($tags)

Helper function: asserts that the ending array of tags is what we wanted.

2 calls to DrupalTagsHandlingTestCase::assertTags()
DrupalTagsHandlingTestCase::testDrupalExplodeTags in drupal-7.x/modules/simpletest/tests/common.test
Explode a series of tags.
DrupalTagsHandlingTestCase::testDrupalImplodeTags in drupal-7.x/modules/simpletest/tests/common.test
Implode a series of tags.

File

drupal-7.x/modules/simpletest/tests/common.test, line 571
Tests for common.inc functionality.

Class

DrupalTagsHandlingTestCase
Test drupal_explode_tags() and drupal_implode_tags().

Code

function assertTags($tags) {
  $original = $this->validTags;
  foreach ($tags as $tag) {
    $key = array_search($tag, $original);
    $this->assertTrue($key, format_string('Make sure tag %tag shows up in the final tags array (originally %original)', array('%tag' => $tag, '%original' => $key)));
    unset($original[$key]);
  }
  foreach ($original as $leftover) {
    $this->fail(format_string('Leftover tag %leftover was left over.', array('%leftover' => $leftover)));
  }
}