Commit 4fb5cf25 authored by catch's avatar catch
Browse files

Issue #3269267 by danflanagan8, dww: dblog tests should not rely on Classy

(cherry picked from commit f67f0cb2)
parent 39865b51
Loading
Loading
Loading
Loading
+10 −4
Original line number Diff line number Diff line
@@ -11,6 +11,7 @@
use Drupal\dblog\Controller\DbLogController;
use Drupal\error_test\Controller\ErrorTestController;
use Drupal\Tests\BrowserTestBase;
use Drupal\Tests\system\Functional\Menu\AssertBreadcrumbTrait;

/**
 * Generate events and verify dblog entries; verify user access to log reports
@@ -20,6 +21,7 @@
 */
class DbLogTest extends BrowserTestBase {
  use FakeLogEntries;
  use AssertBreadcrumbTrait;

  /**
   * Modules to enable.
@@ -38,7 +40,7 @@ class DbLogTest extends BrowserTestBase {
  /**
   * {@inheritdoc}
   */
  protected $defaultTheme = 'classy';
  protected $defaultTheme = 'stark';

  /**
   * A user with some relevant administrative permissions.
@@ -366,9 +368,13 @@ private function verifyBreadcrumbs() {
    $query = Database::getConnection()->select('watchdog');
    $query->addExpression('MIN([wid])');
    $wid = $query->execute()->fetchField();
    $this->drupalGet('admin/reports/dblog/event/' . $wid);
    $xpath = '//nav[@class="breadcrumb"]/ol/li[last()]/a';
    $this->assertEquals('Recent log messages', current($this->xpath($xpath))->getText(), 'DBLogs link displayed at breadcrumb in event page.');
    $trail = [
      '' => 'Home',
      'admin' => 'Administration',
      'admin/reports' => 'Reports',
      'admin/reports/dblog' => 'Recent log messages',
    ];
    $this->assertBreadcrumb('admin/reports/dblog/event/' . $wid, $trail);
  }

  /**
+2 −2
Original line number Diff line number Diff line
@@ -31,13 +31,13 @@ class DbLogViewsTest extends DbLogTest {
  /**
   * {@inheritdoc}
   */
  protected $defaultTheme = 'classy';
  protected $defaultTheme = 'stark';

  /**
   * {@inheritdoc}
   */
  protected function getLogsEntriesTable() {
    return $this->xpath('.//table[contains(@class, "views-view-table")]/tbody/tr');
    return $this->xpath('.//div[contains(@class, "views-element-container")]//table/tbody/tr');
  }

  /**