function ViewsDataTest::testGetEmptyKey

Tests that getting data with an empty key throws an exception.

@legacy-covers ::get

Attributes

#[DataProvider('providerTestGetEmptyKey')]

File

core/modules/views/tests/src/Unit/ViewsDataTest.php, line 648

Class

ViewsDataTest
Tests Drupal\views\ViewsData.

Namespace

Drupal\Tests\views\Unit

Code

public function testGetEmptyKey($key) : void {
  $this->expectException(\InvalidArgumentException::class);
  $this->expectExceptionMessage('A valid cache entry key is required. Use getAll() to get all table data.');
  $this->viewsData
    ->get($key);
}

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