Unverified Commit b58a924a authored by alexpott's avatar alexpott

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

(cherry picked from commit 45664030)
parent 6ef840b8
<?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]);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment