You are here

protected function DbtngExampleRepositoryTest::setUp in Examples for Developers 8

Same name and namespace in other branches
  1. 3.x modules/dbtng_example/tests/src/Kernel/DbtngExampleRepositoryTest.php \Drupal\Tests\dbtng_example\Kernel\DbtngExampleRepositoryTest::setUp()

Kernel tests do not invoke hook_schema() or hook_install(). Therefore we have to do it if our tests expect them to have been run.

Overrides KernelTestBase::setUp

File

dbtng_example/tests/src/Kernel/DbtngExampleRepositoryTest.php, line 37

Class

DbtngExampleRepositoryTest
Kernel testing of the DbtngExampleRepository service.

Namespace

Drupal\Tests\dbtng_example\Kernel

Code

protected function setUp() {
  parent::setUp();

  // Install the schema we defined in hook_schema().
  $this
    ->installSchema('dbtng_example', 'dbtng_example');

  // Inovke hook_install().
  $this->container
    ->get('module_handler')
    ->invoke('dbtng_example', 'install');
}