You are here

protected function FieldTest::getBaseFieldStorage in Drupal 9

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::getBaseFieldStorage()
  2. 10 core/modules/views/tests/src/Unit/Plugin/field/FieldTest.php \Drupal\Tests\views\Unit\Plugin\field\FieldTest::getBaseFieldStorage()

Returns a mocked base field storage object.

Return value

\Drupal\Core\Field\FieldStorageDefinitionInterface|\PHPUnit\Framework\MockObject\MockObject

7 calls to FieldTest::getBaseFieldStorage()
FieldTest::testAccess in core/modules/views/tests/src/Unit/Plugin/field/FieldTest.php
@covers ::access
FieldTest::testCalculateDependenciesWithBaseField in core/modules/views/tests/src/Unit/Plugin/field/FieldTest.php
@covers ::calculateDependencies
FieldTest::testClickSortWithBaseField in core/modules/views/tests/src/Unit/Plugin/field/FieldTest.php
@dataProvider providerSortOrders
FieldTest::testDefineOptionsWithDefaultFormatterOnFieldDefinition in core/modules/views/tests/src/Unit/Plugin/field/FieldTest.php
@covers ::defineOptions
FieldTest::testDefineOptionsWithDefaultFormatterOnFieldType in core/modules/views/tests/src/Unit/Plugin/field/FieldTest.php
@covers ::defineOptions

... See full list

File

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

Class

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

Namespace

Drupal\Tests\views\Unit\Plugin\field

Code

protected function getBaseFieldStorage() {
  $title_storage = $this
    ->createMock('Drupal\\Core\\Field\\FieldStorageDefinitionInterface');
  $title_storage
    ->expects($this
    ->any())
    ->method('getColumns')
    ->willReturn([
    'value' => [
      'type' => 'varchar',
    ],
  ]);
  $title_storage
    ->expects($this
    ->any())
    ->method('getSettings')
    ->willReturn([]);
  $title_storage
    ->expects($this
    ->any())
    ->method('getConstraints')
    ->willReturn([]);
  return $title_storage;
}