class ViewsSortIdentifiersUpdateTest
Tests the views_post_update_sort_identifier() post update.
@group views @group legacy
Hierarchy
- class \Drupal\Tests\BrowserTestBase uses \Drupal\Core\Test\FunctionalTestSetupTrait, \Drupal\Tests\UiHelperTrait, \Drupal\Core\Test\TestSetupTrait, \Drupal\Tests\block\Traits\BlockCreationTrait, \Drupal\FunctionalTests\AssertLegacyTrait, \Drupal\Tests\RandomGeneratorTrait, \Drupal\Tests\node\Traits\NodeCreationTrait, \Drupal\Tests\node\Traits\ContentTypeCreationTrait, \Drupal\Tests\ConfigTestTrait, \Drupal\Tests\TestRequirementsTrait, \Drupal\Tests\user\Traits\UserCreationTrait, \Drupal\Tests\XdebugRequestTrait, \Drupal\Tests\Traits\PhpUnitWarnings, \Drupal\Tests\PhpUnitCompatibilityTrait, \Symfony\Bridge\PhpUnit\ExpectDeprecationTrait, \Drupal\Tests\ExtensionListTestTrait implements \PHPUnit\Framework\TestCase
- class \Drupal\FunctionalTests\Update\UpdatePathTestBase uses \Drupal\Tests\UpdatePathTestTrait implements \Drupal\Tests\BrowserTestBase
- class \Drupal\Tests\views\Functional\Update\ViewsSortIdentifiersUpdateTest implements \Drupal\FunctionalTests\Update\UpdatePathTestBase
- class \Drupal\FunctionalTests\Update\UpdatePathTestBase uses \Drupal\Tests\UpdatePathTestTrait implements \Drupal\Tests\BrowserTestBase
Expanded class hierarchy of ViewsSortIdentifiersUpdateTest
File
-
core/
modules/ views/ tests/ src/ Functional/ Update/ ViewsSortIdentifiersUpdateTest.php, line 13
Namespace
Drupal\Tests\views\Functional\UpdateView source
class ViewsSortIdentifiersUpdateTest extends UpdatePathTestBase {
/**
* {@inheritdoc}
*/
protected function setDatabaseDumpFiles() {
$this->databaseDumpFiles = [
__DIR__ . '/../../../../../system/tests/fixtures/update/drupal-8.8.0.bare.standard.php.gz',
];
}
/**
* Tests views_post_update_sort_identifier().
*
* @see views_post_update_sort_identifier()
*/
public function testSortIdentifierPostUpdate() : void {
$config_factory = \Drupal::configFactory();
$view = $config_factory->get('views.view.comments_recent');
$trail = 'display.default.display_options.sorts.created';
$this->assertArrayNotHasKey('field_identifier', $view->get("{$trail}.expose"));
$this->runUpdates();
$view = $config_factory->get('views.view.comments_recent');
$sort_handler = $view->get($trail);
$this->assertSame($sort_handler['id'], $sort_handler['expose']['field_identifier']);
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.