You are here

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

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

Overrides BrowserTestBase::setUp

File

tests/src/Functional/DrushCommandsTest.php, line 37

Class

DrushCommandsTest
@coversDefaultClass \Drupal\views_bulk_operations\Commands\ViewsBulkOperationsCommands @group views_bulk_operations

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 < self::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' => $i % 2 ? TRUE : FALSE,
      'created' => $time,
      'changed' => $time,
    ]);
  }
}