Loading core/modules/block_content/tests/src/Functional/Views/FieldTypeTest.php→core/modules/block_content/tests/src/Kernel/Views/FieldTypeTest.php +75 −0 Original line number Diff line number Diff line <?php namespace Drupal\Tests\block_content\Functional\Views; namespace Drupal\Tests\block_content\Kernel\Views; use Drupal\block_content\Entity\BlockContent; use Drupal\block_content\Entity\BlockContentType; use Drupal\Tests\views\Kernel\ViewsKernelTestBase; use Drupal\views\Tests\ViewTestData; use Drupal\views\Views; /** Loading @@ -9,12 +13,15 @@ * * @group block_content */ class FieldTypeTest extends BlockContentTestBase { class FieldTypeTest extends ViewsKernelTestBase { /** * {@inheritdoc} */ protected $defaultTheme = 'stark'; protected static $modules = [ 'block_content', 'block_content_test_views', ]; /** * Views used by this test. Loading @@ -23,8 +30,34 @@ class FieldTypeTest extends BlockContentTestBase { */ public static $testViews = ['test_field_type']; public function testFieldType() { $block_content = $this->createBlockContent(); /** * {@inheritdoc} */ protected function setUp($import_test_views = TRUE): void { parent::setUp($import_test_views); if ($import_test_views) { ViewTestData::createTestViews(get_class($this), ['block_content_test_views']); } } /** * Tests the field type. */ public function testFieldType(): void { $this->installEntitySchema('block_content'); BlockContentType::create([ 'id' => 'basic', 'label' => 'basic', 'revision' => FALSE, ]); $block_content = BlockContent::create([ 'info' => $this->randomMachineName(), 'type' => 'basic', 'langcode' => 'en', ]); $block_content->save(); $expected_result[] = [ 'id' => $block_content->id(), 'type' => $block_content->bundle(), Loading Loading
core/modules/block_content/tests/src/Functional/Views/FieldTypeTest.php→core/modules/block_content/tests/src/Kernel/Views/FieldTypeTest.php +75 −0 Original line number Diff line number Diff line <?php namespace Drupal\Tests\block_content\Functional\Views; namespace Drupal\Tests\block_content\Kernel\Views; use Drupal\block_content\Entity\BlockContent; use Drupal\block_content\Entity\BlockContentType; use Drupal\Tests\views\Kernel\ViewsKernelTestBase; use Drupal\views\Tests\ViewTestData; use Drupal\views\Views; /** Loading @@ -9,12 +13,15 @@ * * @group block_content */ class FieldTypeTest extends BlockContentTestBase { class FieldTypeTest extends ViewsKernelTestBase { /** * {@inheritdoc} */ protected $defaultTheme = 'stark'; protected static $modules = [ 'block_content', 'block_content_test_views', ]; /** * Views used by this test. Loading @@ -23,8 +30,34 @@ class FieldTypeTest extends BlockContentTestBase { */ public static $testViews = ['test_field_type']; public function testFieldType() { $block_content = $this->createBlockContent(); /** * {@inheritdoc} */ protected function setUp($import_test_views = TRUE): void { parent::setUp($import_test_views); if ($import_test_views) { ViewTestData::createTestViews(get_class($this), ['block_content_test_views']); } } /** * Tests the field type. */ public function testFieldType(): void { $this->installEntitySchema('block_content'); BlockContentType::create([ 'id' => 'basic', 'label' => 'basic', 'revision' => FALSE, ]); $block_content = BlockContent::create([ 'info' => $this->randomMachineName(), 'type' => 'basic', 'langcode' => 'en', ]); $block_content->save(); $expected_result[] = [ 'id' => $block_content->id(), 'type' => $block_content->bundle(), Loading