function ViewsViewFieldStatusTest::testExistingPublishedVariableIsOverwritten

Tests that the preprocess implementation owns the is_published variable.

File

core/themes/default_admin/tests/src/Kernel/ViewsViewFieldStatusTest.php, line 258

Class

ViewsViewFieldStatusTest
Tests the publication status marker of views status fields.

Namespace

Drupal\Tests\default_admin\Kernel

Code

public function testExistingPublishedVariableIsOverwritten() : void {
  $variables = [
    'field' => $this->createStub(FieldPluginBase::class),
    'row' => new ResultRow(),
    'is_published' => TRUE,
  ];
  \Drupal::classResolver(PreprocessHooks::class)->preprocessViewsViewFieldStatus($variables);
  $this->assertArrayHasKey('is_published', $variables);
  $this->assertNull($variables['is_published']);
}

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