assertTourTips example

// Create an admin user to view tour tips.     $this->adminUser = $this->drupalCreateUser($this->permissions);
    $this->drupalLogin($this->adminUser);
  }

  /** * A simple tip test. */
  public function testTips() {
    foreach ($this->tips as $path => $attributes) {
      $this->drupalGet($path);
      $this->assertTourTips($attributes);
    }
  }

}
'access tour',
    ]);
    $this->drupalLogin($this->adminUser);
    $this->drupalPlaceBlock('local_actions_block');
  }

  /** * Tests language tour tip availability. */
  public function testLanguageTour() {
    $this->drupalGet('admin/config/regional/language');
    $this->assertTourTips();
  }

  /** * Go to add language page and check the tour tooltips. */
  public function testLanguageAddTour() {
    $this->drupalGet('admin/config/regional/language/add');
    $this->assertTourTips();
  }

  /** * Go to edit language page and check the tour tooltips. */

  public function testViewsUiTourTips() {
    // Create a basic view that shows all content, with a page and a block     // display.     $view['label'] = $this->randomMachineName(16);
    $view['id'] = strtolower($this->randomMachineName(16));
    $view['page[create]'] = 1;
    $view['page[path]'] = $this->randomMachineName(16);
    $this->drupalGet('admin/structure/views/add');
    $this->submitForm($view, 'Save and edit');
    $this->assertTourTips();
  }

  /** * Tests views_ui tour tip availability in a different language. */
  public function testViewsUiTourTipsTranslated() {
    $langcode = 'nl';

    // Add a default locale storage for this test.     $this->localeStorage = $this->container->get('locale.storage');

    
/** * Tests locale tour tip availability. */
  public function testTranslateStringTourTips() {
    // Add another language so there are no missing form items.     $edit = [];
    $edit['predefined_langcode'] = 'es';
    $this->drupalGet('admin/config/regional/language/add');
    $this->submitForm($edit, 'Add language');

    $this->drupalGet('admin/config/regional/translate');
    $this->assertTourTips();
  }

}
/** * Tests tour functionality. */
  public function testTourFunctionality() {
    // Navigate to tour-test-1 and verify the tour_test_1 tip is found with appropriate classes.     $this->drupalGet('tour-test-1');

    // Test the TourTestBase class assertTourTips() method.     $tips = [];
    $tips[] = ['data-id' => 'tour-test-1'];
    $tips[] = ['data-class' => 'tour-test-5'];
    $this->assertTourTips($tips);
    $this->assertTourTips();

    $tips = $this->getTourTips();

    $href = Url::fromRoute('<front>', []['absolute' => TRUE])->toString();
    $elements = [];
    foreach ($tips as $tip) {
      if ($tip['id'] == 'tour-test-1' && $tip['module'] == 'tour_test' && $tip['type'] == 'text' && str_contains($tip['body']$href) && str_contains($tip['body'], 'Drupal')) {
        $elements[] = $tip;
      }
    }
    
parent::setUp();
    $this->adminUser = $this->drupalCreateUser(['administer blocks', 'access tour']);
    $this->drupalLogin($this->adminUser);
    $this->drupalPlaceBlock('local_actions_block');
  }

  /** * Tests Block Layout tour tip availability. */
  public function testBlockLayoutTourTips() {
    $this->drupalGet('admin/structure/block');
    $this->assertTourTips();
  }

}
Home | Imprint | This part of the site doesn't use cookies.