diff core/profiles/standard/tests/src/Functional/StandardTest.php @ 18:af1871eacc83

Update to Drupal core 8.7.1
author Chris Cannam
date Thu, 09 May 2019 15:33:08 +0100
parents 129ea1e6d783
children
line wrap: on
line diff
--- a/core/profiles/standard/tests/src/Functional/StandardTest.php	Thu Feb 28 13:21:36 2019 +0000
+++ b/core/profiles/standard/tests/src/Functional/StandardTest.php	Thu May 09 15:33:08 2019 +0100
@@ -10,6 +10,7 @@
 use Drupal\dynamic_page_cache\EventSubscriber\DynamicPageCacheSubscriber;
 use Drupal\filter\Entity\FilterFormat;
 use Drupal\Tests\BrowserTestBase;
+use Drupal\Tests\RequirementsPageTrait;
 use Drupal\user\Entity\Role;
 
 /**
@@ -20,6 +21,7 @@
 class StandardTest extends BrowserTestBase {
 
   use SchemaCheckTestTrait;
+  use RequirementsPageTrait;
 
   protected $profile = 'standard';
 
@@ -155,6 +157,8 @@
     // Ensure that there are no pending updates after installation.
     $this->drupalLogin($this->rootUser);
     $this->drupalGet('update.php/selection');
+    $this->updateRequirementsProblem();
+    $this->drupalGet('update.php/selection');
     $this->assertText('No pending updates.');
 
     // Ensure that there are no pending entity updates after installation.
@@ -242,18 +246,15 @@
       $form = $assert_session->elementExists('css', $form_selector);
       $form_html = $form->getOuterHtml();
 
-      // The name field (if it exists) should come before the source field,
-      // which should itself come before the vertical tabs.
+      // The name field should be hidden.
+      $assert_session->fieldNotExists('Name', $form);
+      // The source field should be shown before the vertical tabs.
       $test_source_field = $assert_session->fieldExists($media_type->getSource()->getSourceFieldDefinition($media_type)->getLabel(), $form)->getOuterHtml();
       $vertical_tabs = $assert_session->elementExists('css', '.form-type-vertical-tabs', $form)->getOuterHtml();
+      $this->assertTrue(strpos($form_html, $vertical_tabs) > strpos($form_html, $test_source_field));
+      // The "Published" checkbox should be the last element.
       $date_field = $assert_session->fieldExists('Date', $form)->getOuterHtml();
       $published_checkbox = $assert_session->fieldExists('Published', $form)->getOuterHtml();
-      if ($page->findField('Name')) {
-        $name_field = $assert_session->fieldExists('Name', $form)->getOuterHtml();
-        $this->assertTrue(strpos($form_html, $test_source_field) > strpos($form_html, $name_field));
-      }
-      $this->assertTrue(strpos($form_html, $vertical_tabs) > strpos($form_html, $test_source_field));
-      // The "Published" checkbox should be the last element.
       $this->assertTrue(strpos($form_html, $published_checkbox) > strpos($form_html, $date_field));
     }
   }