protected function ViewTestBase::createViewFromConfig in Views (for Drupal 7) 8.3
Creates a new View instance by creating directly from config data.
Parameters
string $view_name: The name of the test view to create.
Return value
Drupal\views\ViewExecutable A View instance.
35 calls to ViewTestBase::createViewFromConfig()
- AccessPermissionTest::testAccessPerm in lib/
Drupal/ views/ Tests/ User/ AccessPermissionTest.php - Tests perm access plugin.
- AccessRoleTest::testAccessRole in lib/
Drupal/ views/ Tests/ User/ AccessRoleTest.php - Tests role access plugin.
- AccessTest::testAccessNone in lib/
Drupal/ views/ Tests/ Plugin/ AccessTest.php - Tests none access plugin.
- AccessTest::testDynamicAccessPlugin in lib/
Drupal/ views/ Tests/ Plugin/ AccessTest.php - Tests dynamic access plugin.
- AccessTest::testStaticAccessPlugin in lib/
Drupal/ views/ Tests/ Plugin/ AccessTest.php - Tests static access check.
File
- lib/
Drupal/ views/ Tests/ ViewTestBase.php, line 410 - Definition of Drupal\views\Tests\ViewTestBase.
Class
- ViewTestBase
- Abstract class for views testing.
Namespace
Drupal\views\TestsCode
protected function createViewFromConfig($view_name) {
if (!module_exists('views_test_config')) {
module_enable(array(
'views_test_config',
));
}
$data = config("views.view.{$view_name}")
->get();
$view = entity_create('view', $data);
$view = $view
->getExecutable();
$view
->setDisplay();
return $view;
}