public function DefaultUserImageTest::testDefaultUserImage in Lightning Core 8.4
Same name and namespace in other branches
- 8.5 tests/src/Kernel/DefaultUserImageTest.php \Drupal\Tests\lightning_core\Kernel\DefaultUserImageTest::testDefaultUserImage()
- 8.3 tests/src/Kernel/DefaultUserImageTest.php \Drupal\Tests\lightning_core\Kernel\DefaultUserImageTest::testDefaultUserImage()
Tests that the default avatar is set.
File
- tests/
src/ Kernel/ DefaultUserImageTest.php, line 30
Class
- DefaultUserImageTest
- @group lightning_core
Namespace
Drupal\Tests\lightning_core\KernelCode
public function testDefaultUserImage() {
\Drupal::service('module_installer')
->install([
'lightning_core',
'image',
]);
$this
->assertFileExists('public://default-avatar.png');
$config = FieldConfig::load('user.user.user_picture');
$setting = $config
->getSetting('default_image');
$this
->assertNotEmpty($setting['uuid']);
$this
->assertSame('A generic silhouette of a person.', $setting['alt']);
$this
->assertSame('', $setting['title']);
$this
->assertSame(140, $setting['width']);
$this
->assertSame(140, $setting['height']);
}