function EntityStorageBaseTest::providerLoad

Same name and namespace in other branches
  1. 10 core/tests/Drupal/Tests/Core/Entity/EntityStorageBaseTest.php \Drupal\Tests\Core\Entity\EntityStorageBaseTest::providerLoad()
  2. 11.x core/tests/Drupal/Tests/Core/Entity/EntityStorageBaseTest.php \Drupal\Tests\Core\Entity\EntityStorageBaseTest::providerLoad()

Data provider for testLoad().

Return value

array

  • Expected output of load().
  • A fixture of entities to query against. Suitable return value for loadMultiple().
  • The ID we'll query.

File

core/tests/Drupal/Tests/Core/Entity/EntityStorageBaseTest.php, line 41

Class

EntityStorageBaseTest
@coversDefaultClass <a href="/api/drupal/core%21lib%21Drupal%21Core%21Entity%21EntityStorageBase.php/class/EntityStorageBase/9" title="A base entity storage class." class="local">\Drupal\Core\Entity\EntityStorageBase</a> @group Entity

Namespace

Drupal\Tests\Core\Entity

Code

public function providerLoad() {
    $data = [];
    // Data set for a matching value.
    $entity = $this->generateEntityInterface('1');
    $data['matching-value'] = [
        $entity,
        [
            '1' => $entity,
        ],
        '1',
    ];
    // Data set for no matching value.
    $data['no-matching-value'] = [
        NULL,
        [],
        '0',
    ];
    return $data;
}

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