function FieldCounterTest::testExcludedTitleTokenDisplay

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

Tests the display of an excluded title field when used as a token.

File

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

Class

FieldCounterTest
Tests the display of counter field.

Namespace

Drupal\Tests\rest\Functional\Views

Code

public function testExcludedTitleTokenDisplay() {
    $actual_json = $this->drupalGet($this->view
        ->getPath(), [
        'query' => [
            '_format' => 'json',
        ],
    ]);
    $this->assertSession()
        ->statusCodeEquals(200);
    $expected = [
        [
            'counter' => '1',
        ],
        [
            'counter' => '2',
        ],
        [
            'counter' => '3',
        ],
        [
            'counter' => '4',
        ],
        [
            'counter' => '5',
        ],
        [
            'counter' => '6',
        ],
        [
            'counter' => '7',
        ],
        [
            'counter' => '8',
        ],
        [
            'counter' => '9',
        ],
        [
            'counter' => '10',
        ],
    ];
    $this->assertSame(json_encode($expected), $actual_json);
}

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