You are here

protected function ViewsBulkOperationsFunctionalTestBase::setUp in Views Bulk Operations (VBO) 4.0.x

Same name and namespace in other branches
  1. 8.3 tests/src/Functional/ViewsBulkOperationsFunctionalTestBase.php \Drupal\Tests\views_bulk_operations\Functional\ViewsBulkOperationsFunctionalTestBase::setUp()

Overrides BrowserTestBase::setUp

File

tests/src/Functional/ViewsBulkOperationsFunctionalTestBase.php, line 35

Class

ViewsBulkOperationsFunctionalTestBase
Base class for VBO browser tests.

Namespace

Drupal\Tests\views_bulk_operations\Functional

Code

protected function setUp() {
  parent::setUp();

  // Create some nodes for testing.
  $this
    ->drupalCreateContentType([
    'type' => 'page',
  ]);
  $this->testNodes = [];
  $time = $this->container
    ->get('datetime.time')
    ->getRequestTime();
  for ($i = 0; $i < static::TEST_NODE_COUNT; $i++) {

    // Ensure nodes are sorted in the same order they are inserted in the
    // array.
    $time -= $i;
    $this->testNodes[] = $this
      ->drupalCreateNode([
      'type' => 'page',
      'title' => 'Title ' . $i,
      'sticky' => FALSE,
      'created' => $time,
      'changed' => $time,
    ]);
  }
}