Issue #3041755 by Hardik_Patel_12, claudiu.cristea, Lendude, Spokje, smustgrave, amateescu, alexpott, longwave: Convert HandlerAllTest into a kernel test
parent
ae750411d1
commit
eb2baa20ef
|
@ -1,9 +1,12 @@
|
|||
<?php
|
||||
|
||||
namespace Drupal\Tests\views\Functional\Handler;
|
||||
namespace Drupal\Tests\views\Kernel\Handler;
|
||||
|
||||
use Drupal\comment\Entity\CommentType;
|
||||
use Drupal\comment\Tests\CommentTestTrait;
|
||||
use Drupal\Tests\views\Functional\ViewTestBase;
|
||||
use Drupal\field\Entity\FieldStorageConfig;
|
||||
use Drupal\node\Entity\NodeType;
|
||||
use Drupal\Tests\views\Kernel\ViewsKernelTestBase;
|
||||
use Drupal\views\Plugin\views\filter\NumericFilter;
|
||||
use Drupal\views\ViewExecutable;
|
||||
use Drupal\views\Plugin\views\HandlerBase;
|
||||
|
@ -15,28 +18,34 @@ use Drupal\views\Entity\View;
|
|||
*
|
||||
* @group views
|
||||
*/
|
||||
class HandlerAllTest extends ViewTestBase {
|
||||
class HandlerAllTest extends ViewsKernelTestBase {
|
||||
|
||||
use CommentTestTrait;
|
||||
|
||||
/**
|
||||
* Modules to enable.
|
||||
*
|
||||
* @var array
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected static $modules = [
|
||||
'block',
|
||||
'comment',
|
||||
'contact',
|
||||
'dblog',
|
||||
'field',
|
||||
'filter',
|
||||
'file',
|
||||
'forum',
|
||||
'history',
|
||||
'image',
|
||||
'language',
|
||||
'locale',
|
||||
'media',
|
||||
'node',
|
||||
'search',
|
||||
'system',
|
||||
'options',
|
||||
'taxonomy',
|
||||
'text',
|
||||
'tracker',
|
||||
'user',
|
||||
];
|
||||
|
||||
|
@ -48,8 +57,26 @@ class HandlerAllTest extends ViewTestBase {
|
|||
/**
|
||||
* Tests most of the handlers.
|
||||
*/
|
||||
public function testHandlers() {
|
||||
$this->drupalCreateContentType(['type' => 'article']);
|
||||
public function testHandlers(): void {
|
||||
$this->installEntitySchema('comment');
|
||||
$this->installEntitySchema('file');
|
||||
$this->installEntitySchema('media');
|
||||
$this->installEntitySchema('node');
|
||||
$this->installEntitySchema('taxonomy_term');
|
||||
$this->installEntitySchema('user');
|
||||
$this->installSchema('file', ['file_usage']);
|
||||
$this->installSchema('forum', ['forum_index']);
|
||||
$this->installSchema('dblog', ['watchdog']);
|
||||
$this->installSchema('tracker', ['tracker_user']);
|
||||
// Create the comment body field storage.
|
||||
FieldStorageConfig::create([
|
||||
'type' => 'text_long',
|
||||
'entity_type' => 'comment',
|
||||
'field_name' => 'comment_body',
|
||||
])->save();
|
||||
|
||||
NodeType::create(['type' => 'article', 'name' => 'Article'])->save();
|
||||
CommentType::create(['id' => 'comment', 'label' => 'Default comment', 'target_entity_type_id' => 'node'])->save();
|
||||
$this->addDefaultCommentField('node', 'article');
|
||||
|
||||
$object_types = array_keys(ViewExecutable::getHandlerTypes());
|
||||
|
@ -58,8 +85,8 @@ class HandlerAllTest extends ViewTestBase {
|
|||
continue;
|
||||
}
|
||||
|
||||
$view = View::create(['base_table' => $base_table]);
|
||||
$view = $view->getExecutable();
|
||||
$view_config = View::create(['base_table' => $base_table]);
|
||||
$view = $view_config->getExecutable();
|
||||
|
||||
// @todo The groupwise relationship is currently broken.
|
||||
$exclude[] = 'taxonomy_term_field_data:tid_representative';
|
Loading…
Reference in New Issue