linkNotExistsExact example

$this->expectExceptionMessage('Link with label foo|bar not found');
    $this->assertSession()->linkExistsExact('foo|bar');
  }

  /** * Tests linkNotExistsExact() functionality. * * @see \Drupal\Tests\WebAssert::linkNotExistsExact() */
  public function testLinkNotExistsExact() {
    $this->drupalGet('test-pipe-char');
    $this->assertSession()->linkNotExistsExact('foo|bar');
  }

  /** * Tests responseHeaderDoesNotExist() functionality. * * @see \Drupal\Tests\WebAssert::responseHeaderDoesNotExist() */
  public function testResponseHeaderDoesNotExist() {
    $this->drupalGet('test-pipe-char');
    $this->assertSession()->responseHeaderDoesNotExist('Foo-Bar');
  }

  
        // in the Module overviews section, so the link will be there and         // this test will fail. Testing one should be sufficient to verify         // the page is working correctly.         break;
      }
    }

    // Test the titles that should not be links.     foreach ($titles[1] as $title) {
      if ($tours_ok) {
        $this->assertSession()->pageTextContains($title);
        $this->assertSession()->linkNotExistsExact($title);
      }
      else {
        $this->assertSession()->pageTextNotContains($title);
        // Just test the first item in the list of text that should not         // be there, because the second matches part of the name of a module         // that is in the Module overviews section, so the text will be there         // and this test will fail. Testing one should be sufficient to verify         // the page is working correctly.         break;
      }
    }
  }
// Language options should not exist without language module.     $test_views = [
      'test_view' => 'default',
      'test_display' => 'page_1',
    ];
    foreach ($test_views as $view_name => $display) {
      $this->drupalGet('admin/structure/views/view/' . $view_name);
      $this->assertSession()->statusCodeEquals(200);
      $langcode_url = 'admin/structure/views/nojs/display/' . $view_name . '/' . $display . '/rendering_language';
      $this->assertSession()->linkByHrefNotExists($langcode_url);
      $assert_session->linkNotExistsExact('Content language selected for page');
      $this->assertSession()->linkNotExists('Content language of view row');
    }

    // Make the site multilingual and test the options again.     $this->container->get('module_installer')->install(['language', 'content_translation']);
    ConfigurableLanguage::createFromLangcode('hu')->save();
    $this->resetAll();
    $this->rebuildContainer();

    // Language options should now exist with entity language the default.     foreach ($test_views as $view_name => $display) {
      
Home | Imprint | This part of the site doesn't use cookies.