You are here

public function Update360Test::test in Lightning Core 8.4

Same name and namespace in other branches
  1. 8.3 tests/src/Kernel/Update/Update360Test.php \Drupal\Tests\lightning_core\Kernel\Update\Update360Test::test()

File

tests/src/Kernel/Update/Update360Test.php, line 35

Class

Update360Test
@group lightning_core

Namespace

Drupal\Tests\lightning_core\Kernel\Update

Code

public function test() {
  $this
    ->assertFalse($this->container
    ->get('module_handler')
    ->moduleExists('image'));
  $this
    ->assertNull(FieldConfig::loadByName('user', 'user', 'user_picture'));
  $this
    ->assertTrue(lightning_core_entity_get_display('user', 'user', 'compact')
    ->isNew());
  $this->container
    ->get('class_resolver')
    ->getInstanceFromDefinition(Update360::class)
    ->enableUserPictures();
  $this
    ->assertTrue($this->container
    ->get('module_handler')
    ->moduleExists('image'));
  $this
    ->assertInstanceOf(FieldConfig::class, FieldConfig::loadByName('user', 'user', 'user_picture'));
  $display = lightning_core_entity_get_display('user', 'user', 'compact');
  $this
    ->assertFalse($display
    ->isNew());
  $this
    ->assertInternalType('array', $display
    ->getComponent('name'));
  $this
    ->assertInternalType('array', $display
    ->getComponent('user_picture'));
}