function ImageTest::addImage
Same name in other branches
- 10 core/modules/ckeditor5/tests/src/FunctionalJavascript/ImageTest.php \Drupal\Tests\ckeditor5\FunctionalJavascript\ImageTest::addImage()
Overrides ImageTestBase::addImage
File
-
core/
modules/ ckeditor5/ tests/ src/ FunctionalJavascript/ ImageTest.php, line 122
Class
- ImageTest
- @coversDefaultClass \Drupal\ckeditor5\Plugin\CKEditor5Plugin\Image @group ckeditor5 @internal
Namespace
Drupal\Tests\ckeditor5\FunctionalJavascriptCode
protected function addImage() {
$page = $this->getSession()
->getPage();
$this->assertNotEmpty($image_upload_field = $page->find('css', '.ck-file-dialog-button input[type="file"]'));
$image = $this->getTestFiles('image')[0];
$image_upload_field->attachFile($this->container
->get('file_system')
->realpath($image->uri));
// Wait for the image to be uploaded and rendered by CKEditor 5.
$this->assertNotEmpty($this->assertSession()
->waitForElementVisible('css', '.ck-widget.image > img[src*="' . $image->filename . '"]'));
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.