Yaffs site version 1.1
[yaffs-website] / web / modules / contrib / blazy / tests / src / Traits / BlazyKernelTestTrait.php
1 <?php
2
3 namespace Drupal\Tests\blazy\Traits;
4
5 /**
6  * A trait common for Kernel tests.
7  */
8 trait BlazyKernelTestTrait {
9
10   use BlazyUnitTestTrait;
11   use BlazyCreationTestTrait;
12
13   /**
14    * Setup common Kernel classes.
15    */
16   protected function setUpKernelInstall() {
17     $this->installConfig(static::$modules);
18
19     $this->installSchema('user', ['users_data']);
20     $this->installSchema('node', ['node_access']);
21     $this->installSchema('file', ['file_usage']);
22
23     $this->installEntitySchema('user');
24     $this->installEntitySchema('node');
25     $this->installEntitySchema('file');
26     $this->installEntitySchema('entity_test');
27   }
28
29   /**
30    * Setup common Kernel manager classes.
31    */
32   protected function setUpKernelManager() {
33     $this->entityManager          = $this->container->get('entity.manager');
34     $this->entityFieldManager     = $this->container->get('entity_field.manager');
35     $this->fieldTypePluginManager = $this->container->get('plugin.manager.field.field_type');
36     $this->formatterPluginManager = $this->container->get('plugin.manager.field.formatter');
37     $this->blazyManager           = $this->container->get('blazy.manager');
38     $this->blazyFormatterManager  = $this->container->get('blazy.formatter.manager');
39     $this->blazyAdminFormatter    = $this->container->get('blazy.admin.formatter');
40     $this->blazyAdmin             = $this->container->get('blazy.admin');
41     $this->blazyAdminExtended     = $this->container->get('blazy.admin.extended');
42
43     // Enable Responsive image support.
44     $this->blazyManager->getConfigFactory()->getEditable('blazy.settings')->set('responsive_image', TRUE)->save();
45   }
46
47 }