annotate core/modules/image/tests/src/Functional/ImageFieldWidgetTest.php @ 3:e11175134f4e

Attempt to introduce editable version of theme
author Chris Cannam
date Tue, 05 Dec 2017 11:25:38 +0000
parents 4c8ae668cc8c
children 1fec387a4317
rev   line source
Chris@0 1 <?php
Chris@0 2
Chris@0 3 namespace Drupal\Tests\image\Functional;
Chris@0 4
Chris@0 5 /**
Chris@0 6 * Tests the image field widget.
Chris@0 7 *
Chris@0 8 * @group image
Chris@0 9 */
Chris@0 10 class ImageFieldWidgetTest extends ImageFieldTestBase {
Chris@0 11
Chris@0 12 /**
Chris@0 13 * Tests file widget element.
Chris@0 14 */
Chris@0 15 public function testWidgetElement() {
Chris@0 16 // Check for image widget in add/node/article page
Chris@0 17 $field_name = strtolower($this->randomMachineName());
Chris@0 18 $min_resolution = 50;
Chris@0 19 $max_resolution = 100;
Chris@0 20 $field_settings = [
Chris@0 21 'max_resolution' => $max_resolution . 'x' . $max_resolution,
Chris@0 22 'min_resolution' => $min_resolution . 'x' . $min_resolution,
Chris@0 23 'alt_field' => 0,
Chris@0 24 ];
Chris@0 25 $this->createImageField($field_name, 'article', [], $field_settings, [], [], 'Image test on [site:name]');
Chris@0 26 $this->drupalGet('node/add/article');
Chris@0 27 $this->assertNotEqual(0, count($this->xpath('//div[contains(@class, "field--widget-image-image")]')), 'Image field widget found on add/node page', 'Browser');
Chris@0 28 $this->assertNotEqual(0, count($this->xpath('//input[contains(@accept, "image/*")]')), 'Image field widget limits accepted files.', 'Browser');
Chris@0 29 $this->assertNoText('Image test on [site:name]');
Chris@0 30 }
Chris@0 31
Chris@0 32 }