function EntityBundleConditionTest::setUp

Same name and namespace in other branches
  1. 9 core/tests/Drupal/KernelTests/Core/Entity/EntityBundleConditionTest.php \Drupal\KernelTests\Core\Entity\EntityBundleConditionTest::setUp()
  2. 10 core/tests/Drupal/KernelTests/Core/Entity/EntityBundleConditionTest.php \Drupal\KernelTests\Core\Entity\EntityBundleConditionTest::setUp()

Overrides EntityKernelTestBase::setUp

File

core/tests/Drupal/KernelTests/Core/Entity/EntityBundleConditionTest.php, line 20

Class

EntityBundleConditionTest
Tests that entity bundle conditions works properly.

Namespace

Drupal\KernelTests\Core\Entity

Code

protected function setUp() : void {
    parent::setUp();
    $this->installEntitySchema('entity_test_with_bundle');
    // Create the entity bundles required for testing.
    $bundle = EntityTestBundle::create([
        'id' => 'page',
        'label' => 'page',
    ]);
    $bundle->save();
    $bundle = EntityTestBundle::create([
        'id' => 'article',
        'label' => 'article',
    ]);
    $bundle->save();
    $bundle = EntityTestBundle::create([
        'id' => 'test',
        'label' => 'test',
    ]);
    $bundle->save();
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.