X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=web%2Fcore%2Fmodules%2Fviews%2Ftests%2Fsrc%2FKernel%2FViewsKernelTestBase.php;fp=web%2Fcore%2Fmodules%2Fviews%2Ftests%2Fsrc%2FKernel%2FViewsKernelTestBase.php;h=be9920eb31db5909710adbc6879ad41eddf3b938;hp=4bbe4028637d54beefc00554e16321c99677cd73;hb=0bf8d09d2542548982e81a441b1f16e75873a04f;hpb=74df008bdbb3a11eeea356744f39b802369bda3c diff --git a/web/core/modules/views/tests/src/Kernel/ViewsKernelTestBase.php b/web/core/modules/views/tests/src/Kernel/ViewsKernelTestBase.php index 4bbe40286..be9920eb3 100644 --- a/web/core/modules/views/tests/src/Kernel/ViewsKernelTestBase.php +++ b/web/core/modules/views/tests/src/Kernel/ViewsKernelTestBase.php @@ -7,6 +7,7 @@ use Drupal\Core\Database\Query\SelectInterface; use Drupal\KernelTests\KernelTestBase; use Drupal\views\Tests\ViewResultAssertionTrait; use Drupal\views\Tests\ViewTestData; +use Drupal\views\ViewsData; /** * Defines a base class for Views kernel testing. @@ -48,6 +49,7 @@ abstract class ViewsKernelTestBase extends KernelTestBase { ViewTestData::createTestViews(get_class($this), ['views_test_config']); } } + /** * Sets up the configuration and schema of views and views_test_data modules. * @@ -64,6 +66,7 @@ abstract class ViewsKernelTestBase extends KernelTestBase { // Define the schema and views data variable before enabling the test module. $state->set('views_test_data_schema', $this->schemaDefinition()); $state->set('views_test_data_views_data', $this->viewsData()); + $this->container->get('views.views_data')->clear(); $this->installConfig(['views', 'views_test_config', 'views_test_data']); foreach ($this->schemaDefinition() as $table => $schema) {