VocabularyValidationTest.php

Same filename and directory in other branches
  1. 11.x core/modules/taxonomy/tests/src/Kernel/VocabularyValidationTest.php
  2. 10 core/modules/taxonomy/tests/src/Kernel/VocabularyValidationTest.php

Namespace

Drupal\Tests\taxonomy\Kernel

File

core/modules/taxonomy/tests/src/Kernel/VocabularyValidationTest.php

View source
<?php

declare (strict_types=1);
namespace Drupal\Tests\taxonomy\Kernel;

use Drupal\KernelTests\Core\Config\ConfigEntityValidationTestBase;
use Drupal\taxonomy\Entity\Vocabulary;
use PHPUnit\Framework\Attributes\Group;
use PHPUnit\Framework\Attributes\RunTestsInSeparateProcesses;

/**
 * Tests validation of vocabulary entities.
 */
class VocabularyValidationTest extends ConfigEntityValidationTestBase {
  
  /**
   * {@inheritdoc}
   */
  protected static array $propertiesWithOptionalValues = [
    'description',
  ];
  
  /**
   * {@inheritdoc}
   */
  protected static $modules = [
    'taxonomy',
  ];
  
  /**
   * {@inheritdoc}
   */
  protected function setUp() : void {
    parent::setUp();
    $this->entity = Vocabulary::create([
      'vid' => 'test',
      'name' => 'Test',
    ]);
    $this->entity
      ->save();
  }

}

Classes

Title Deprecated Summary
VocabularyValidationTest Tests validation of vocabulary entities.

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