function ViewsConfigUpdaterTest::loadTestView
Loads a test view.
Parameters
string $view_id: The view config ID.
Return value
\Drupal\views\ViewEntityInterface A view entity object.
4 calls to ViewsConfigUpdaterTest::loadTestView()
- ViewsConfigUpdaterTest::testUpdateRssViewMode in core/
modules/ views/ tests/ src/ Kernel/ ViewsConfigUpdaterTest.php  - Tests the `needsRssViewModeUpdate` method.
 - ViewsConfigUpdaterTest::testUpdateRssViewModeSkipsOtherType in core/
modules/ views/ tests/ src/ Kernel/ ViewsConfigUpdaterTest.php  - Tests the `needsRssViewModeUpdate` method.
 - ViewsConfigUpdaterTest::testUpdateRssViewModeWithoutKnownPreviousMode in core/
modules/ views/ tests/ src/ Kernel/ ViewsConfigUpdaterTest.php  - Tests the `needsRssViewModeUpdate` method.
 - ViewsConfigUpdaterTest::testUpdateRssViewModeWithoutKnownPreviousModeOnSaveHandler in core/
modules/ views/ tests/ src/ Kernel/ ViewsConfigUpdaterTest.php  - Tests if onSave also updates the view.
 
File
- 
              core/
modules/ views/ tests/ src/ Kernel/ ViewsConfigUpdaterTest.php, line 166  
Class
Namespace
Drupal\Tests\views\KernelCode
protected function loadTestView($view_id) {
  // We just instantiate the test view from the raw configuration, as it may
  // not be possible to save it, due to its faulty schema.
  $config_dir = $this->getModulePath('views') . '/tests/fixtures/update';
  $file_storage = new FileStorage($config_dir);
  $values = $file_storage->read($view_id);
  /** @var \Drupal\views\ViewEntityInterface $test_view */
  $test_view = $this->container
    ->get('entity_type.manager')
    ->getStorage('view')
    ->create($values);
  return $test_view;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.