Updated to Drupal 8.5. Core Media not yet in use.
[yaffs-website] / web / core / modules / image / src / Tests / ImageAdminStylesTest.php
index 38fd98487606a7a3f15dbc33bc8c26857313a736..1f6f411054f6a28c9cf6393474ccfd17d8e64862 100644 (file)
@@ -422,9 +422,20 @@ class ImageAdminStylesTest extends ImageFieldTestBase {
     // Edit the scale effect that was just added.
     $this->clickLink(t('Edit'));
     $this->drupalPostForm(NULL, ['data[width]' => '24', 'data[height]' => '19'], t('Update effect'));
-    $this->drupalPostForm(NULL, ['new' => 'image_scale'], t('Add'));
 
-    // Add another scale effect and make sure both exist.
+    // Add another scale effect and make sure both exist. Click through from
+    // the overview to make sure that it is possible to add new effect then.
+    $this->drupalGet('admin/config/media/image-styles');
+    $rows = $this->xpath('//table/tbody/tr');
+    $i = 0;
+    foreach ($rows as $row) {
+      if (((string) $row->td[0]) === 'Test style scale edit scale') {
+        $this->clickLink('Edit', $i);
+        break;
+      }
+      $i++;
+    }
+    $this->drupalPostForm(NULL, ['new' => 'image_scale'], t('Add'));
     $this->drupalPostForm(NULL, ['data[width]' => '12', 'data[height]' => '19'], t('Add effect'));
     $this->assertText(t('Scale 24×19'));
     $this->assertText(t('Scale 12×19'));