Commit c09dc39b authored by catch's avatar catch

Issue #3139419 by mondrake, aleevas: Replace usages of...

Issue #3139419 by mondrake, aleevas: Replace usages of AssertLegacyTrait::assertUrl, that is deprecated
parent edd570f7
......@@ -30,7 +30,7 @@ public function testAddFeed() {
$feed->refreshItems();
// Check feed data.
$this->assertUrl(Url::fromRoute('aggregator.feed_add'));
$this->assertSession()->addressEquals(Url::fromRoute('aggregator.feed_add'));
$this->assertTrue($this->uniqueFeed($feed->label(), $feed->getUrl()), 'The feed is unique.');
// Check feed source.
......
......@@ -38,7 +38,7 @@ public function testUpdateFeed() {
$this->assertSession()->elementExists('xpath', '//div[@data-drupal-messages]//a[contains(@href, "aggregator/sources/")]');
// Check feed data.
$this->assertUrl($feed->toUrl('canonical'));
$this->assertSession()->addressEquals($feed->toUrl('canonical'));
$this->assertTrue($this->uniqueFeed($edit['title[0][value]'], $edit['url[0][value]']), 'The feed is unique.');
// Check feed source.
......
......@@ -48,7 +48,7 @@ public function testCachePerPage() {
// Make sure that we're currently still on /test-page after submitting the
// form.
$this->drupalPostForm(NULL, $form_values, t('Submit'));
$this->assertUrl('test-page');
$this->assertSession()->addressEquals('test-page');
$this->assertText(t('Your email address is @email', ['@email' => 'test@example.com']));
// Go to a different page and see if the block is enabled there as well.
......@@ -60,7 +60,7 @@ public function testCachePerPage() {
// we submitted the form from after submitting the form from
// /test-render-title.
$this->drupalPostForm(NULL, $form_values, t('Submit'));
$this->assertUrl('test-render-title');
$this->assertSession()->addressEquals('test-render-title');
$this->assertText(t('Your email address is @email', ['@email' => 'test@example.com']));
}
......
......@@ -240,7 +240,7 @@ public function testBlock() {
$this->assertRaw(t('Are you sure you want to remove the block @name?', ['@name' => $block->label()]));
$this->drupalPostForm(NULL, [], t('Remove'));
$this->assertRaw(t('The block %name has been removed.', ['%name' => $block->label()]));
$this->assertUrl('admin');
$this->assertSession()->addressEquals('admin');
$this->assertNoRaw($block->id());
}
......@@ -261,7 +261,7 @@ public function testBlockThemeSelector() {
$block['region'] = 'content';
$this->drupalPostForm('admin/structure/block/add/system_powered_by_block', $block, t('Save block'));
$this->assertText(t('The block configuration has been saved.'));
$this->assertUrl('admin/structure/block/list/' . $theme . '?block-placement=' . Html::getClass($block['id']));
$this->assertSession()->addressEquals('admin/structure/block/list/' . $theme . '?block-placement=' . Html::getClass($block['id']));
// Set the default theme and ensure the block is placed.
$theme_settings->set('default', $theme)->save();
......
......@@ -98,7 +98,7 @@ public function testBlockCategory() {
// Duplicate the block before changing the category.
$this->drupalPostForm('admin/structure/views/view/' . $edit['id'] . '/edit/block_1', [], t('Duplicate @display_title', ['@display_title' => 'Block']));
$this->assertUrl('admin/structure/views/view/' . $edit['id'] . '/edit/block_2');
$this->assertSession()->addressEquals('admin/structure/views/view/' . $edit['id'] . '/edit/block_2');
// Change the block category to a random string.
$this->drupalGet('admin/structure/views/view/' . $edit['id'] . '/edit/block_1');
......@@ -110,7 +110,7 @@ public function testBlockCategory() {
// Duplicate the block after changing the category.
$this->drupalPostForm(NULL, [], t('Duplicate @display_title', ['@display_title' => 'Block']));
$this->assertUrl('admin/structure/views/view/' . $edit['id'] . '/edit/block_3');
$this->assertSession()->addressEquals('admin/structure/views/view/' . $edit['id'] . '/edit/block_3');
$this->drupalPostForm(NULL, [], t('Save'));
......
......@@ -135,7 +135,7 @@ public function testBlockContentTypeEditing() {
$this->assertRaw('Bar', 'New name was displayed.');
$this->clickLink('Bar');
// Verify that the original machine name was used in the URL.
$this->assertUrl(Url::fromRoute('block_content.add_form', ['block_content_type' => 'basic']));
$this->assertSession()->addressEquals(Url::fromRoute('block_content.add_form', ['block_content_type' => 'basic']));
// Remove the body field.
$this->drupalPostForm('admin/structure/block/block-content/manage/basic/fields/block_content.basic.body/delete', [], t('Delete'));
......@@ -227,9 +227,9 @@ public function testsBlockContentAddTypes() {
$blocks = $storage->loadByProperties(['info' => $edit['info[0][value]']]);
if (!empty($blocks)) {
$block = reset($blocks);
$this->assertUrl(Url::fromRoute('block.admin_add', ['plugin_id' => 'block_content:' . $block->uuid(), 'theme' => $theme]));
$this->assertSession()->addressEquals(Url::fromRoute('block.admin_add', ['plugin_id' => 'block_content:' . $block->uuid(), 'theme' => $theme]));
$this->drupalPostForm(NULL, ['region' => 'content'], t('Save block'));
$this->assertUrl(Url::fromRoute('block.admin_display_theme', ['theme' => $theme], ['query' => ['block-placement' => Html::getClass($edit['info[0][value]'])]]));
$this->assertSession()->addressEquals(Url::fromRoute('block.admin_display_theme', ['theme' => $theme], ['query' => ['block-placement' => Html::getClass($edit['info[0][value]'])]]));
}
else {
$this->fail('Could not load created block.');
......@@ -246,7 +246,7 @@ public function testsBlockContentAddTypes() {
$this->drupalPostForm(NULL, $edit, t('Save'));
$blocks = $storage->loadByProperties(['info' => $edit['info[0][value]']]);
if (!empty($blocks)) {
$this->assertUrl(Url::fromRoute('entity.block_content.collection'));
$this->assertSession()->addressEquals(Url::fromRoute('entity.block_content.collection'));
}
else {
$this->fail('Could not load created block.');
......
......@@ -49,7 +49,7 @@ public function testRedirectDestination() {
// Edit the created block and save.
$this->clickLink('Edit');
$this->drupalPostForm(NULL, [], 'Save');
$this->assertUrl('admin/content/redirect_destination');
$this->assertSession()->addressEquals('admin/content/redirect_destination');
}
}
......@@ -125,7 +125,7 @@ public function testCommentInterface() {
// \Drupal\comment\Controller\CommentController::redirectNode().
$this->drupalGet('comment/' . $this->node->id() . '/reply');
// Verify we were correctly redirected.
$this->assertUrl(Url::fromRoute('comment.reply', ['entity_type' => 'node', 'entity' => $this->node->id(), 'field_name' => 'comment']));
$this->assertSession()->addressEquals(Url::fromRoute('comment.reply', ['entity_type' => 'node', 'entity' => $this->node->id(), 'field_name' => 'comment']));
$this->drupalGet('comment/reply/node/' . $this->node->id() . '/comment/' . $comment->id());
$this->assertText($subject_text, 'Individual comment-reply subject found.');
$this->assertText($comment_text, 'Individual comment-reply body found.');
......
......@@ -115,7 +115,7 @@ public function testCommentTypeEditing() {
$this->assertRaw('Bar', 'New name was displayed.');
$this->clickLink('Manage fields');
// Verify that the original machine name was used in the URL.
$this->assertUrl(Url::fromRoute('entity.comment.field_ui_fields', ['comment_type' => 'comment']));
$this->assertSession()->addressEquals(Url::fromRoute('entity.comment.field_ui_fields', ['comment_type' => 'comment']));
$this->assertCount(1, $this->cssSelect('tr#comment-body'), 'Body field exists.');
// Remove the body field.
......
......@@ -54,7 +54,7 @@ public function testCommentWizard() {
$this->drupalPostForm('admin/structure/views/add', $view, t('Save and edit'));
// Verify that the view saving was successful and the browser got redirected
// to the edit page.
$this->assertUrl('admin/structure/views/view/' . $view['id']);
$this->assertSession()->addressEquals('admin/structure/views/view/' . $view['id']);
// If we update the type first we should get a selection of comment valid
// row plugins as the select field.
......@@ -75,7 +75,7 @@ public function testCommentWizard() {
$this->drupalPostForm(NULL, $view, t('Save and edit'));
// Verify that the view saving was successful and the browser got redirected
// to the edit page.
$this->assertUrl('admin/structure/views/view/' . $view['id']);
$this->assertSession()->addressEquals('admin/structure/views/view/' . $view['id']);
$user = $this->drupalCreateUser(['access comments']);
$this->drupalLogin($user);
......
......@@ -244,7 +244,7 @@ public function testCRUDUI() {
'label' => $label1,
];
$this->drupalPostForm('admin/structure/config_test/add', $edit, 'Save');
$this->assertUrl('admin/structure/config_test');
$this->assertSession()->addressEquals('admin/structure/config_test');
$this->assertSession()->statusCodeEquals(200);
$this->assertRaw($message_insert);
$this->assertNoRaw($message_update);
......@@ -255,7 +255,7 @@ public function testCRUDUI() {
'label' => $label2,
];
$this->drupalPostForm("admin/structure/config_test/manage/$id", $edit, 'Save');
$this->assertUrl('admin/structure/config_test');
$this->assertSession()->addressEquals('admin/structure/config_test');
$this->assertSession()->statusCodeEquals(200);
$this->assertNoRaw($message_insert);
$this->assertRaw($message_update);
......@@ -265,9 +265,9 @@ public function testCRUDUI() {
// Delete the configuration entity.
$this->drupalGet("admin/structure/config_test/manage/$id");
$this->clickLink(t('Delete'));
$this->assertUrl("admin/structure/config_test/manage/$id/delete");
$this->assertSession()->addressEquals("admin/structure/config_test/manage/$id/delete");
$this->drupalPostForm(NULL, [], 'Delete');
$this->assertUrl('admin/structure/config_test');
$this->assertSession()->addressEquals('admin/structure/config_test');
$this->assertSession()->statusCodeEquals(200);
$this->assertNoRaw($message_update);
$this->assertRaw($message_delete);
......@@ -280,7 +280,7 @@ public function testCRUDUI() {
'label' => $label1,
];
$this->drupalPostForm('admin/structure/config_test/add', $edit, 'Save');
$this->assertUrl('admin/structure/config_test');
$this->assertSession()->addressEquals('admin/structure/config_test');
$this->assertSession()->statusCodeEquals(200);
$this->assertText($label1);
$this->assertLinkByHref("admin/structure/config_test/manage/$id");
......@@ -291,7 +291,7 @@ public function testCRUDUI() {
'label' => $label3,
];
$this->drupalPostForm("admin/structure/config_test/manage/$id", $edit, 'Save');
$this->assertUrl('admin/structure/config_test');
$this->assertSession()->addressEquals('admin/structure/config_test');
$this->assertSession()->statusCodeEquals(200);
$this->assertNoText($label1);
$this->assertNoText($label2);
......
......@@ -154,7 +154,7 @@ public function testSiteInformationTranslationUi() {
$this->clickLink(t('Edit'));
// Also check that saving the form leads back to the translation overview.
$this->drupalPostForm(NULL, [], t('Save configuration'));
$this->assertUrl($translation_base_url);
$this->assertSession()->addressEquals($translation_base_url);
// Check 'Add' link of French to visit add page.
$this->assertLinkByHref("$translation_base_url/fr/add");
......
......@@ -357,7 +357,7 @@ public function testSiteWideContact() {
];
$this->drupalPostForm(NULL, $edit, t('Send message'));
$this->assertText('Thanks for your submission.');
$this->assertUrl('user/' . $admin_user->id());
$this->assertSession()->addressEquals('user/' . $admin_user->id());
// Test Empty message.
/** @var \Drupal\contact\ContactFormInterface $form */
......@@ -378,7 +378,7 @@ public function testSiteWideContact() {
$this->drupalPostForm(NULL, $edit, t('Send message'));
$result = $this->xpath('//div[@role=:role]', [':role' => 'contentinfo']);
$this->assertCount(0, $result, 'Messages not found.');
$this->assertUrl('user/' . $admin_user->id());
$this->assertSession()->addressEquals('user/' . $admin_user->id());
// Test preview and visibility of the message field and label. Submit the
// contact form and verify the content.
......
......@@ -110,7 +110,7 @@ public function testModerationForm() {
'view_mode_id' => 'full',
]);
$this->assertSession()->statusCodeEquals(200);
$this->assertUrl($preview_url);
$this->assertSession()->addressEquals($preview_url);
$this->assertSession()->fieldNotExists('edit-new-state');
// The latest version page should not show, because there is still no
......
......@@ -95,7 +95,7 @@ public function testFormSaveDestination() {
// After saving, we should be at the canonical URL and viewing the first
// revision.
$this->assertUrl(Url::fromRoute('entity.node.canonical', ['node' => $node->id()]));
$this->assertSession()->addressEquals(Url::fromRoute('entity.node.canonical', ['node' => $node->id()]));
$this->assertText('First version of the content.');
// Create a new draft; after saving, we should still be on the canonical
......@@ -104,7 +104,7 @@ public function testFormSaveDestination() {
'body[0][value]' => 'Second version of the content.',
'moderation_state[0][state]' => 'draft',
], t('Save'));
$this->assertUrl(Url::fromRoute('entity.node.canonical', ['node' => $node->id()]));
$this->assertSession()->addressEquals(Url::fromRoute('entity.node.canonical', ['node' => $node->id()]));
$this->assertText('Second version of the content.');
// Make a new published revision; after saving, we should be at the
......@@ -113,7 +113,7 @@ public function testFormSaveDestination() {
'body[0][value]' => 'Third version of the content.',
'moderation_state[0][state]' => 'published',
], t('Save'));
$this->assertUrl(Url::fromRoute('entity.node.canonical', ['node' => $node->id()]));
$this->assertSession()->addressEquals(Url::fromRoute('entity.node.canonical', ['node' => $node->id()]));
$this->assertText('Third version of the content.');
// Make a new pending revision; after saving, we should be on the "Latest
......@@ -122,7 +122,7 @@ public function testFormSaveDestination() {
'body[0][value]' => 'Fourth version of the content.',
'moderation_state[0][state]' => 'draft',
], t('Save'));
$this->assertUrl(Url::fromRoute('entity.node.latest_version', ['node' => $node->id()]));
$this->assertSession()->addressEquals(Url::fromRoute('entity.node.latest_version', ['node' => $node->id()]));
$this->assertText('Fourth version of the content.');
}
......
......@@ -329,7 +329,7 @@ protected function doTestWorkflows(UserInterface $user, $expected_status) {
$add_translation_url = Url::fromRoute("entity.$this->entityTypeId.content_translation_add", [$this->entityTypeId => $this->entity->id(), 'source' => $default_langcode, 'target' => $langcode], $options);
if ($expected_status['add_translation'] == 200) {
$this->clickLink('Add');
$this->assertUrl($add_translation_url);
$this->assertSession()->addressEquals($add_translation_url);
// Check that the translation form does not contain shared elements for
// translators.
if ($expected_status['edit'] == 403) {
......@@ -354,12 +354,12 @@ protected function doTestWorkflows(UserInterface $user, $expected_status) {
// An editor should be pointed to the entity form in multilingual mode.
// We need a new expected edit path with a new language.
$expected_edit_path = $this->entity->toUrl('edit-form', $options)->toString();
$this->assertUrl($expected_edit_path);
$this->assertSession()->addressEquals($expected_edit_path);
}
else {
$this->clickLink('Edit');
// While a translator should be pointed to the translation form.
$this->assertUrl($edit_translation_url);
$this->assertSession()->addressEquals($edit_translation_url);
// Check that the translation form does not contain shared elements.
$this->assertNoSharedElements();
}
......@@ -396,13 +396,13 @@ protected function doTestWorkflows(UserInterface $user, $expected_status) {
// multilingual mode. We need a new expected delete path with a new
// language.
$expected_delete_path = $this->entity->toUrl('delete-form', $options)->toString();
$this->assertUrl($expected_delete_path);
$this->assertSession()->addressEquals($expected_delete_path);
}
else {
$this->clickLink('Delete');
// While a translator should be pointed to the translation deletion
// form.
$this->assertUrl($delete_translation_url);
$this->assertSession()->addressEquals($delete_translation_url);
}
}
else {
......
......@@ -240,7 +240,7 @@ public function updateField() {
$this->assertFieldSettings($this->contentType, $this->fieldName, $string);
// Assert redirection back to the "manage fields" page.
$this->assertUrl('admin/structure/types/manage/' . $this->contentType . '/fields');
$this->assertSession()->addressEquals('admin/structure/types/manage/' . $this->contentType . '/fields');
}
/**
......@@ -670,7 +670,7 @@ public function testDuplicateFieldName() {
$this->drupalPostForm($url, $edit, t('Save and continue'));
$this->assertText(t('The machine-readable name is already in use. It must be unique.'));
$this->assertUrl($url);
$this->assertSession()->addressEquals($url);
}
/**
......@@ -682,7 +682,7 @@ public function testExternalDestinations() {
];
$this->drupalPostForm('admin/structure/types/manage/article/fields/node.article.body/storage', [], 'Save field settings', $options);
// The external redirect should not fire.
$this->assertUrl('admin/structure/types/manage/article/fields/node.article.body/storage?destinations%5B0%5D=http%3A//example.com');
$this->assertSession()->addressEquals('admin/structure/types/manage/article/fields/node.article.body/storage?destinations%5B0%5D=http%3A//example.com');
$this->assertSession()->statusCodeEquals(200);
$this->assertRaw('Attempt to update field <em class="placeholder">Body</em> failed: <em class="placeholder">The internal path component &#039;http://example.com&#039; is external. You are not allowed to specify an external URL together with internal:/.</em>.');
}
......
......@@ -93,7 +93,7 @@ public function testPrivateFile() {
$this->getSession()->getPage()->find('css', 'input[name="' . $field_name . '[0][fids]"]')->setValue($node_file->id());
$this->getSession()->getPage()->pressButton(t('Save'));
// Make sure the form submit failed - we stayed on the edit form.
$this->assertUrl('node/' . $new_node->id() . '/edit');
$this->assertSession()->addressEquals('node/' . $new_node->id() . '/edit');
// Check that we got the expected constraint form error.
$constraint = new ReferenceAccessConstraint();
$this->assertRaw(new FormattableMarkup($constraint->message, ['%type' => 'file', '%id' => $node_file->id()]));
......@@ -108,7 +108,7 @@ public function testPrivateFile() {
$this->getSession()->getPage()->pressButton(t('Save'));
$new_node = $this->drupalGetNodeByTitle($edit['title[0][value]']);
$this->assertTrue(empty($new_node), 'Node was not created.');
$this->assertUrl('node/add/' . $type_name);
$this->assertSession()->addressEquals('node/add/' . $type_name);
$this->assertRaw(new FormattableMarkup($constraint->message, ['%type' => 'file', '%id' => $node_file->id()]));
// Now make file_test_file_download() return everything.
......
......@@ -217,7 +217,7 @@ public function testFilterAdmin() {
$edit = [];
$edit['filters[filter_html][settings][allowed_html]'] = "<a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>\r\n<quote>";
$this->drupalPostForm('admin/config/content/formats/manage/' . $restricted, $edit, t('Save configuration'));
$this->assertUrl('admin/config/content/formats/manage/' . $restricted);
$this->assertSession()->addressEquals('admin/config/content/formats/manage/' . $restricted);
$this->drupalGet('admin/config/content/formats/manage/' . $restricted);
$this->assertFieldByName('filters[filter_html][settings][allowed_html]', "<a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <quote>", 'Allowed HTML tag added.');
......@@ -232,7 +232,7 @@ public function testFilterAdmin() {
$edit['filters[' . $second_filter . '][weight]'] = 1;
$edit['filters[' . $first_filter . '][weight]'] = 2;
$this->drupalPostForm(NULL, $edit, t('Save configuration'));
$this->assertUrl('admin/config/content/formats/manage/' . $restricted);
$this->assertSession()->addressEquals('admin/config/content/formats/manage/' . $restricted);
$this->drupalGet('admin/config/content/formats/manage/' . $restricted);
$this->assertFieldByName('filters[' . $second_filter . '][weight]', 1, 'Order saved successfully.');
$this->assertFieldByName('filters[' . $first_filter . '][weight]', 2, 'Order saved successfully.');
......@@ -260,7 +260,7 @@ public function testFilterAdmin() {
$edit['filters[' . $second_filter . '][status]'] = TRUE;
$edit['filters[' . $first_filter . '][status]'] = TRUE;
$this->drupalPostForm('admin/config/content/formats/add', $edit, t('Save configuration'));
$this->assertUrl('admin/config/content/formats');
$this->assertSession()->addressEquals('admin/config/content/formats');
$this->assertRaw(t('Added text format %format.', ['%format' => $edit['name']]), 'New filter created.');
filter_formats_reset();
......@@ -273,7 +273,7 @@ public function testFilterAdmin() {
// Disable new filter.
$this->drupalPostForm('admin/config/content/formats/manage/' . $format->id() . '/disable', [], t('Disable'));
$this->assertUrl('admin/config/content/formats');
$this->assertSession()->addressEquals('admin/config/content/formats');
$this->assertRaw(t('Disabled text format %format.', ['%format' => $edit['name']]), 'Format successfully disabled.');
// Allow authenticated users on full HTML.
......@@ -282,7 +282,7 @@ public function testFilterAdmin() {
$edit['roles[' . RoleInterface::ANONYMOUS_ID . ']'] = 0;
$edit['roles[' . RoleInterface::AUTHENTICATED_ID . ']'] = 1;
$this->drupalPostForm('admin/config/content/formats/manage/' . $full, $edit, t('Save configuration'));
$this->assertUrl('admin/config/content/formats/manage/' . $full);
$this->assertSession()->addressEquals('admin/config/content/formats/manage/' . $full);
$this->assertRaw(t('The text format %format has been updated.', ['%format' => $format->label()]), 'Full HTML format successfully updated.');
// Switch user.
......@@ -336,7 +336,7 @@ public function testFilterAdmin() {
$edit = [];
$edit['filters[filter_html][settings][allowed_html]'] = '<a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>';
$this->drupalPostForm('admin/config/content/formats/manage/' . $basic, $edit, t('Save configuration'));
$this->assertUrl('admin/config/content/formats/manage/' . $basic);
$this->assertSession()->addressEquals('admin/config/content/formats/manage/' . $basic);
$this->drupalGet('admin/config/content/formats/manage/' . $basic);
$this->assertFieldByName('filters[filter_html][settings][allowed_html]', $edit['filters[filter_html][settings][allowed_html]'], 'Changes reverted.');
......@@ -344,7 +344,7 @@ public function testFilterAdmin() {
$edit = [];
$edit['roles[' . RoleInterface::AUTHENTICATED_ID . ']'] = FALSE;
$this->drupalPostForm('admin/config/content/formats/manage/' . $full, $edit, t('Save configuration'));
$this->assertUrl('admin/config/content/formats/manage/' . $full);
$this->assertSession()->addressEquals('admin/config/content/formats/manage/' . $full);
$this->assertRaw(t('The text format %format has been updated.', ['%format' => $format->label()]), 'Full HTML format successfully reverted.');
$this->drupalGet('admin/config/content/formats/manage/' . $full);
$this->assertFieldByName('roles[' . RoleInterface::AUTHENTICATED_ID . ']', $edit['roles[' . RoleInterface::AUTHENTICATED_ID . ']'], 'Changes reverted.');
......@@ -354,7 +354,7 @@ public function testFilterAdmin() {
$edit['filters[' . $second_filter . '][weight]'] = 2;
$edit['filters[' . $first_filter . '][weight]'] = 1;
$this->drupalPostForm('admin/config/content/formats/manage/' . $basic, $edit, t('Save configuration'));
$this->assertUrl('admin/config/content/formats/manage/' . $basic);
$this->assertSession()->addressEquals('admin/config/content/formats/manage/' . $basic);
$this->drupalGet('admin/config/content/formats/manage/' . $basic);
$this->assertFieldByName('filters[' . $second_filter . '][weight]', $edit['filters[' . $second_filter . '][weight]'], 'Changes reverted.');
$this->assertFieldByName('filters[' . $first_filter . '][weight]', $edit['filters[' . $first_filter . '][weight]'], 'Changes reverted.');
......
......@@ -291,7 +291,7 @@ public function testFormatWidgetPermissions() {
// Now select a new text format and make sure the node can be saved.
$edit[$body_format_key] = filter_fallback_format();
$this->drupalPostForm('node/' . $node->id() . '/edit', $edit, t('Save'));
$this->assertUrl('node/' . $node->id());
$this->assertSession()->addressEquals('node/' . $node->id());
$this->assertText($new_title, 'New title found.');
$this->assertNoText($old_title, 'Old title not found.');
......@@ -300,7 +300,7 @@ public function testFormatWidgetPermissions() {
$this->drupalLogin($this->adminUser);
$edit = [$body_format_key => $this->allowedFormat->id()];
$this->drupalPostForm('node/' . $node->id() . '/edit', $edit, t('Save'));
$this->assertUrl('node/' . $node->id());
$this->assertSession()->addressEquals('node/' . $node->id());
foreach (filter_formats() as $format) {
if (!$format->isFallbackFormat()) {
$format->disable()->save();
......@@ -324,7 +324,7 @@ public function testFormatWidgetPermissions() {
$this->assertNoText($new_title, 'New title not found.');
$edit[$body_format_key] = filter_fallback_format();
$this->drupalPostForm('node/' . $node->id() . '/edit', $edit, t('Save'));
$this->assertUrl('node/' . $node->id());
$this->assertSession()->addressEquals('node/' . $node->id());
$this->assertText($new_title, 'New title found.');
$this->assertNoText($old_title, 'Old title not found.');
}
......
......@@ -54,7 +54,7 @@ public function testForumIndexStatus() {
// Create the forum topic, preselecting the forum ID via a URL parameter.
$this->drupalGet("forum/$tid");
$this->clickLink(t('Add new @node_type', ['@node_type' => 'Forum topic']));
$this->assertUrl("node/add/forum?forum_id=$tid");
$this->assertSession()->addressEquals("node/add/forum?forum_id=$tid");
$this->drupalPostForm(NULL, $edit, t('Save'));
// Check that the node exists in the database.
......
......@@ -59,7 +59,7 @@ public function testUIBrowserLanguageMappings() {
$this->assertRaw(t('The mapping for the %browser browser language code has been deleted.', $t_args), 'The test browser language code has been deleted.');
// Check we went back to the browser negotiation mapping overview.
$this->assertUrl(Url::fromRoute('language.negotiation_browser'));
$this->assertSession()->addressEquals(Url::fromRoute('language.negotiation_browser'));
// Check that Chinese browser language code no longer exists.
$this->assertSession()->fieldNotExists('edit-mappings-zh-cn-browser-langcode');
......@@ -69,7 +69,7 @@ public function testUIBrowserLanguageMappings() {
'new_mapping[drupal_langcode]' => 'en',
];
$this->drupalPostForm('admin/config/regional/language/detection/browser', $edit, t('Save configuration'));
$this->assertUrl(Url::fromRoute('language.negotiation_browser'));
$this->assertSession()->addressEquals(Url::fromRoute('language.negotiation_browser'));
$this->assertFieldById('edit-mappings-xx-browser-langcode', 'xx');
$this->assertFieldById('edit-mappings-xx-drupal-langcode', 'en');
......@@ -91,7 +91,7 @@ public function testUIBrowserLanguageMappings() {
'mappings[xx][drupal_langcode]' => 'zh-hans',
];
$this->drupalPostForm('admin/config/regional/language/detection/browser', $edit, t('Save configuration'));
$this->assertUrl(Url::fromRoute('language.negotiation_browser'));
$this->assertSession()->addressEquals(Url::fromRoute('language.negotiation_browser'));
$this->assertFieldById('edit-mappings-xx-browser-langcode', 'xx');
$this->assertFieldById('edit-mappings-xx-drupal-langcode', 'zh-hans');
}
......
......@@ -56,7 +56,7 @@ public function testLanguageConfiguration() {
];
$this->drupalPostForm(NULL, $edit, 'Add language');
$this->assertText('French');
$this->assertUrl(Url::fromRoute('entity.configurable_language.collection'));
$this->assertSession()->addressEquals(Url::fromRoute('entity.configurable_language.collection'));
// Langcode for Languages is always 'en'.
$language = $this->config('language.entity.fr')->get();
$this->assertEqual($language['langcode'], 'en');
......@@ -79,7 +79,7 @@ public function testLanguageConfiguration() {
$this->drupalPostForm(NULL, $edit, t('Save configuration'));
$this->rebuildContainer();
$this->assertSession()->checkboxChecked('edit-site-default-language-fr');
$this->assertUrl(Url::fromRoute('entity.configurable_language.collection', [], ['langcode' => 'fr']));
$this->assertSession()->addressEquals(Url::fromRoute('entity.configurable_language.collection', [], ['langcode' => 'fr']));
// Check if a valid language prefix is added after changing the default
// language.
......
......@@ -48,7 +48,7 @@ public function testLanguageConfiguration() {
$this->assertText(t('@name field is required.', ['@name' => t('Language name')]));
$empty_language = new Language();
$this->assertSession()->checkboxChecked('edit-direction-' . $empty_language->getDirection());
$this->assertUrl(Url::fromRoute('language.add'));
$this->assertSession()->addressEquals(Url::fromRoute('language.add'));
// Test validation of invalid values.
$edit = [
......@@ -65,7 +65,7 @@ public function testLanguageConfiguration() {
]));
$this->assertRaw(t('%field cannot contain any markup.', ['%field' => t('Language name')]));
$this->assertUrl(Url::fromRoute('language.add'));
$this->assertSession()->addressEquals(Url::fromRoute('language.add'));
// Test adding a custom language with a numeric region code.
$edit = [
......@@ -80,7 +80,7 @@ public function testLanguageConfiguration() {
'The language %language has been created and can now be used.',
['%language' => $edit['label']]