Skip to content
Snippets Groups Projects
Unverified Commit 45664030 authored by Alex Pott's avatar Alex Pott
Browse files

Issue #3170246 by paulocs, longwave: NodeLoadMultipleTest.php should be a kernel test

parent 6e6ad992
Branches
Tags
8 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!1012Issue #3226887: Hreflang on non-canonical content pages,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10,!596Issue #3046532: deleting an entity reference field, used in a contextual view, makes the whole site unrecoverable,!496Issue #2463967: Use .user.ini file for PHP settings,!144Issue #2666286: Clean up menu_ui to conform to Drupal coding standards,!16Draft: Resolve #2081585 "History storage",!13Resolve #2903456
<?php
namespace Drupal\Tests\node\Functional;
namespace Drupal\Tests\node\Kernel;
use Drupal\node\Entity\Node;
......@@ -9,27 +9,20 @@
*
* @group node
*/
class NodeLoadMultipleTest extends NodeTestBase {
class NodeLoadMultipleTest extends NodeAccessTestBase {
/**
* Enable Views to test the frontpage against Node::loadMultiple() results.
*
* @var array
* {@inheritdoc}
*/
protected static $modules = ['views'];
protected static $modules = ['node', 'user'];
/**
* {@inheritdoc}
*/
protected $defaultTheme = 'stark';
protected function setUp(): void {
parent::setUp();
$web_user = $this->drupalCreateUser([
'create article content',
'create page content',
]);
$this->drupalLogin($web_user);
$this->installEntitySchema('node');
}
/**
......@@ -41,12 +34,6 @@ public function testNodeMultipleLoad() {
$node3 = $this->drupalCreateNode(['type' => 'article', 'promote' => 0]);
$node4 = $this->drupalCreateNode(['type' => 'page', 'promote' => 0]);
// Confirm that promoted nodes appear in the default node listing.
$this->drupalGet('node');
$this->assertText($node1->label(), 'Node title appears on the default listing.');
$this->assertText($node2->label(), 'Node title appears on the default listing.');
$this->assertNoText($node3->label(), 'Node title does not appear in the default listing.');
$this->assertNoText($node4->label(), 'Node title does not appear in the default listing.');
// Load nodes with only a condition. Nodes 3 and 4 will be loaded.
$nodes = $this->container->get('entity_type.manager')->getStorage('node')
->loadByProperties(['promote' => 0]);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment