Commit 43fdb595 authored by catch's avatar catch
Browse files

Issue #3129002 by mondrake, longwave, sja112, martin107, jungle: Replace...

Issue #3129002 by mondrake, longwave, sja112, martin107, jungle: Replace usages of deprecated AssertLegacyTrait::assert()
parent e91ccdd5
Loading
Loading
Loading
Loading
+2 −5
Original line number Diff line number Diff line
@@ -61,13 +61,10 @@ public function testBlockLinks() {

    // Confirm items appear as links.
    $items = $this->container->get('entity_type.manager')->getStorage('aggregator_item')->loadByFeed($feed->id(), 1);
    $links = $this->xpath('//a[@href = :href]', [':href' => reset($items)->getLink()]);
    $this->assert(isset($links[0]), 'Item link found.');
    $this->assertSession()->linkByHrefExists(reset($items)->getLink());

    // Find the expected read_more link.
    $href = $feed->toUrl()->toString();
    $links = $this->xpath('//a[@href = :href]', [':href' => $href]);
    $this->assert(isset($links[0]), new FormattableMarkup('Link to href %href found.', ['%href' => $href]));
    $this->assertSession()->linkByHrefExists($feed->toUrl()->toString());
    $this->assertSession()->responseHeaderContains('X-Drupal-Cache-Tags', 'aggregator_feed:' . $feed->id());

    // Visit that page.
+1 −2
Original line number Diff line number Diff line
@@ -78,8 +78,7 @@ public function createFeed($feed_url = NULL, array $edit = []) {
    $this->assertText(t('The feed @name has been added.', ['@name' => $edit['title[0][value]']]), new FormattableMarkup('The feed @name has been added.', ['@name' => $edit['title[0][value]']]));

    // Verify that the creation message contains a link to a feed.
    $view_link = $this->xpath('//div[@class="messages"]//a[contains(@href, :href)]', [':href' => 'aggregator/sources/']);
    $this->assert(isset($view_link), 'The message area contains a link to a feed');
    $this->assertSession()->elementExists('xpath', '//div[@data-drupal-messages]//a[contains(@href, "aggregator/sources/")]');

    $fids = \Drupal::entityQuery('aggregator_feed')->condition('title', $edit['title[0][value]'])->condition('url', $edit['url[0][value]'])->execute();
    $this->assertNotEmpty($fids, 'The feed found in database.');
+1 −2
Original line number Diff line number Diff line
@@ -47,8 +47,7 @@ public function testUpdateFeedItem() {
    $this->assertText(t('The feed @name has been added.', ['@name' => $edit['title[0][value]']]), new FormattableMarkup('The feed @name has been added.', ['@name' => $edit['title[0][value]']]));

    // Verify that the creation message contains a link to a feed.
    $view_link = $this->xpath('//div[@class="messages"]//a[contains(@href, :href)]', [':href' => 'aggregator/sources/']);
    $this->assert(isset($view_link), 'The message area contains a link to a feed');
    $this->assertSession()->elementExists('xpath', '//div[@data-drupal-messages]//a[contains(@href, "aggregator/sources/")]');

    $fids = \Drupal::entityQuery('aggregator_feed')->condition('url', $edit['url[0][value]'])->execute();
    $feed = Feed::load(array_values($fids)[0]);
+1 −2
Original line number Diff line number Diff line
@@ -35,8 +35,7 @@ public function testUpdateFeed() {
      $this->assertText(t('The feed @name has been updated.', ['@name' => $edit['title[0][value]']]), new FormattableMarkup('The feed %name has been updated.', ['%name' => $edit['title[0][value]']]));

      // Verify that the creation message contains a link to a feed.
      $view_link = $this->xpath('//div[@class="messages"]//a[contains(@href, :href)]', [':href' => 'aggregator/sources/']);
      $this->assert(isset($view_link), 'The message area contains a link to a feed');
      $this->assertSession()->elementExists('xpath', '//div[@data-drupal-messages]//a[contains(@href, "aggregator/sources/")]');

      // Check feed data.
      $this->assertUrl($feed->toUrl('canonical'));
+1 −1
Original line number Diff line number Diff line
@@ -67,7 +67,7 @@ public function testExport() {
    $file_path = $temp_directory . '/config.tar.gz';
    $archiver = new Tar($file_path);
    $archive_contents = $archiver->listContents();
    $this->assert(!empty($archive_contents), 'Downloaded archive file is not empty.');
    $this->assertNotEmpty($archive_contents, 'Downloaded archive file is not empty.');

    // Prepare the list of config files from active storage, see
    // \Drupal\config\Controller\ConfigController::downloadExport().
Loading