TourTipDeprecatedConfigUpdateTest.php in Drupal 9
File
core/modules/tour/tests/src/Functional/Update/TourTipDeprecatedConfigUpdateTest.php
View source
<?php
namespace Drupal\Tests\tour\Functional\Update;
use Drupal\FunctionalTests\Update\UpdatePathTestBase;
class TourTipDeprecatedConfigUpdateTest extends UpdatePathTestBase {
protected function setDatabaseDumpFiles() {
$this->databaseDumpFiles = [
__DIR__ . '/../../../../../system/tests/fixtures/update/drupal-9.0.0.bare.standard.php.gz',
];
}
public function testUpdate() {
$legacy_tour_config = $this->container
->get('config.factory')
->get('tour.tour.views-ui');
$tips = $legacy_tour_config
->get('tips');
$this
->assertFalse(isset($tips['views-ui-view-admin']['selector']));
$this
->assertEquals('views-display-extra-actions', $tips['views-ui-view-admin']['attributes']['data-id']);
$this
->assertEquals('views-ui-display-tab-bucket.format', $tips['views-ui-format']['attributes']['data-class']);
$this
->assertSame('left', $tips['views-ui-view-admin']['location']);
$this
->assertArrayNotHasKey('position', $tips['views-ui-view-admin']);
$this
->runUpdates();
$updated_legacy_tour_config = $this->container
->get('config.factory')
->get('tour.tour.views-ui');
$updated_tips = $updated_legacy_tour_config
->get('tips');
$this
->assertSame('#views-display-extra-actions', $updated_tips['views-ui-view-admin']['selector']);
$this
->assertSame('.views-ui-display-tab-bucket.format', $updated_tips['views-ui-format']['selector']);
$this
->assertArrayNotHasKey('attributes', $updated_tips['views-ui-view-admin']);
$this
->assertSame('left-start', $updated_tips['views-ui-view-admin']['position']);
$this
->assertArrayNotHasKey('location', $updated_tips['views-ui-view-admin']);
}
}