function FieldCounterTest::setUp

Same name in other branches
  1. 8.9.x core/modules/rest/tests/src/Functional/Views/FieldCounterTest.php \Drupal\Tests\rest\Functional\Views\FieldCounterTest::setUp()
  2. 10 core/modules/rest/tests/src/Functional/Views/FieldCounterTest.php \Drupal\Tests\rest\Functional\Views\FieldCounterTest::setUp()
  3. 11.x core/modules/rest/tests/src/Functional/Views/FieldCounterTest.php \Drupal\Tests\rest\Functional\Views\FieldCounterTest::setUp()

Overrides ViewTestBase::setUp

File

core/modules/rest/tests/src/Functional/Views/FieldCounterTest.php, line 50

Class

FieldCounterTest
Tests the display of counter field.

Namespace

Drupal\Tests\rest\Functional\Views

Code

protected function setUp($import_test_views = TRUE, $modules = [
    'rest_test_views',
]) : void {
    parent::setUp($import_test_views, $modules);
    // Create some test content.
    for ($i = 1; $i <= 10; $i++) {
        Node::create([
            'type' => 'article',
            'title' => 'Article test ' . $i,
        ])->save();
    }
    $this->enableViewsTestModule();
    $this->view = Views::getView('test_field_counter_display');
    $this->view
        ->setDisplay('rest_export_1');
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.