Same name and namespace in other branches
  1. 8.9.x core/tests/Drupal/Tests/Core/Common/TagsTest.php \Drupal\Tests\Core\Common\TagsTest::testImplodeTags()
  2. 9 core/tests/Drupal/Tests/Core/Common/TagsTest.php \Drupal\Tests\Core\Common\TagsTest::testImplodeTags()

Implodes a series of tags.

File

core/tests/Drupal/Tests/Core/Common/TagsTest.php, line 38

Class

TagsTest
Tests explosion and implosion of autocomplete tags.

Namespace

Drupal\Tests\Core\Common

Code

public function testImplodeTags() {
  $tags = array_values($this->validTags);

  // Let's explode and implode to our heart's content.
  for ($i = 0; $i < 10; $i++) {
    $string = Tags::implode($tags);
    $tags = Tags::explode($string);
  }
  $this
    ->assertEquals(array_values($this->validTags), $tags);
}