protected function ImportBasicTest::assertEntityValues in Bibliography & Citation 8
Same name and namespace in other branches
- 2.0.x modules/bibcite_import/tests/src/Kernel/ImportBasicTest.php \Drupal\Tests\bibcite_import\Kernel\ImportBasicTest::assertEntityValues()
Check if values in the provided entity equal to expected values.
Parameters
\Drupal\Core\Entity\EntityInterface $entity: The entity object.
array $expected_values: List of expected values.
1 call to ImportBasicTest::assertEntityValues()
- ImportBasicTest::testReferenceDeserialization in modules/
bibcite_import/ tests/ src/ Kernel/ ImportBasicTest.php - Test decode and denormalization from available text formats to entity.
File
- modules/
bibcite_import/ tests/ src/ Kernel/ ImportBasicTest.php, line 104
Class
- ImportBasicTest
- Basic import tests.
Namespace
Drupal\Tests\bibcite_import\KernelCode
protected function assertEntityValues(EntityInterface $entity, array $expected_values) {
foreach ($expected_values as $field_name => $expected_value) {
/* @var Reference $entity */
$this
->assertNotEmpty($entity
->get($field_name));
$this
->assertEquals($expected_value, $entity->{$field_name}->value);
}
}