Skip to content
Snippets Groups Projects
Commit 8c65ad99 authored by Tim Rohaly's avatar Tim Rohaly
Browse files

Issue #3478389 by tr: Add declare(strict_types=1) to all tests

parent 74bbedd1
No related branches found
No related tags found
1 merge request!11Issue #3478389 by tr: Add declare(strict_types=1) to all tests
Pipeline #299636 canceled
<?php
declare(strict_types=1);
namespace Drupal\Tests\views_aggregator\Functional\Plugin;
use Drupal\Tests\views\Functional\ViewTestBase;
......
<?php
declare(strict_types=1);
namespace Drupal\Tests\views_aggregator\Functional\Plugin;
use Drupal\Tests\views\Functional\ViewTestBase;
......
<?php
declare(strict_types=1);
namespace Drupal\Tests\views_aggregator\Kernel\Plugin;
use Drupal\Tests\views\Kernel\Plugin\PluginKernelTestBase;
......@@ -145,7 +147,11 @@ class ViewsAggregatorStyleTableUnitTest extends PluginKernelTestBase {
$view->field['name']->options['exclude'] = TRUE;
$output = $view->preview();
$output = \Drupal::service('renderer')->renderRoot($output);
$this->assertFalse(strpos($output, 'views-field-name') !== FALSE, "Excluded field's wrapper was not rendered.");
$this->assertStringNotContainsString(
'views-field-name',
(string) $output,
"Excluded field's wrapper was not rendered."
);
$view->destroy();
// Render a non empty result, and ensure that the empty area handler is not
......@@ -154,7 +160,11 @@ class ViewsAggregatorStyleTableUnitTest extends PluginKernelTestBase {
$output = $view->preview();
$output = \Drupal::service('renderer')->renderRoot($output);
$this->assertFalse(strpos($output, 'custom text') !== FALSE, 'Empty handler was not rendered on a non empty table.');
$this->assertStringNotContainsString(
'custom text',
(string) $output,
'Empty handler was not rendered on a non empty table.'
);
// Render an empty result, and ensure that the area handler is rendered.
$view->setDisplay('default');
......@@ -163,7 +173,11 @@ class ViewsAggregatorStyleTableUnitTest extends PluginKernelTestBase {
$output = $view->preview();
$output = \Drupal::service('renderer')->renderRoot($output);
$this->assertTrue(strpos($output, 'custom text') !== FALSE, 'Empty handler got rendered on an empty table.');
$this->assertStringContainsString(
'custom text',
(string) $output,
'Empty handler got rendered on an empty table.'
);
}
/**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment