3 namespace Drupal\Tests\image\Functional;
6 * Tests the image field widget.
10 class ImageFieldWidgetTest extends ImageFieldTestBase {
13 * Tests file widget element.
15 public function testWidgetElement() {
16 // Check for image widget in add/node/article page
17 $field_name = strtolower($this->randomMachineName());
19 $max_resolution = 100;
21 'max_resolution' => $max_resolution . 'x' . $max_resolution,
22 'min_resolution' => $min_resolution . 'x' . $min_resolution,
25 $this->createImageField($field_name, 'article', [], $field_settings, [], [], 'Image test on [site:name]');
26 $this->drupalGet('node/add/article');
27 $this->assertNotEqual(0, count($this->xpath('//div[contains(@class, "field--widget-image-image")]')), 'Image field widget found on add/node page', 'Browser');
28 $this->assertNotEqual(0, count($this->xpath('//input[contains(@accept, "image/*")]')), 'Image field widget limits accepted files.', 'Browser');
29 $this->assertNoText('Image test on [site:name]');