function ViewsDataTest::testGetOnFirstCall
Same name in other branches
- 8.9.x core/modules/views/tests/src/Unit/ViewsDataTest.php \Drupal\Tests\views\Unit\ViewsDataTest::testGetOnFirstCall()
- 10 core/modules/views/tests/src/Unit/ViewsDataTest.php \Drupal\Tests\views\Unit\ViewsDataTest::testGetOnFirstCall()
- 11.x core/modules/views/tests/src/Unit/ViewsDataTest.php \Drupal\Tests\views\Unit\ViewsDataTest::testGetOnFirstCall()
Tests fetching all the views data without a static cache.
File
-
core/
modules/ views/ tests/ src/ Unit/ ViewsDataTest.php, line 182
Class
- ViewsDataTest
- @coversDefaultClass \Drupal\views\ViewsData @group views
Namespace
Drupal\Tests\views\UnitCode
public function testGetOnFirstCall() {
// Ensure that the hooks are just invoked once.
$this->setupMockedModuleHandler();
$this->moduleHandler
->expects($this->once())
->method('alter')
->with('views_data', $this->viewsDataWithProvider());
$this->cacheBackend
->expects($this->once())
->method('get')
->with("views_data:en")
->willReturn(FALSE);
$expected_views_data = $this->viewsDataWithProvider();
$views_data = $this->viewsData
->getAll();
$this->assertSame($expected_views_data, $views_data);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.