Unverified Commit 01d96560 authored by Alex Pott's avatar Alex Pott
Browse files

Issue #3139404 by mondrake, munish.kumar, pavnish, longwave: [May 25, 2021]...

Issue #3139404 by mondrake, munish.kumar, pavnish, longwave: [May 25, 2021] Replace usages of AssertLegacyTrait::assertText, that is deprecated

(cherry picked from commit 3872f1a8)
parent d6b00c13
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -52,9 +52,9 @@ public function testActionConfiguration() {
    $action_id = $edit['id'];

    // Make sure that the new complex action was saved properly.
    $this->assertText('The action has been successfully saved.');
    $this->assertSession()->pageTextContains('The action has been successfully saved.');
    // The action label appears on the configuration page.
    $this->assertText($action_label);
    $this->assertSession()->pageTextContains($action_label);

    // Make another POST request to the action edit page.
    $this->clickLink(t('Configure'));
@@ -67,12 +67,12 @@ public function testActionConfiguration() {
    $this->assertSession()->statusCodeEquals(200);

    // Make sure that the action updated properly.
    $this->assertText('The action has been successfully saved.');
    $this->assertSession()->pageTextContains('The action has been successfully saved.');
    // The old action label does NOT appear on the configuration page.
    $this->assertNoText($action_label);
    // The action label appears on the configuration page after we've updated
    // the complex action.
    $this->assertText($new_action_label);
    $this->assertSession()->pageTextContains($new_action_label);

    // Make sure the URL appears when re-editing the action.
    $this->clickLink(t('Configure'));
+2 −2
Original line number Diff line number Diff line
@@ -37,7 +37,7 @@ public function testAddFeed() {
    $this->drupalGet('aggregator/sources/' . $feed->id());
    $this->assertSession()->statusCodeEquals(200);
    // Verify that the feed label is present in the page title.
    $this->assertText($feed->label());
    $this->assertSession()->pageTextContains($feed->label());
    $this->assertRaw($feed->getWebsiteUrl());

    // Try to add a duplicate.
@@ -94,7 +94,7 @@ public function testAddLongFeed() {
    $this->drupalGet('aggregator/sources/' . $feed->id());
    $this->assertSession()->statusCodeEquals(200);
    // Verify that the feed label is present in the page title.
    $this->assertText($feed->label());
    $this->assertSession()->pageTextContains($feed->label());

    // Delete feeds.
    $this->deleteFeed($feed);
+6 −6
Original line number Diff line number Diff line
@@ -22,9 +22,9 @@ public function testSettingsPage() {
    $this->clickLink('Aggregator');
    $this->clickLink('Settings');
    // Make sure that test plugins are present.
    $this->assertText('Test fetcher');
    $this->assertText('Test parser');
    $this->assertText('Test processor');
    $this->assertSession()->pageTextContains('Test fetcher');
    $this->assertSession()->pageTextContains('Test parser');
    $this->assertSession()->pageTextContains('Test processor');

    // Set new values and enable test plugins.
    $edit = [
@@ -37,7 +37,7 @@ public function testSettingsPage() {
      'aggregator_processors[aggregator_test_processor]' => 'aggregator_test_processor',
    ];
    $this->drupalPostForm('admin/config/services/aggregator/settings', $edit, 'Save configuration');
    $this->assertText('The configuration options have been saved.');
    $this->assertSession()->pageTextContains('The configuration options have been saved.');

    // Check that settings have the correct default value.
    foreach ($edit as $name => $value) {
@@ -45,13 +45,13 @@ public function testSettingsPage() {
    }

    // Check for our test processor settings form.
    $this->assertText('Dummy length setting');
    $this->assertSession()->pageTextContains('Dummy length setting');
    // Change its value to ensure that settingsSubmit is called.
    $edit = [
      'dummy_length' => 100,
    ];
    $this->drupalPostForm('admin/config/services/aggregator/settings', $edit, 'Save configuration');
    $this->assertText('The configuration options have been saved.');
    $this->assertSession()->pageTextContains('The configuration options have been saved.');
    $this->assertSession()->fieldValueEquals('dummy_length', 100);

    // Make sure settings form is still accessible even after uninstalling a module
+1 −1
Original line number Diff line number Diff line
@@ -56,7 +56,7 @@ public function testBlockLinks() {

    // Confirm that the block is now being displayed on pages.
    $this->drupalGet('test-page');
    $this->assertText($block->label());
    $this->assertSession()->pageTextContains($block->label());

    // Confirm items appear as links.
    $items = $this->container->get('entity_type.manager')->getStorage('aggregator_item')->loadByFeed($feed->id(), 1);
+1 −1
Original line number Diff line number Diff line
@@ -75,7 +75,7 @@ protected function setUp() {
  public function createFeed($feed_url = NULL, array $edit = []) {
    $edit = $this->getFeedEditArray($feed_url, $edit);
    $this->drupalPostForm('aggregator/sources/add', $edit, 'Save');
    $this->assertText('The feed ' . Html::escape($edit['title[0][value]']) . ' has been added.');
    $this->assertSession()->pageTextContains('The feed ' . $edit['title[0][value]'] . ' has been added.');

    // Verify that the creation message contains a link to a feed.
    $this->assertSession()->elementExists('xpath', '//div[@data-drupal-messages]//a[contains(@href, "aggregator/sources/")]');
Loading