function EntityStorageBaseTest::providerLoad

Same name 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 \Drupal\Core\Entity\EntityStorageBase @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.