Upgraded drupal core with security updates
[yaffs-website] / web / core / modules / image / tests / src / Functional / ImageFieldWidgetTest.php
1 <?php
2
3 namespace Drupal\Tests\image\Functional;
4
5 /**
6  * Tests the image field widget.
7  *
8  * @group image
9  */
10 class ImageFieldWidgetTest extends ImageFieldTestBase {
11
12   /**
13    * Tests file widget element.
14    */
15   public function testWidgetElement() {
16     // Check for image widget in add/node/article page
17     $field_name = strtolower($this->randomMachineName());
18     $min_resolution = 50;
19     $max_resolution = 100;
20     $field_settings = [
21       'max_resolution' => $max_resolution . 'x' . $max_resolution,
22       'min_resolution' => $min_resolution . 'x' . $min_resolution,
23       'alt_field' => 0,
24     ];
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]');
30   }
31
32 }