You are here

protected function BlazyAdminExtendedUnitTest::setUp in Blazy 8

Same name and namespace in other branches
  1. 8.2 tests/src/Unit/Form/BlazyAdminExtendedUnitTest.php \Drupal\Tests\blazy\Unit\Form\BlazyAdminExtendedUnitTest::setUp()

Overrides UnitTestCase::setUp

File

tests/src/Unit/Form/BlazyAdminExtendedUnitTest.php, line 32

Class

BlazyAdminExtendedUnitTest
Tests the Blazy admin formatter form.

Namespace

Drupal\Tests\blazy\Unit\Form

Code

protected function setUp() {
  parent::setUp();
  $this
    ->setUpUnitServices();
  $this
    ->setUpUnitContainer();
  $this->stringTranslation = $this
    ->createMock('Drupal\\Core\\StringTranslation\\TranslationInterface');
  $this->entityDisplayRepository = $this
    ->createMock('Drupal\\Core\\Entity\\EntityDisplayRepositoryInterface');
  $this->typedConfig = $this
    ->createMock('Drupal\\Core\\Config\\TypedConfigManagerInterface');
  $this->dateFormatter = $this
    ->getMockBuilder('Drupal\\Core\\Datetime\\DateFormatter')
    ->disableOriginalConstructor()
    ->getMock();
  $container = new ContainerBuilder();
  $container
    ->set('entity_display.repository', $this->entityDisplayRepository);
  $container
    ->set('config.typed', $this->typedConfig);
  $container
    ->set('string_translation', $this
    ->getStringTranslationStub());
  $container
    ->set('date.formatter', $this->dateFormatter);
  \Drupal::setContainer($container);
  $this->blazyAdminExtended = new BlazyAdminExtended($this->entityDisplayRepository, $this->typedConfig, $this->blazyManager);
}