Commit 3c65a0c3 authored by Robert Kasza's avatar Robert Kasza Committed by Robert Kasza
Browse files

Issue #3146542 Compatibility fixes for existing tests

parent 9c4b985f
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -17,7 +17,7 @@ class GoogleAnalyticsCounterAuthSettingsTest extends BrowserTestBase {
   *
   * @var array
   */
  public static $modules = ['system', 'node'];
  protected static $modules = ['system', 'node', 'path_alias'];

  /**
   * A test user with administrative privileges.
@@ -26,12 +26,17 @@ class GoogleAnalyticsCounterAuthSettingsTest extends BrowserTestBase {
   */
  protected $adminUser;

  /**
   * {@inheritdoc}
   */
  protected $defaultTheme = 'stark';

  /**
   * Verifies that the google analytics counter settings page works.
   *
   * @see MediaSourceTest
   */
  public function testAuthSettings() {
  public function testAuthSettings(): void {
    $this->container->get('module_installer')->install(['google_analytics_counter']);
    $this->resetAll();

+7 −2
Original line number Diff line number Diff line
@@ -19,7 +19,7 @@ class GoogleAnalyticsCounterBlockTest extends BrowserTestBase {
  /**
   * {@inheritdoc}
   */
  public static $modules = ['system', 'node', 'block'];
  protected static $modules = ['system', 'node', 'block', 'path_alias'];

  /**
   * Authenticated user.
@@ -50,7 +50,12 @@ class GoogleAnalyticsCounterBlockTest extends BrowserTestBase {
  /**
   * {@inheritdoc}
   */
  protected function setUp() {
  protected $defaultTheme = 'stark';

  /**
   * {@inheritdoc}
   */
  protected function setUp(): void {
    parent::setUp();
    $this->drupalCreateContentType(['type' => 'page', 'name' => 'Basic page']);

+7 −2
Original line number Diff line number Diff line
@@ -22,12 +22,17 @@ class GoogleAnalyticsCounterSettingsTest extends BrowserTestBase {
  /**
   * {@inheritdoc}
   */
  public static $modules = ['system', 'node'];
  protected static $modules = ['system', 'node', 'path_alias'];

  /**
   * {@inheritdoc}
   */
  protected function setUp() {
  protected $defaultTheme = 'stark';

  /**
   * {@inheritdoc}
   */
  protected function setUp(): void {
    parent::setUp();
    $this->drupalCreateContentType(['type' => 'page', 'name' => 'Basic page']);
  }
+3 −3
Original line number Diff line number Diff line
@@ -16,7 +16,7 @@ class GoogleAnalyticsCounterQueueTest extends CronQueueTest {
   *
   * @var array
   */
  public static $modules = array('node', 'user', 'google_analytics_counter');
  protected static $modules = array('node', 'user', 'google_analytics_counter', 'path_alias');

  /**
   * The queue plugin being tested.
@@ -28,7 +28,7 @@ class GoogleAnalyticsCounterQueueTest extends CronQueueTest {
  /**
   * {@inheritdoc}
   */
  protected function setUp() {
  protected function setUp(): void {
    parent::setUp();
    module_load_install('google_analytics_counter');
    $this->installSchema('google_analytics_counter', [
@@ -49,7 +49,7 @@ class GoogleAnalyticsCounterQueueTest extends CronQueueTest {
    $queue->createItem(['type' => 'count', 'nid' => 1]);

    // Items should be in the queue.
   $this->assertEqual($queue->numberOfItems(), 2, 'Items are in the queue.');
   $this->assertEquals(2, $queue->numberOfItems(), 'Items are in the queue.');

    // Expire the queue item manually. system_cron() relies on REQUEST_TIME to
    // find queue items whose expire field needs to be reset to 0. This is a