function DefaultTableMappingTest::providerTestGetFieldColumnName

Same name and namespace in other branches
  1. 9 core/tests/Drupal/Tests/Core/Entity/Sql/DefaultTableMappingTest.php \Drupal\Tests\Core\Entity\Sql\DefaultTableMappingTest::providerTestGetFieldColumnName()
  2. 8.9.x core/tests/Drupal/Tests/Core/Entity/Sql/DefaultTableMappingTest.php \Drupal\Tests\Core\Entity\Sql\DefaultTableMappingTest::providerTestGetFieldColumnName()
  3. 10 core/tests/Drupal/Tests/Core/Entity/Sql/DefaultTableMappingTest.php \Drupal\Tests\Core\Entity\Sql\DefaultTableMappingTest::providerTestGetFieldColumnName()

Provides test data for testGetFieldColumnName().

Return value

array[] A nested array where each inner array has the following values: test field name, base field status, list of field columns, name of the column to be retrieved, expected result, whether an exception is expected.

File

core/tests/Drupal/Tests/Core/Entity/Sql/DefaultTableMappingTest.php, line 326

Class

DefaultTableMappingTest
@coversDefaultClass <a href="/api/drupal/core%21lib%21Drupal%21Core%21Entity%21Sql%21DefaultTableMapping.php/class/DefaultTableMapping/11.x" title="Defines a default table mapping class." class="local">\Drupal\Core\Entity\Sql\DefaultTableMapping</a> @group Entity

Namespace

Drupal\Tests\Core\Entity\Sql

Code

public static function providerTestGetFieldColumnName() {
    $data = [];
    // Base field with single column.
    $data[] = [
        TRUE,
        [
            'foo',
        ],
        'foo',
        'test',
    ];
    // Base field with multiple columns.
    $data[] = [
        TRUE,
        [
            'foo',
            'bar',
        ],
        'foo',
        'test__foo',
    ];
    $data[] = [
        TRUE,
        [
            'foo',
            'bar',
        ],
        'bar',
        'test__bar',
    ];
    // Bundle field with single column.
    $data[] = [
        FALSE,
        [
            'foo',
        ],
        'foo',
        'test_foo',
    ];
    // Bundle field with multiple columns.
    $data[] = [
        FALSE,
        [
            'foo',
            'bar',
        ],
        'foo',
        'test_foo',
    ];
    $data[] = [
        FALSE,
        [
            'foo',
            'bar',
        ],
        'bar',
        'test_bar',
    ];
    // Bundle field with reserved column.
    $data[] = [
        FALSE,
        [
            'foo',
            'bar',
        ],
        'deleted',
        'deleted',
    ];
    return $data;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.