public function ContributorTest::testClearContributorName in Bibliography & Citation 2.0.x
Same name and namespace in other branches
- 8 modules/bibcite_entity/tests/src/Kernel/ContributorTest.php \Drupal\Tests\bibcite_entity\Kernel\ContributorTest::testClearContributorName()
Test clearing name parts by full name.
File
- modules/
bibcite_entity/ tests/ src/ Kernel/ ContributorTest.php, line 100
Class
- ContributorTest
- Test contributor entity.
Namespace
Drupal\Tests\bibcite_entity\KernelCode
public function testClearContributorName() {
$entity = Contributor::create();
$entity->name = $this->name;
foreach ($this->nameParts as $part => $value) {
$this
->assertEquals($value, $entity->{$part}->value);
}
$entity->name = '';
foreach ($this->nameParts as $part => $value) {
$this
->assertEquals('', $entity->{$part}->value);
}
}