protected function SqlTest::setupViewsData in Drupal 10
Same name and namespace in other branches
- 8 core/modules/views/tests/src/Unit/Plugin/query/SqlTest.php \Drupal\Tests\views\Unit\Plugin\query\SqlTest::setupViewsData()
- 9 core/modules/views/tests/src/Unit/Plugin/query/SqlTest.php \Drupal\Tests\views\Unit\Plugin\query\SqlTest::setupViewsData()
Sets up the views data in the container.
Parameters
\Drupal\views\ViewsData $views_data: The views data.
1 call to SqlTest::setupViewsData()
- SqlTest::setupEntityTypes in core/
modules/ views/ tests/ src/ Unit/ Plugin/ query/ SqlTest.php - Sets up some test entity types and corresponding views data.
File
- core/
modules/ views/ tests/ src/ Unit/ Plugin/ query/ SqlTest.php, line 124
Class
- SqlTest
- @coversDefaultClass \Drupal\views\Plugin\views\query\Sql
Namespace
Drupal\Tests\views\Unit\Plugin\queryCode
protected function setupViewsData(ViewsData $views_data) {
$container = \Drupal::hasContainer() ? \Drupal::getContainer() : new ContainerBuilder();
$container
->set('views.views_data', $views_data);
\Drupal::setContainer($container);
}