You are here

public function ContributorTest::testUnsetContributorName in Bibliography & Citation 8

Same name and namespace in other branches
  1. 2.0.x modules/bibcite_entity/tests/src/Kernel/ContributorTest.php \Drupal\Tests\bibcite_entity\Kernel\ContributorTest::testUnsetContributorName()

Test unset name parts by full name.

File

modules/bibcite_entity/tests/src/Kernel/ContributorTest.php, line 85

Class

ContributorTest
Test contributor entity.

Namespace

Drupal\Tests\bibcite_entity\Kernel

Code

public function testUnsetContributorName() {
  $entity = Contributor::create();
  $entity->name = $this->name;
  foreach ($this->nameParts as $part => $value) {
    $this
      ->assertEquals($value, $entity->{$part}->value);
  }
  $entity->name = NULL;
  foreach ($this->nameParts as $part => $value) {
    $this
      ->assertNull($entity->{$part}->value);
  }
}