function FieldCounterTest::testExcludedTitleTokenDisplay

Same name in other branches
  1. 9 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 73

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->assertIdentical($actual_json, json_encode($expected));
}

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