function UserPictureTest::testUserViewAlter
Same name in other branches
- 9 core/modules/user/tests/src/Functional/UserPictureTest.php \Drupal\Tests\user\Functional\UserPictureTest::testUserViewAlter()
- 10 core/modules/user/tests/src/Functional/UserPictureTest.php \Drupal\Tests\user\Functional\UserPictureTest::testUserViewAlter()
- 11.x 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 168
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');
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.