protected function RowRenderCacheTest::setUpFixtures in Drupal 10        
                          
                  
                        Same name and namespace in other branches
- 8 core/modules/views/tests/src/Kernel/Plugin/RowRenderCacheTest.php \Drupal\Tests\views\Kernel\Plugin\RowRenderCacheTest::setUpFixtures()
 - 9 core/modules/views/tests/src/Kernel/Plugin/RowRenderCacheTest.php \Drupal\Tests\views\Kernel\Plugin\RowRenderCacheTest::setUpFixtures()
 
 
File
 
   - core/modules/views/tests/src/Kernel/Plugin/RowRenderCacheTest.php, line 60
 
  
  Class
  
  - RowRenderCacheTest 
 
  - Tests row render caching.
 
  Namespace
  Drupal\Tests\views\Kernel\Plugin
Code
protected function setUpFixtures() {
  parent::setUpFixtures();
  $this
    ->installEntitySchema('user');
  $this
    ->installEntitySchema('node');
  $this
    ->installSchema('node', 'node_access');
  $type = NodeType::create([
    'type' => 'test',
  ]);
  $type
    ->save();
  $this->editorUser = $this
    ->createUser([
    'bypass node access',
  ]);
  $this->powerUser = $this
    ->createUser([
    'access content',
    'create test content',
    'edit own test content',
    'delete own test content',
  ]);
  $this->regularUser = $this
    ->createUser([
    'access content',
  ]);
  
  for ($i = 0; $i < 5; $i++) {
    Node::create([
      'title' => 'b' . $i . $this
        ->randomMachineName(),
      'type' => 'test',
    ])
      ->save();
  }
  
  Node::create([
    'title' => 'z' . $this
      ->randomMachineName(),
    'uid' => $this->powerUser
      ->id(),
    'type' => 'test',
  ])
    ->save();
}