function FieldPluginBaseTest::testRenderNoResult
Same name in other branches
- 8.9.x core/modules/views/tests/src/Unit/Plugin/field/FieldPluginBaseTest.php \Drupal\Tests\views\Unit\Plugin\field\FieldPluginBaseTest::testRenderNoResult()
- 10 core/modules/views/tests/src/Unit/Plugin/field/FieldPluginBaseTest.php \Drupal\Tests\views\Unit\Plugin\field\FieldPluginBaseTest::testRenderNoResult()
- 11.x core/modules/views/tests/src/Unit/Plugin/field/FieldPluginBaseTest.php \Drupal\Tests\views\Unit\Plugin\field\FieldPluginBaseTest::testRenderNoResult()
Tests the "No results text" rendering.
@covers ::renderText
File
-
core/
modules/ views/ tests/ src/ Unit/ Plugin/ field/ FieldPluginBaseTest.php, line 303
Class
- FieldPluginBaseTest
- @coversDefaultClass \Drupal\views\Plugin\views\field\FieldPluginBase @group views
Namespace
Drupal\Tests\views\Unit\Plugin\fieldCode
public function testRenderNoResult() {
$this->setupDisplayWithEmptyArgumentsAndFields();
$field = $this->setupTestField([
'empty' => 'This <strong>should work</strong>.',
]);
$field->field_alias = 'key';
$row = new ResultRow([
'key' => '',
]);
$expected_result = 'This <strong>should work</strong>.';
$result = $field->advancedRender($row);
$this->assertEquals($expected_result, $result);
$this->assertInstanceOf('\\Drupal\\views\\Render\\ViewsRenderPipelineMarkup', $result);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.