You are here

public function FocalPointManagerTest::testConstuctor in Focal Point 8

Test constructor.

@covers ::__construct

File

tests/src/Unit/FocalPointManagerTest.php, line 21

Class

FocalPointManagerTest
@coversDefaultClass \Drupal\focal_point\FocalPointManager

Namespace

Drupal\Tests\focal_point\Unit

Code

public function testConstuctor() {
  $crop_storage = $this
    ->prophesize(CropStorageInterface::class);
  $entity_type_manager = $this
    ->prophesize(EntityTypeManager::class);
  $entity_type_manager
    ->getStorage('crop')
    ->willReturn($crop_storage);
  $focal_point_manager = new FocalPointManager($entity_type_manager
    ->reveal());
  $focal_point_manager_reflection = new \ReflectionClass(FocalPointManager::class);
  $property = $focal_point_manager_reflection
    ->getProperty('cropStorage');
  $property
    ->setAccessible(TRUE);
  $this
    ->assertEquals($crop_storage
    ->reveal(), $property
    ->getValue($focal_point_manager));
}