You are here

public function ContentEntityBaseUnitTest::providerGetFields in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/tests/Drupal/Tests/Core/Entity/ContentEntityBaseUnitTest.php \Drupal\Tests\Core\Entity\ContentEntityBaseUnitTest::providerGetFields()

Data provider for testGetFields().

@returns array

  • Expected output from getFields().
  • $include_computed value to pass to getFields().
  • Value to mock from all field definitions for isComputed().
  • Array of field names to return from mocked getFieldDefinitions(). A Drupal\Core\Field\FieldDefinitionInterface object will be mocked for each name.

File

core/tests/Drupal/Tests/Core/Entity/ContentEntityBaseUnitTest.php, line 539
Contains \Drupal\Tests\Core\Entity\ContentEntityBaseUnitTest.

Class

ContentEntityBaseUnitTest
@coversDefaultClass \Drupal\Core\Entity\ContentEntityBase @group Entity @group Access

Namespace

Drupal\Tests\Core\Entity

Code

public function providerGetFields() {
  return [
    [
      [],
      FALSE,
      FALSE,
      [],
    ],
    [
      [
        'field' => 'field',
        'field2' => 'field2',
      ],
      TRUE,
      FALSE,
      [
        'field',
        'field2',
      ],
    ],
    [
      [
        'field3' => 'field3',
      ],
      TRUE,
      TRUE,
      [
        'field3',
      ],
    ],
    [
      [],
      FALSE,
      TRUE,
      [
        'field4',
      ],
    ],
  ];
}