diff --git a/core/modules/views/tests/src/Functional/Entity/LatestTranslationAffectedRevisionTest.php b/core/modules/views/tests/src/Kernel/Entity/LatestTranslationAffectedRevisionTest.php similarity index 76% rename from core/modules/views/tests/src/Functional/Entity/LatestTranslationAffectedRevisionTest.php rename to core/modules/views/tests/src/Kernel/Entity/LatestTranslationAffectedRevisionTest.php index d77b770c29f6282abda2818a4ee8a0d3d1c7628e..787a0d8d156e7aee59f226433caea13bbaeabbb9 100644 --- a/core/modules/views/tests/src/Functional/Entity/LatestTranslationAffectedRevisionTest.php +++ b/core/modules/views/tests/src/Kernel/Entity/LatestTranslationAffectedRevisionTest.php @@ -1,10 +1,11 @@ <?php -namespace Drupal\Tests\views\Functional\Entity; +namespace Drupal\Tests\views\Kernel\Entity; use Drupal\language\Entity\ConfigurableLanguage; use Drupal\node\Entity\Node; -use Drupal\Tests\views\Functional\ViewTestBase; +use Drupal\node\Entity\NodeType; +use Drupal\Tests\views\Kernel\ViewsKernelTestBase; use Drupal\views\Views; /** @@ -12,19 +13,15 @@ * * @group views */ -class LatestTranslationAffectedRevisionTest extends ViewTestBase { +class LatestTranslationAffectedRevisionTest extends ViewsKernelTestBase { /** - * Views used by this test. - * - * @var array + * {@inheritdoc} */ public static $testViews = ['test_latest_translation_affected_revision_filter']; /** - * Modules to enable. - * - * @var array + * {@inheritdoc} */ public static $modules = [ 'node', @@ -33,20 +30,16 @@ class LatestTranslationAffectedRevisionTest extends ViewTestBase { 'content_translation', ]; - /** - * {@inheritdoc} - */ - protected function setUp($import_test_views = TRUE) { - parent::setUp(); - - ConfigurableLanguage::createFromLangcode('fr')->save(); - $this->drupalCreateContentType(['type' => 'article']); - } - /** * Tests the 'Latest revision' filter. */ public function testLatestRevisionFilter() { + $this->installEntitySchema('user'); + $this->installEntitySchema('node'); + $this->installSchema('node', ['node_access']); + + ConfigurableLanguage::createFromLangcode('fr')->save(); + NodeType::create(['type' => 'article'])->save(); $node = Node::create([ 'title' => 'Original translation - default revision', 'type' => 'test', @@ -57,12 +50,14 @@ public function testLatestRevisionFilter() { $translated->title = 'French translation - default revision'; $translated->save(); + /** @var \Drupal\node\NodeInterface $pending */ $pending = clone $node; $pending->setNewRevision(TRUE); $pending->isDefaultRevision(FALSE); $pending->title = 'Original translation - pending revision'; $pending->save(); + /** @var \Drupal\node\NodeInterface $pending_translated */ $pending_translated = clone $translated; $pending_translated->setNewRevision(TRUE); $pending_translated->isDefaultRevision(FALSE);