You are here

protected function FieldTest::setUp in Zircon Profile 8.0

Same name in this branch
  1. 8.0 core/modules/views/tests/src/Unit/Plugin/field/FieldTest.php \Drupal\Tests\views\Unit\Plugin\field\FieldTest::setUp()
  2. 8.0 core/modules/field/tests/src/Unit/Plugin/migrate/source/d6/FieldTest.php \Drupal\Tests\field\Unit\Plugin\migrate\source\d6\FieldTest::setUp()
  3. 8.0 core/modules/field/tests/src/Unit/Plugin/migrate/source/d7/FieldTest.php \Drupal\Tests\field\Unit\Plugin\migrate\source\d7\FieldTest::setUp()
Same name and namespace in other branches
  1. 8 core/modules/views/tests/src/Unit/Plugin/field/FieldTest.php \Drupal\Tests\views\Unit\Plugin\field\FieldTest::setUp()

Overrides UnitTestCase::setUp

File

core/modules/views/tests/src/Unit/Plugin/field/FieldTest.php, line 70
Contains \Drupal\Tests\views\Unit\Plugin\field\FieldTest.

Class

FieldTest
@coversDefaultClass \Drupal\views\Plugin\views\field\Field @group views

Namespace

Drupal\Tests\views\Unit\Plugin\field

Code

protected function setUp() {
  parent::setUp();
  $this->entityManager = $this
    ->getMock('Drupal\\Core\\Entity\\EntityManagerInterface');
  $this->formatterPluginManager = $this
    ->getMockBuilder('Drupal\\Core\\Field\\FormatterPluginManager')
    ->disableOriginalConstructor()
    ->getMock();
  $this->fieldTypePluginManager = $this
    ->getMock('Drupal\\Core\\Field\\FieldTypePluginManagerInterface');
  $this->fieldTypePluginManager
    ->expects($this
    ->any())
    ->method('getDefaultStorageSettings')
    ->willReturn([]);
  $this->fieldTypePluginManager
    ->expects($this
    ->any())
    ->method('getDefaultFieldSettings')
    ->willReturn([]);
  $this->languageManager = $this
    ->getMock('Drupal\\Core\\Language\\LanguageManagerInterface');
  $this->renderer = $this
    ->getMock('Drupal\\Core\\Render\\RendererInterface');
  $this
    ->setupExecutableAndView();
  $this
    ->setupViewsData();
  $this->display = $this
    ->getMockBuilder('Drupal\\views\\Plugin\\views\\display\\DisplayPluginBase')
    ->disableOriginalConstructor()
    ->getMock();
  $this->container = new ContainerBuilder();
  $this->container
    ->set('plugin.manager.field.field_type', $this->fieldTypePluginManager);
  \Drupal::setContainer($this->container);
}