public function ProvidedFieldsTest::testProvidedFields in Video Embed Field 8
Same name and namespace in other branches
- 8.2 modules/video_embed_media/tests/src/Kernel/ProvidedFieldsTest.php \Drupal\Tests\video_embed_media\Kernel\ProvidedFieldsTest::testProvidedFields()
Test the fields provided by the integration.
@dataProvider providedFieldsTestCases
File
- modules/
video_embed_media/ tests/ src/ Kernel/ ProvidedFieldsTest.php, line 86
Class
- ProvidedFieldsTest
- Test the provided fields.
Namespace
Drupal\Tests\video_embed_media\KernelCode
public function testProvidedFields($input, $field, $expected) {
$entity = Media::create([
'bundle' => 'video',
VideoEmbedField::VIDEO_EMBED_FIELD_DEFAULT_NAME => [
[
'value' => $input,
],
],
]);
$actual = $this->mediaVideoPlugin
->getField($entity, $field);
$this
->assertEquals($expected, $actual);
}