You are here

protected function FieldTest::getConfigFieldStorage in Drupal 10

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

Returns a mocked configurable field storage object.

Return value

\Drupal\field\FieldStorageConfigInterface|\PHPUnit\Framework\MockObject\MockObject

4 calls to FieldTest::getConfigFieldStorage()
FieldTest::testCalculateDependenciesWithConfiguredField in core/modules/views/tests/src/Unit/Plugin/field/FieldTest.php
@covers ::calculateDependencies
FieldTest::testClickSortWithConfiguredField in core/modules/views/tests/src/Unit/Plugin/field/FieldTest.php
@dataProvider providerSortOrders
FieldTest::testPrepareItemsByDelta in core/modules/views/tests/src/Unit/Plugin/field/FieldTest.php
@covers ::prepareItemsByDelta
FieldTest::testQueryWithGroupByForConfigField in core/modules/views/tests/src/Unit/Plugin/field/FieldTest.php
@covers ::query

File

core/modules/views/tests/src/Unit/Plugin/field/FieldTest.php, line 679
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 getConfigFieldStorage() {
  $title_storage = $this
    ->createMock('Drupal\\field\\FieldStorageConfigInterface');
  $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;
}