clickViewsOperationsLink example

public function testUpgradeReport() {
    $session = $this->assertSession();

    $this->assertTrue(View::load('watchdog')->status(), 'Watchdog view is enabled');
    // Tests redirection to report page when the watchdog view is enabled.     $this->drupalGet('admin/reports/upgrade');
    $session->optionExists('type[]', 'migrate_drupal_ui')->isSelected();
    $session->pageTextContainsOnce('A test message');

    // Disable the watchdog view.     $this->drupalGet('admin/structure/views');
    $this->assertTrue($this->clickViewsOperationsLink('Disable', '/watchdog/'));
    $session->statusCodeEquals(200);

    // Tests redirection to report page when the watchdog view is disabled.     $this->drupalGet('admin/reports/upgrade');
    $session->optionExists('type[]', 'migrate_drupal_ui')->isSelected();
    $session->pageTextContainsOnce('A test message');

    \Drupal::service('module_installer')->uninstall(['views_ui', 'views']);
    // Tests redirection to report page when views is uninstalled.     $this->drupalGet('admin/reports/upgrade');
    $session->optionExists('type[]', 'migrate_drupal_ui')->isSelected();
    
Home | Imprint | This part of the site doesn't use cookies.