You are here

public function ItemFieldTest::testAddValue in Search API 8

Tests adding a value.

Ensures that a string passed to addValue() is processed by the data type plugin.

@covers ::addValue

File

tests/src/Unit/ItemFieldTest.php, line 75

Class

ItemFieldTest
Tests functionality of the field class.

Namespace

Drupal\Tests\search_api\Unit

Code

public function testAddValue() {
  $this->field
    ->setValues([
    '*foo',
  ]);
  $this->field
    ->addValue('bar');
  $this
    ->assertEquals([
    '*foo',
    '*bar',
  ], $this->field
    ->getValues());
}