Skip to content
Snippets Groups Projects
Unverified Commit 9e5e613d authored by Alex Pott's avatar Alex Pott
Browse files

Issue #3041727 by Manuel Garcia, claudiu.cristea, amateescu: Convert...

Issue #3041727 by Manuel Garcia, claudiu.cristea, amateescu: Convert ViewRenderTest into a Kernel test
parent 48522ffe
No related branches found
No related tags found
Loading
<?php
namespace Drupal\Tests\views\Functional;
namespace Drupal\Tests\views\Kernel;
use Drupal\views\Views;
......@@ -9,33 +9,26 @@
*
* @group views
*/
class ViewRenderTest extends ViewTestBase {
class ViewRenderTest extends ViewsKernelTestBase {
/**
* Views used by this test.
*
* @var array
* {@inheritdoc}
*/
public static $testViews = ['test_view_render'];
protected function setUp($import_test_views = TRUE) {
parent::setUp($import_test_views);
$this->enableViewsTestModule();
}
/**
* Tests render functionality.
*/
public function testRender() {
\Drupal::state()->set('views_render.test', 0);
$state = $this->container->get('state');
$state->set('views_render.test', 0);
// Make sure that the rendering just calls the preprocess function once.
$view = Views::getView('test_view_render');
$output = $view->preview();
$this->container->get('renderer')->renderRoot($output);
$this->assertEqual(\Drupal::state()->get('views_render.test'), 1);
$this->assertEquals(1, $state->get('views_render.test'));
}
}
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