Commit 18ab5c0a authored by catch's avatar catch
Browse files

Issue #3170396 by mondrake, ankithashetty, longwave, catch: [backport] Remove...

Issue #3170396 by mondrake, ankithashetty, longwave, catch: [backport] Remove uses of t() and switch to pageTextContains() in assert(No)Raw() calls
parent cef0c900
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -89,7 +89,7 @@ public function testActionConfiguration() {
    $this->assertSession()->statusCodeEquals(200);

    // Make sure that the action was actually deleted.
    $this->assertRaw(t('The action %action has been deleted.', ['%action' => $new_action_label]));
    $this->assertSession()->pageTextContains("The action $new_action_label has been deleted.");
    $this->drupalGet('admin/config/system/actions');
    $this->assertSession()->statusCodeEquals(200);
    // The action label does not appear on the overview page.
+2 −2
Original line number Diff line number Diff line
@@ -48,8 +48,8 @@ public function testAddFeed() {
    ];
    $this->drupalGet('aggregator/sources/add');
    $this->submitForm($edit, 'Save');
    $this->assertRaw(t('A feed named %feed already exists. Enter a unique title.', ['%feed' => $feed->label()]));
    $this->assertRaw(t('A feed with this URL %url already exists. Enter a unique URL.', ['%url' => $feed->getUrl()]));
    $this->assertSession()->pageTextContains('A feed named ' . $feed->label() . ' already exists. Enter a unique title.');
    $this->assertSession()->pageTextContains('A feed with this URL ' . $feed->getUrl() . ' already exists. Enter a unique URL.');

    // Delete feed.
    $this->deleteFeed($feed);
+2 −2
Original line number Diff line number Diff line
@@ -99,7 +99,7 @@ public function createFeed($feed_url = NULL, array $edit = []) {
  public function deleteFeed(FeedInterface $feed) {
    $this->drupalGet('aggregator/sources/' . $feed->id() . '/delete');
    $this->submitForm([], 'Delete');
    $this->assertRaw(t('The feed %title has been deleted.', ['%title' => $feed->label()]));
    $this->assertSession()->pageTextContains('The feed ' . $feed->label() . ' has been deleted.');
  }

  /**
@@ -222,7 +222,7 @@ public function updateFeedItems(FeedInterface $feed, $expected_count = NULL) {
  public function deleteFeedItems(FeedInterface $feed) {
    $this->drupalGet('admin/config/services/aggregator/delete/' . $feed->id());
    $this->submitForm([], 'Delete items');
    $this->assertRaw(t('The news items from %title have been deleted.', ['%title' => $feed->label()]));
    $this->assertSession()->pageTextContains('The news items from ' . $feed->label() . ' have been deleted.');
  }

  /**
+1 −1
Original line number Diff line number Diff line
@@ -119,7 +119,7 @@ public function testInvalidFeed() {
    // Update the feed. Use the UI to be able to check the message easily.
    $this->drupalGet('admin/config/services/aggregator');
    $this->clickLink('Update items');
    $this->assertRaw(t('The feed from %title seems to be broken because of error', ['%title' => $feed->label()]));
    $this->assertSession()->pageTextContains('The feed from ' . $feed->label() . ' seems to be broken because of error');
  }

}
+4 −4
Original line number Diff line number Diff line
@@ -63,7 +63,7 @@ public function validateImportFormFields() {
    $edit = [];
    $this->drupalGet('admin/config/services/aggregator/add/opml');
    $this->submitForm($edit, 'Import');
    $this->assertRaw(t('<em>Either</em> upload a file or enter a URL.'));
    $this->assertSession()->pageTextContains('Either upload a file or enter a URL.');

    $path = $this->getEmptyOpml();
    $edit = [
@@ -72,7 +72,7 @@ public function validateImportFormFields() {
    ];
    $this->drupalGet('admin/config/services/aggregator/add/opml');
    $this->submitForm($edit, 'Import');
    $this->assertRaw(t('<em>Either</em> upload a file or enter a URL.'));
    $this->assertSession()->pageTextContains('Either upload a file or enter a URL.');

    // Error if the URL is invalid.
    $edit = ['remote' => 'invalidUrl://empty'];
@@ -120,9 +120,9 @@ protected function submitImportForm() {
    $this->drupalGet('admin/config/services/aggregator/add/opml');
    $this->submitForm($edit, 'Import');
    // Verify that a duplicate URL was identified.
    $this->assertRaw(t('A feed with the URL %url already exists.', ['%url' => $feeds[0]['url[0][value]']]));
    $this->assertSession()->pageTextContains('A feed with the URL ' . $feeds[0]['url[0][value]'] . ' already exists.');
    // Verify that a duplicate title was identified.
    $this->assertRaw(t('A feed named %title already exists.', ['%title' => $feeds[1]['title[0][value]']]));
    $this->assertSession()->pageTextContains('A feed named ' . $feeds[1]['title[0][value]'] . ' already exists.');

    $after = $count_query->execute();
    $this->assertEquals(2, $after, 'Verifying that two distinct feeds were added.');
Loading