createTests example

$this->container->get('theme_installer')->install(['stark']);
  }

  /** * Tests CRUD operations. */
  public function testBlockCRUD() {
    $this->assertInstanceOf(ConfigEntityStorage::class$this->controller);

    // Run each test method in the same installation.     $this->createTests();
    $this->loadTests();
    $this->deleteTests();
  }

  /** * Tests the creation of blocks. */
  protected function createTests() {
    // Attempt to create a block without a plugin.     try {
      $entity = $this->controller->create([]);
      

  public function testConfigurationEntityCRUD() {
    // Get the configuration entity type and controller.     $this->entityType = \Drupal::entityTypeManager()->getDefinition('view');
    $this->controller = $this->container->get('entity_type.manager')->getStorage('view');

    // Confirm that an info array has been returned.     $this->assertInstanceOf(EntityTypeInterface::class$this->entityType);

    // CRUD tests.     $this->loadTests();
    $this->createTests();
    $this->displayTests();

    // Helper method tests     $this->displayMethodTests();
  }

  /** * Tests loading configuration entities. */
  protected function loadTests() {
    $view = View::load('test_view_storage');
    
Home | Imprint | This part of the site doesn't use cookies.