private function CKEditorMediaBrowserTest::addMedia in Lightning Media 8.3
Adds a media item to the library and marks it for deletion in tearDown().
Parameters
array $values: The values with which to create the media item.
Return value
\Drupal\media\MediaInterface The saved media item.
5 calls to CKEditorMediaBrowserTest::addMedia()
- CKEditorMediaBrowserTest::testDocumentEmbed in tests/
src/ FunctionalJavascript/ CKEditorMediaBrowserTest.php - Tests that the image embed plugin is not used to embed a document.
- CKEditorMediaBrowserTest::testEditEmbed in tests/
src/ FunctionalJavascript/ CKEditorMediaBrowserTest.php - Tests that the entity embed dialog opens when editing a pre-existing embed.
- CKEditorMediaBrowserTest::testExposedFilters in tests/
src/ FunctionalJavascript/ CKEditorMediaBrowserTest.php - Tests exposed filters in the media browser.
- CKEditorMediaBrowserTest::testImageEmbed in tests/
src/ FunctionalJavascript/ CKEditorMediaBrowserTest.php - Tests that the image embed plugin is used to embed an image.
- CKEditorMediaBrowserTest::testUnlimitedCardinality in tests/
src/ FunctionalJavascript/ CKEditorMediaBrowserTest.php - Tests that cardinality is never enforced in the media browser.
File
- tests/
src/ FunctionalJavascript/ CKEditorMediaBrowserTest.php, line 267
Class
- CKEditorMediaBrowserTest
- Tests the media browser's integration with CKEditor.
Namespace
Drupal\Tests\lightning_media\FunctionalJavascriptCode
private function addMedia(array $values) {
$values['field_media_in_library'] = TRUE;
$values['status'] = TRUE;
$media = Media::create($values);
$media
->save();
return $media;
}