diff core/modules/user/tests/src/Functional/UserPictureTest.php @ 5:12f9dff5fda9 tip

Update to Drupal core 8.7.1
author Chris Cannam
date Thu, 09 May 2019 15:34:47 +0100
parents c75dbcec494b
children
line wrap: on
line diff
--- a/core/modules/user/tests/src/Functional/UserPictureTest.php	Thu Feb 28 13:11:55 2019 +0000
+++ b/core/modules/user/tests/src/Functional/UserPictureTest.php	Thu May 09 15:34:47 2019 +0100
@@ -2,6 +2,7 @@
 
 namespace Drupal\Tests\user\Functional;
 
+use Drupal\Core\Database\Database;
 use Drupal\image\Entity\ImageStyle;
 use Drupal\Tests\BrowserTestBase;
 use Drupal\file\Entity\File;
@@ -73,8 +74,9 @@
 
     // Call file_cron() to clean up the file. Make sure the timestamp
     // of the file is older than the system.file.temporary_maximum_age
-    // configuration value.
-    db_update('file_managed')
+    // configuration value. We use an UPDATE statement because using the API
+    // would set the timestamp.
+    Database::getConnection()->update('file_managed')
       ->fields([
         'changed' => REQUEST_TIME - ($this->config('system.file')->get('temporary_maximum_age') + 1),
       ])
@@ -107,7 +109,7 @@
     $image_style_id = $this->config('core.entity_view_display.user.user.compact')->get('content.user_picture.settings.image_style');
     $style = ImageStyle::load($image_style_id);
     $image_url = file_url_transform_relative($style->buildUrl($file->getfileUri()));
-    $alt_text = 'Profile picture for user ' . $this->webUser->getUsername();
+    $alt_text = 'Profile picture for user ' . $this->webUser->getAccountName();
 
     // Verify that the image is displayed on the node page.
     $this->drupalGet('node/' . $node->id());