Issue #2578251 by marthinal, eporama, John Cook, Adita, joe_carvajal, luismagr, Shreya Shetty, Dinesh18, alexpott, Cottser: No results text appears twice
parent
148b87f5cf
commit
4284388ba6
|
@ -51,8 +51,11 @@
|
|||
{{ exposed }}
|
||||
{{ attachment_before }}
|
||||
|
||||
{% if rows -%}
|
||||
{{ rows }}
|
||||
{% elseif empty -%}
|
||||
{{ empty }}
|
||||
{% endif %}
|
||||
{{ pager }}
|
||||
|
||||
{{ attachment_after }}
|
||||
|
|
|
@ -0,0 +1,43 @@
|
|||
<?php
|
||||
|
||||
namespace Drupal\Tests\views\Functional;
|
||||
|
||||
/**
|
||||
* Tests no results behavior.
|
||||
*
|
||||
* @group views
|
||||
*/
|
||||
class ViewsNoResultsBehaviorTest extends ViewTestBase {
|
||||
|
||||
/**
|
||||
* Modules to enable.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
public static $modules = ['node', 'user'];
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected function setUp($import_test_views = TRUE) {
|
||||
parent::setUp();
|
||||
$this->enableViewsTestModule();
|
||||
$user = $this->createUser([], NULL, TRUE);
|
||||
$this->drupalLogin($user);
|
||||
|
||||
// Set the Stark theme and use the default templates from views module.
|
||||
/** @var \Drupal\Core\Extension\ThemeHandlerInterface $theme_handler */
|
||||
$theme_handler = \Drupal::service('theme_handler');
|
||||
$theme_handler->install(['stark']);
|
||||
$this->config('system.theme')->set('default', 'stark')->save();
|
||||
}
|
||||
|
||||
/**
|
||||
* Tests the view with the text.
|
||||
*/
|
||||
public function testDuplicateText() {
|
||||
$output = $this->drupalGet('admin/content');
|
||||
$this->assertEqual(1, substr_count($output, 'No content available.'), 'Only one message should be present');
|
||||
}
|
||||
|
||||
}
|
|
@ -49,8 +49,11 @@
|
|||
{{ exposed }}
|
||||
{{ attachment_before }}
|
||||
|
||||
{% if rows -%}
|
||||
{{ rows }}
|
||||
{% elseif empty -%}
|
||||
{{ empty }}
|
||||
{% endif %}
|
||||
{{ pager }}
|
||||
|
||||
{{ attachment_after }}
|
||||
|
|
Loading…
Reference in New Issue