diff --git a/core/modules/node/tests/src/Functional/Views/FilterUidRevisionTest.php b/core/modules/node/tests/src/Kernel/Views/FilterUidRevisionTest.php similarity index 50% rename from core/modules/node/tests/src/Functional/Views/FilterUidRevisionTest.php rename to core/modules/node/tests/src/Kernel/Views/FilterUidRevisionTest.php index 2b3f3b30e798..84dfbacb7d4d 100644 --- a/core/modules/node/tests/src/Functional/Views/FilterUidRevisionTest.php +++ b/core/modules/node/tests/src/Kernel/Views/FilterUidRevisionTest.php @@ -1,7 +1,12 @@ drupalCreateUser(); - $no_author = $this->drupalCreateUser(); + $this->installEntitySchema('user'); + $this->installEntitySchema('node'); + $this->installEntitySchema('view'); + $this->installSchema('system', ['sequences']); + $this->installSchema('node', ['node_access']); + $this->installConfig(['filter']); + ViewTestData::createTestViews(static::class, ['node_test_views']); + + $author = $this->createUser(); + $no_author = $this->createUser(); $expected_result = []; // Create one node, with the author as the node author. - $node = $this->drupalCreateNode(['uid' => $author->id()]); + $node = $this->createNode(['uid' => $author->id()]); $expected_result[] = ['nid' => $node->id()]; // Create one node of which an additional revision author will be the // author. - $node = $this->drupalCreateNode(['revision_uid' => $no_author->id()]); + $node = $this->createNode(['revision_uid' => $no_author->id()]); $expected_result[] = ['nid' => $node->id()]; $revision = clone $node; // Force to add a new revision. @@ -41,13 +70,13 @@ class FilterUidRevisionTest extends NodeTestBase { // Create one node on which the author has neither authorship of revisions // or the main node. - $this->drupalCreateNode(['uid' => $no_author->id()]); + $this->createNode(['uid' => $no_author->id()]); $view = Views::getView('test_filter_node_uid_revision'); $view->initHandlers(); $view->filter['uid_revision']->value = [$author->id()]; - $this->executeView($view); + $view->preview(); $this->assertIdenticalResultset($view, $expected_result, ['nid' => 'nid'], 'Make sure that the view only returns nodes which match either the node or the revision author.'); }