DblogNoLogsAvailableUpgradeTest.php 1.05 KB
Newer Older
1 2 3 4 5 6 7 8
<?php

namespace Drupal\Tests\dblog\Functional\Update;

use Drupal\FunctionalTests\Update\UpdatePathTestBase;
use Drupal\views\Views;

/**
9
 * Test the upgrade path of changing the empty text area for watchdog view.
10 11 12 13
 *
 * @see dblog_update_8600()
 *
 * @group Update
14
 * @group legacy
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
 */
class DblogNoLogsAvailableUpgradeTest extends UpdatePathTestBase {

  /**
   * {@inheritdoc}
   */
  protected function setDatabaseDumpFiles() {
    $this->databaseDumpFiles = [
      __DIR__ . '/../../../../../system/tests/fixtures/update/drupal-8.4.0.bare.standard.php.gz',
    ];
  }

  /**
   * Tests that no logs available text is now using a custom area.
   */
  public function testDblogUpgradePath() {

    $this->runUpdates();

    $view = Views::getView('watchdog');
    $data = $view->storage->toArray();
    $area = $data['display']['default']['display_options']['empty']['area'];

    $this->assertEqual('text_custom', $area['plugin_id']);
    $this->assertEqual('area_text_custom', $area['field']);
    $this->assertEqual('No log messages available.', $area['content']);
  }

}