Skip to content
Snippets Groups Projects
Commit ce5f7993 authored by Eirik Morland's avatar Eirik Morland Committed by Eirik Morland
Browse files

Issue #3046297 by eiriksm: Add some tests

parent 8ca68f1b
Branches
Tags
No related merge requests found
<?php
namespace Drupal\Tests\image_canvas_editor_api\FunctionalJavascript;
use Drupal\Tests\image\FunctionalJavascript\ImageFieldTestBase;
/**
* @group image_canvas_editor_api
*/
class WidgetAdminTest extends ImageFieldTestBase {
/**
* Modules to enable.
*
* @var array
*/
public static $modules = [
'node',
'image',
'field_ui',
'image_canvas_editor_api',
];
protected function setUp() {
parent::setUp();
$web_user = $this->drupalCreateUser(['bypass node access', 'administer content types', 'administer node fields', 'administer node form display', 'administer node display']);
$this->drupalLogin($web_user);
}
/**
* Test the fact that we can select image canvas editor as widget.
*/
public function testAdminWidget() {
$field_name = strtolower($this->randomMachineName());
$this->createImageField($field_name, 'article', ['cardinality' => -1]);
$this->drupalGet('admin/structure/types/manage/article/form-display');
$this->getSession()->getPage()->selectFieldOption("fields[$field_name][type]", 'image_canvas_editor');
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment