diff --git a/tests/src/Kernel/BackendTestBase.php b/tests/src/Kernel/BackendTestBase.php index 8aa66ed..2ac05d9 100644 --- a/tests/src/Kernel/BackendTestBase.php +++ b/tests/src/Kernel/BackendTestBase.php @@ -192,12 +192,10 @@ protected function enableHtmlFilter() { */ protected function disableHtmlFilter() { $index = $this->getIndex(); - $index->removeField('body'); $index->removeProcessor('html_filter'); $index->save(); $this->assertArrayNotHasKey('html_filter', $index->getProcessors(), 'HTML filter processor is removed.'); - $this->assertArrayNotHasKey('body', $index->getFields(), 'Body field is removed.'); } /** @@ -901,11 +899,6 @@ protected function regressionTest2284199() { * @see https://www.drupal.org/node/2616268 */ protected function regressionTest2471509() { - $index = $this->getIndex(); - $this->addField($index, 'body'); - $index->save(); - $this->indexItems($this->indexId); - $this->addTestEntity(8, array( 'name' => 'Article with long body', 'type' => 'article', @@ -925,7 +918,7 @@ protected function regressionTest2471509() { $results = $query->execute(); $this->assertResults(array(8), $results, 'Filter on new string field'); - $index->removeField('body'); + $index->getField('body')->setType('text'); $index->save(); } @@ -935,10 +928,6 @@ protected function regressionTest2471509() { * @see https://www.drupal.org/node/2616804 */ protected function regressionTest2616804() { - $index = $this->getIndex(); - $this->addField($index, 'body'); - $index->save(); - // The word has 28 Unicode characters but 56 bytes. Verify that it is still // indexed correctly. $mb_word = 'äöüßáŧæøðđŋħĸµäöüßáŧæøðđŋħĸµ'; @@ -950,9 +939,8 @@ protected function regressionTest2616804() { 'type' => 'item', 'body' => $mb_body, )); - $entity_count = count($this->entities); $count = $this->indexItems($this->indexId); - $this->assertEquals($entity_count, $count, 'Indexing an item with a word with 28 multi-byte characters worked.'); + $this->assertEquals(1, $count, 'Indexing an item with a word with 28 multi-byte characters worked.'); $query = $this->buildSearch($mb_word); $results = $query->execute(); @@ -967,6 +955,7 @@ protected function regressionTest2616804() { $index = $this->getIndex(); $index->getField('body')->setType('string'); $index->save(); + $entity_count = count($this->entities); $count = $index->indexItems(); $this->assertEquals($entity_count, $count, 'Switching type from text to string worked.');