DerUpdate8202Test.php in Dynamic Entity Reference 8.2
File
tests/src/Functional/Update/DerUpdate8202Test.php
View source
<?php
namespace Drupal\Tests\dynamic_entity_reference\Functional\Update;
use Drupal\FunctionalTests\Update\UpdatePathTestBase;
class DerUpdate8202Test extends UpdatePathTestBase {
protected $installProfile = 'testing';
protected function setDatabaseDumpFiles() {
$this->databaseDumpFiles = [
__DIR__ . '/../../../fixtures/update/update_test_8202.php.gz',
];
}
public function testUpdate8202() {
$schema = \Drupal::database()
->schema();
$index_mapping = [
'entity_test__field_test' => 'field_test_target_id_int',
'entity_test_mul__field_test_mul' => 'field_test_mul_target_id_int',
];
foreach ($index_mapping as $table => $index_name) {
$this
->assertFalse($schema
->indexExists($table, $index_name));
}
$this
->runUpdates();
foreach ($index_mapping as $table => $index_name) {
$this
->assertTrue($schema
->indexExists($table, $index_name));
}
}
}