TaxonomyVocabularyHierarchyUpdateTest.php in Drupal 8
File
core/modules/taxonomy/tests/src/Functional/Update/TaxonomyVocabularyHierarchyUpdateTest.php
View source
<?php
namespace Drupal\Tests\taxonomy\Functional\Update;
use Drupal\FunctionalTests\Update\UpdatePathTestBase;
use Drupal\Tests\Core\Database\SchemaIntrospectionTestTrait;
class TaxonomyVocabularyHierarchyUpdateTest extends UpdatePathTestBase {
use SchemaIntrospectionTestTrait;
public function setDatabaseDumpFiles() {
$this->databaseDumpFiles = [
__DIR__ . '/../../../../../system/tests/fixtures/update/drupal-8-rc1.filled.standard.php.gz',
];
}
public function testTaxonomyUpdateParents() {
$hierarchy = \Drupal::config('taxonomy.vocabulary.test_vocabulary')
->get('hierarchy');
$this
->assertSame(1, $hierarchy);
$this
->runUpdates();
$hierarchy = \Drupal::config('taxonomy.vocabulary.test_vocabulary')
->get('hierarchy');
$this
->assertNull($hierarchy);
$this
->assertNoIndexOnColumns('taxonomy_term__parent', [
'bundle',
]);
$this
->assertIndexOnColumns('taxonomy_term__parent', [
'bundle',
'delta',
'parent_target_id',
]);
}
}