function ViewsModerationStateFilterTest::loadViewUnchanged

Same name and namespace in other branches
  1. 8.9.x core/modules/content_moderation/tests/src/Functional/ViewsModerationStateFilterTest.php \Drupal\Tests\content_moderation\Functional\ViewsModerationStateFilterTest::loadViewUnchanged()
  2. 10 core/modules/content_moderation/tests/src/Functional/ViewsModerationStateFilterTest.php \Drupal\Tests\content_moderation\Functional\ViewsModerationStateFilterTest::loadViewUnchanged()
  3. 11.x core/modules/content_moderation/tests/src/Functional/ViewsModerationStateFilterTest.php \Drupal\Tests\content_moderation\Functional\ViewsModerationStateFilterTest::loadViewUnchanged()

Load a view from the database after it has been modified in a sub-request.

Parameters

string $view_id: The view ID.

Return value

\Drupal\views\ViewEntityInterface A loaded view, bypassing static caches.

2 calls to ViewsModerationStateFilterTest::loadViewUnchanged()
ViewsModerationStateFilterTest::testModerationStateFilterDependencyHandling in core/modules/content_moderation/tests/src/Functional/ViewsModerationStateFilterTest.php
Tests the dependency handling of the moderation state filter.
ViewsModerationStateFilterTest::testWorkflowChanges in core/modules/content_moderation/tests/src/Functional/ViewsModerationStateFilterTest.php
Tests the moderation state filter when the configured workflow is changed.

File

core/modules/content_moderation/tests/src/Functional/ViewsModerationStateFilterTest.php, line 160

Class

ViewsModerationStateFilterTest
Tests the views 'moderation_state_filter' filter plugin.

Namespace

Drupal\Tests\content_moderation\Functional

Code

public function loadViewUnchanged($view_id) {
    $this->container
        ->get('cache.config')
        ->deleteAll();
    $this->container
        ->get('config.factory')
        ->reset();
    return $this->container
        ->get('entity_type.manager')
        ->getStorage('view')
        ->loadUnchanged($view_id);
}

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