public function UserPictureTest::testUserViewAlter in Drupal 10
Same name and namespace in other branches
- 8 core/modules/user/tests/src/Functional/UserPictureTest.php \Drupal\Tests\user\Functional\UserPictureTest::testUserViewAlter()
- 9 core/modules/user/tests/src/Functional/UserPictureTest.php \Drupal\Tests\user\Functional\UserPictureTest::testUserViewAlter()
Tests user picture field with a non-standard field formatter.
See also
File
- core/
modules/ user/ tests/ src/ Functional/ UserPictureTest.php, line 171
Class
- UserPictureTest
- Tests user picture functionality.
Namespace
Drupal\Tests\user\FunctionalCode
public function testUserViewAlter() {
\Drupal::service('module_installer')
->install([
'image_module_test',
]);
// Set dummy_image_formatter to the default view mode of user entity.
EntityViewDisplay::load('user.user.default')
->setComponent('user_picture', [
'region' => 'content',
'type' => 'dummy_image_formatter',
])
->save();
$this
->drupalLogin($this->webUser);
$this
->assertSession()
->statusCodeEquals(200);
$this
->assertSession()
->pageTextContains('Dummy');
}