.../lib/Drupal/action/Tests/BulkFormTest.php | 4 +-
.../lib/Drupal/action/Tests/ConfigurationTest.php | 8 +-
.../Tests/AggregatorConfigurationTest.php | 4 +-
.../Drupal/aggregator/Tests/AggregatorTestBase.php | 8 +-
.../aggregator/Tests/CategorizeFeedItemTest.php | 2 +-
.../Drupal/aggregator/Tests/CategorizeFeedTest.php | 4 +-
.../lib/Drupal/aggregator/Tests/ImportOpmlTest.php | 12 +-
.../Drupal/aggregator/Tests/UpdateFeedItemTest.php | 2 +-
.../lib/Drupal/aggregator/Tests/UpdateFeedTest.php | 2 +-
.../lib/Drupal/ban/Tests/IpAddressBlockingTest.php | 14 +-
.../custom_block/Tests/CustomBlockCreationTest.php | 16 +-
.../custom_block/Tests/CustomBlockFieldTest.php | 4 +-
.../custom_block/Tests/CustomBlockListTest.php | 6 +-
.../custom_block/Tests/CustomBlockTypeTest.php | 12 +-
.../lib/Drupal/custom_block/Tests/PageEditTest.php | 8 +-
.../lib/Drupal/block/Tests/BlockAdminThemeTest.php | 2 +-
.../Drupal/block/Tests/BlockInvalidRegionTest.php | 6 +-
.../lib/Drupal/block/Tests/BlockLanguageTest.php | 8 +-
.../block/lib/Drupal/block/Tests/BlockTest.php | 24 +-
.../block/lib/Drupal/block/Tests/BlockTestBase.php | 2 +-
.../block/lib/Drupal/block/Tests/BlockUiTest.php | 6 +-
.../Drupal/block/Tests/Views/DisplayBlockTest.php | 20 +-
.../book/lib/Drupal/book/Tests/BookTest.php | 34 +--
.../Drupal/ckeditor/Tests/CKEditorAdminTest.php | 12 +-
.../color/lib/Drupal/color/Tests/ColorTest.php | 6 +-
.../Drupal/comment/Tests/CommentAnonymousTest.php | 2 +-
.../Drupal/comment/Tests/CommentApprovalTest.php | 6 +-
.../lib/Drupal/comment/Tests/CommentFieldsTest.php | 10 +-
.../Drupal/comment/Tests/CommentLanguageTest.php | 14 +-
.../Drupal/comment/Tests/CommentPreviewTest.php | 10 +-
.../lib/Drupal/comment/Tests/CommentTestBase.php | 12 +-
.../lib/Drupal/comment/Tests/Views/WizardTest.php | 6 +-
.../Drupal/config/Tests/ConfigEntityListTest.php | 8 +-
.../config/Tests/ConfigEntityStatusUITest.php | 2 +-
.../lib/Drupal/config/Tests/ConfigEntityTest.php | 16 +-
.../lib/Drupal/config/Tests/ConfigExportUITest.php | 2 +-
.../lib/Drupal/config/Tests/ConfigImportUITest.php | 4 +-
.../Drupal/config/Tests/ConfigImportUploadTest.php | 2 +-
.../config/Tests/ConfigLocaleOverrideWebTest.php | 2 +-
.../Drupal/contact/Tests/ContactPersonalTest.php | 6 +-
.../Drupal/contact/Tests/ContactSitewideTest.php | 20 +-
.../Tests/ContentTranslationSettingsTest.php | 4 +-
.../Tests/ContentTranslationUITest.php | 20 +-
.../Tests/ContentTranslationWorkflowsTest.php | 2 +-
.../Tests/ContextualDynamicContextTest.php | 22 +-
.../Drupal/datetime/Tests/DatetimeFieldTest.php | 22 +-
.../dblog/lib/Drupal/dblog/Tests/DbLogTest.php | 20 +-
.../edit/lib/Drupal/edit/Tests/EditLoadingTest.php | 229 +++-----------------
.../editor/Tests/EditIntegrationLoadingTest.php | 47 +---
.../lib/Drupal/editor/Tests/EditorAdminTest.php | 6 +-
.../lib/Drupal/email/Tests/EmailFieldTest.php | 2 +-
.../Drupal/entity/Tests/EntityDisplayModeTest.php | 12 +-
.../Tests/EntityReferenceAdminTest.php | 10 +-
.../Tests/EntityReferenceAutoCreateTest.php | 2 +-
.../field/lib/Drupal/field/Tests/FormTest.php | 48 ++--
.../lib/Drupal/field/Tests/NestedFormTest.php | 16 +-
.../lib/Drupal/field/Tests/TranslationWebTest.php | 2 +-
.../lib/Drupal/field/Tests/Views/FieldUITest.php | 6 +-
.../Drupal/field/Tests/reEnableModuleFieldTest.php | 2 +-
.../lib/Drupal/field_ui/Tests/FieldUiTestBase.php | 22 +-
.../Drupal/field_ui/Tests/ManageDisplayTest.php | 32 +--
.../lib/Drupal/field_ui/Tests/ManageFieldsTest.php | 26 +--
.../lib/Drupal/file/Tests/FileFieldDisplayTest.php | 6 +-
.../Drupal/file/Tests/FileFieldRSSContentTest.php | 4 +-
.../Drupal/file/Tests/FileFieldRevisionTest.php | 10 +-
.../lib/Drupal/file/Tests/FileFieldTestBase.php | 10 +-
.../Drupal/file/Tests/FileFieldValidateTest.php | 4 +-
.../lib/Drupal/file/Tests/FileFieldWidgetTest.php | 50 ++---
.../file/lib/Drupal/file/Tests/FileListingTest.php | 2 +-
.../file/Tests/FileManagedFileElementTest.php | 36 +--
.../file/lib/Drupal/file/Tests/SaveUploadTest.php | 28 +--
.../lib/Drupal/filter/Tests/FilterAdminTest.php | 34 +--
.../filter/Tests/FilterDefaultFormatTest.php | 6 +-
.../Drupal/filter/Tests/FilterFormatAccessTest.php | 18 +-
.../lib/Drupal/filter/Tests/FilterHooksTest.php | 8 +-
.../filter/Tests/FilterHtmlImageSecureTest.php | 2 +-
.../lib/Drupal/filter/Tests/FilterSecurityTest.php | 4 +-
.../lib/Drupal/forum/Tests/ForumBlockTest.php | 2 +-
.../lib/Drupal/forum/Tests/ForumIndexTest.php | 4 +-
.../lib/Drupal/forum/Tests/ForumNodeAccessTest.php | 4 +-
.../forum/lib/Drupal/forum/Tests/ForumTest.php | 32 +--
.../Drupal/image/Tests/ImageAdminStylesTest.php | 38 ++--
.../Drupal/image/Tests/ImageFieldDisplayTest.php | 10 +-
.../lib/Drupal/image/Tests/ImageFieldTestBase.php | 2 +-
.../lib/Drupal/image/Tests/ImageStyleFlushTest.php | 10 +-
.../Tests/LanguageBrowserDetectionUnitTest.php | 10 +-
.../Tests/LanguageConfigurationElementTest.php | 8 +-
.../language/Tests/LanguageConfigurationTest.php | 18 +-
.../LanguageCustomLanguageConfigurationTest.php | 8 +-
.../lib/Drupal/language/Tests/LanguageListTest.php | 20 +-
.../language/Tests/LanguageNegotiationInfoTest.php | 4 +-
.../language/Tests/LanguagePathMonolingualTest.php | 8 +-
.../language/Tests/LanguageSwitchingTest.php | 8 +-
.../Tests/LanguageUILanguageNegotiationTest.php | 20 +-
.../language/Tests/LanguageUrlRewritingTest.php | 6 +-
.../link/lib/Drupal/link/Tests/LinkFieldTest.php | 18 +-
.../link/lib/Drupal/link/Tests/LinkFieldUITest.php | 6 +-
.../locale/Tests/LocaleConfigTranslationTest.php | 20 +-
.../lib/Drupal/locale/Tests/LocaleContentTest.php | 20 +-
.../lib/Drupal/locale/Tests/LocaleExportTest.php | 12 +-
.../locale/Tests/LocaleImportFunctionalTest.php | 18 +-
.../lib/Drupal/locale/Tests/LocalePathTest.php | 8 +-
.../Drupal/locale/Tests/LocalePluralFormatTest.php | 26 +--
.../locale/Tests/LocaleTranslationUiTest.php | 76 +++----
.../Drupal/locale/Tests/LocaleUninstallTest.php | 4 +-
.../lib/Drupal/locale/Tests/LocaleUpdateBase.php | 2 +-
.../Drupal/locale/Tests/LocaleUpdateCronTest.php | 6 +-
.../lib/Drupal/locale/Tests/LocaleUpdateTest.php | 46 ++--
.../lib/Drupal/menu/Tests/MenuLanguageTest.php | 12 +-
.../menu/lib/Drupal/menu/Tests/MenuNodeTest.php | 14 +-
.../menu/lib/Drupal/menu/Tests/MenuTest.php | 40 ++--
.../Tests/MultiStepNodeFormBasicOptionsTest.php | 2 +-
.../Drupal/node/Tests/NodeAccessBaseTableTest.php | 2 +-
.../lib/Drupal/node/Tests/NodeAccessFieldTest.php | 2 +-
.../Drupal/node/Tests/NodeAccessRebuildTest.php | 2 +-
.../lib/Drupal/node/Tests/NodeCreationTest.php | 4 +-
.../node/Tests/NodeEntityViewModeAlterTest.php | 2 +-
.../node/Tests/NodeFieldMultilingualTestCase.php | 10 +-
.../lib/Drupal/node/Tests/NodeFormButtonsTest.php | 14 +-
.../lib/Drupal/node/Tests/NodePostSettingsTest.php | 8 +-
.../Drupal/node/Tests/NodeRevisionsAllTestCase.php | 6 +-
.../lib/Drupal/node/Tests/NodeRevisionsTest.php | 6 +-
.../lib/Drupal/node/Tests/NodeTitleXSSTest.php | 2 +-
.../Drupal/node/Tests/NodeTranslationUITest.php | 4 +-
.../node/Tests/NodeTypeInitialLanguageTest.php | 12 +-
.../Drupal/node/Tests/NodeTypePersistenceTest.php | 16 +-
.../node/lib/Drupal/node/Tests/NodeTypeTest.php | 10 +-
.../node/lib/Drupal/node/Tests/PageEditTest.php | 14 +-
.../node/lib/Drupal/node/Tests/PagePreviewTest.php | 14 +-
.../lib/Drupal/node/Tests/Views/BulkFormTest.php | 16 +-
.../lib/Drupal/number/Tests/NumberFieldTest.php | 24 +-
.../Drupal/options/Tests/OptionsFieldUITest.php | 10 +-
.../Drupal/options/Tests/OptionsWidgetsTest.php | 50 ++---
.../lib/Drupal/overlay/Tests/OverlayCloseTest.php | 2 +-
.../Drupal/overlay/Tests/OverlaySettingTest.php | 2 +-
.../path/lib/Drupal/path/Tests/PathAliasTest.php | 26 +--
.../lib/Drupal/path/Tests/PathLanguageTest.php | 16 +-
.../lib/Drupal/path/Tests/PathLanguageUiTest.php | 10 +-
.../lib/Drupal/path/Tests/PathTaxonomyTermTest.php | 6 +-
.../php/lib/Drupal/php/Tests/PhpFilterTest.php | 2 +-
.../Drupal/picture/Tests/PictureAdminUITest.php | 6 +-
.../lib/Drupal/rdf/Tests/TrackerAttributesTest.php | 2 +-
.../rest/Tests/Views/StyleSerializerTest.php | 22 +-
.../search/Tests/SearchAdvancedSearchFormTest.php | 6 +-
.../lib/Drupal/search/Tests/SearchBlockTest.php | 8 +-
.../search/Tests/SearchCommentCountToggleTest.php | 8 +-
.../lib/Drupal/search/Tests/SearchCommentTest.php | 20 +-
.../search/Tests/SearchConfigSettingsFormTest.php | 20 +-
.../Drupal/search/Tests/SearchEmbedFormTest.php | 6 +-
.../lib/Drupal/search/Tests/SearchExactTest.php | 4 +-
.../lib/Drupal/search/Tests/SearchLanguageTest.php | 10 +-
.../Drupal/search/Tests/SearchNodeAccessTest.php | 2 +-
.../search/Tests/SearchNumberMatchingTest.php | 4 +-
.../lib/Drupal/search/Tests/SearchNumbersTest.php | 4 +-
.../lib/Drupal/search/Tests/SearchPageTextTest.php | 6 +-
.../search/Tests/SearchPreprocessLangcodeTest.php | 6 +-
.../lib/Drupal/search/Tests/SearchRankingTest.php | 4 +-
.../Drupal/shortcut/Tests/ShortcutLinksTest.php | 8 +-
.../lib/Drupal/shortcut/Tests/ShortcutSetsTest.php | 14 +-
.../Drupal/simpletest/Tests/BrokenSetUpTest.php | 2 +-
.../lib/Drupal/simpletest/Tests/BrowserTest.php | 2 +-
.../Tests/InstallationProfileModuleTestsTest.php | 2 +-
.../Tests/MissingCheckedRequirementsTest.php | 2 +-
.../lib/Drupal/simpletest/Tests/SimpleTestTest.php | 4 +-
.../lib/Drupal/simpletest/WebTestBase.php | 139 +++++++++---
.../statistics/Tests/StatisticsAdminTest.php | 2 +-
.../syslog/lib/Drupal/syslog/Tests/SyslogTest.php | 2 +-
.../lib/Drupal/system/Tests/Ajax/CommandsTest.php | 34 +--
.../lib/Drupal/system/Tests/Ajax/DialogTest.php | 12 +-
.../system/Tests/Ajax/ElementValidationTest.php | 4 +-
.../Drupal/system/Tests/Ajax/FormValuesTest.php | 6 +-
.../lib/Drupal/system/Tests/Ajax/FrameworkTest.php | 12 +-
.../lib/Drupal/system/Tests/Ajax/MultiFormTest.php | 2 +-
.../Drupal/system/Tests/Batch/ProcessingTest.php | 16 +-
.../Drupal/system/Tests/Common/FormatDateTest.php | 10 +-
.../system/Tests/Condition/ConditionFormTest.php | 2 +-
.../system/Tests/Datetime/DrupalDateTimeTest.php | 2 +-
.../Drupal/system/Tests/Entity/EntityFormTest.php | 6 +-
.../Tests/Entity/EntityTranslationFormTest.php | 6 +-
.../lib/Drupal/system/Tests/File/ConfigTest.php | 2 +-
.../system/Tests/Form/ArbitraryRebuildTest.php | 4 +-
.../lib/Drupal/system/Tests/Form/CheckboxTest.php | 8 +-
.../Drupal/system/Tests/Form/ConfirmFormTest.php | 4 +-
.../system/Tests/Form/ElementsTableSelectTest.php | 6 +-
.../lib/Drupal/system/Tests/Form/EmailTest.php | 6 +-
.../Drupal/system/Tests/Form/FileInclusionTest.php | 4 +-
.../Drupal/system/Tests/Form/FormObjectTest.php | 8 +-
.../lib/Drupal/system/Tests/Form/FormTest.php | 38 ++--
.../lib/Drupal/system/Tests/Form/HTMLIdTest.php | 2 +-
.../Tests/Form/LanguageSelectElementTest.php | 2 +-
.../lib/Drupal/system/Tests/Form/RebuildTest.php | 6 +-
.../lib/Drupal/system/Tests/Form/RedirectTest.php | 12 +-
.../Tests/Form/StateValuesCleanAdvancedTest.php | 2 +-
.../system/Tests/Form/StateValuesCleanTest.php | 2 +-
.../lib/Drupal/system/Tests/Form/StorageTest.php | 28 +--
.../system/Tests/Form/SystemConfigFormTest.php | 2 +-
.../system/Tests/Form/TriggeringElementTest.php | 18 +-
.../lib/Drupal/system/Tests/Form/UrlTest.php | 6 +-
.../Drupal/system/Tests/Form/ValidationTest.php | 32 +--
.../Tests/Installer/InstallerTranslationTest.php | 6 +-
.../lib/Drupal/system/Tests/InstallerTest.php | 2 +-
.../Drupal/system/Tests/Menu/BreadcrumbTest.php | 16 +-
.../Drupal/system/Tests/Module/DependencyTest.php | 30 +--
.../system/Tests/Module/EnableDisableTest.php | 12 +-
.../system/Tests/Module/HookRequirementsTest.php | 2 +-
.../system/Tests/Path/UrlAlterFunctionalTest.php | 2 +-
.../system/Tests/Session/SessionHttpsTest.php | 10 +-
.../Drupal/system/Tests/Session/SessionTest.php | 2 +-
.../system/Tests/System/AccessDeniedTest.php | 8 +-
.../lib/Drupal/system/Tests/System/CronRunTest.php | 2 +-
.../Tests/System/DateFormatsLanguageTest.php | 14 +-
.../Drupal/system/Tests/System/DateTimeTest.php | 6 +-
.../Drupal/system/Tests/System/FrontPageTest.php | 4 +-
.../Tests/System/MainContentFallbackTest.php | 4 +-
.../system/Tests/System/PageNotFoundTest.php | 2 +-
.../Drupal/system/Tests/System/PageTitleTest.php | 6 +-
.../system/Tests/System/SiteMaintenanceTest.php | 10 +-
.../lib/Drupal/system/Tests/System/ThemeTest.php | 12 +-
.../Drupal/system/Tests/Theme/TwigTransTest.php | 6 +-
.../system/Tests/Update/UpdateScriptTest.php | 20 +-
.../system/Tests/Upgrade/BlockUpgradePathTest.php | 4 +-
.../system/Tests/Upgrade/FieldUpgradePathTest.php | 2 +-
.../Tests/Upgrade/FilterFormatUpgradePathTest.php | 2 +-
.../system/Tests/Upgrade/UpgradePathTestBase.php | 6 +-
.../tests/modules/ajax_test/ajax_test.module | 4 +-
.../lib/Drupal/taxonomy/Tests/LegacyTest.php | 2 +-
.../taxonomy/lib/Drupal/taxonomy/Tests/RssTest.php | 6 +-
.../taxonomy/Tests/TaxonomyTermIndentationTest.php | 2 +-
.../Tests/TermFieldMultipleVocabularyTest.php | 4 +-
.../lib/Drupal/taxonomy/Tests/TermFieldTest.php | 2 +-
.../lib/Drupal/taxonomy/Tests/TermIndexTest.php | 6 +-
.../lib/Drupal/taxonomy/Tests/TermLanguageTest.php | 12 +-
.../lib/Drupal/taxonomy/Tests/TermTest.php | 42 ++--
.../lib/Drupal/taxonomy/Tests/TokenReplaceTest.php | 4 +-
.../taxonomy/Tests/VocabularyLanguageTest.php | 10 +-
.../taxonomy/Tests/VocabularyPermissionsTest.php | 10 +-
.../lib/Drupal/taxonomy/Tests/VocabularyTest.php | 18 +-
.../Drupal/telephone/Tests/TelephoneFieldTest.php | 4 +-
.../text/lib/Drupal/text/Tests/TextFieldTest.php | 10 +-
.../toolbar/Tests/ToolbarMenuTranslationTest.php | 8 +-
.../lib/Drupal/tracker/Tests/TrackerTest.php | 12 +-
.../Drupal/translation/Tests/TranslationTest.php | 28 +--
.../lib/Drupal/update/Tests/UpdateUploadTest.php | 4 +-
.../Drupal/user/Tests/UserAccountLinksTests.php | 2 +-
.../user/lib/Drupal/user/Tests/UserAdminTest.php | 10 +-
.../user/lib/Drupal/user/Tests/UserBlocksTests.php | 6 +-
.../user/lib/Drupal/user/Tests/UserCancelTest.php | 38 ++--
.../Drupal/user/Tests/UserCreateFailMailTest.php | 2 +-
.../user/lib/Drupal/user/Tests/UserCreateTest.php | 2 +-
.../user/lib/Drupal/user/Tests/UserEditTest.php | 20 +-
.../Drupal/user/Tests/UserEditedOwnAccountTest.php | 2 +-
.../Drupal/user/Tests/UserLanguageCreationTest.php | 8 +-
.../lib/Drupal/user/Tests/UserLanguageTest.php | 4 +-
.../user/lib/Drupal/user/Tests/UserLoginTest.php | 2 +-
.../Drupal/user/Tests/UserPasswordResetTest.php | 10 +-
.../lib/Drupal/user/Tests/UserPermissionsTest.php | 8 +-
.../user/lib/Drupal/user/Tests/UserPictureTest.php | 8 +-
.../lib/Drupal/user/Tests/UserRegistrationTest.php | 38 ++--
.../lib/Drupal/user/Tests/UserRoleAdminTest.php | 12 +-
.../Drupal/user/Tests/UserRolesAssignmentTest.php | 8 +-
.../user/lib/Drupal/user/Tests/UserSearchTest.php | 8 +-
.../lib/Drupal/user/Tests/UserSignatureTest.php | 8 +-
.../lib/Drupal/user/Tests/UserTimeZoneTest.php | 2 +-
.../UserValidateCurrentPassCustomFormTest.php | 2 +-
.../lib/Drupal/user/Tests/Views/BulkFormTest.php | 10 +-
.../user/Tests/Views/HandlerFilterUserNameTest.php | 6 +-
.../lib/Drupal/views/Tests/Handler/AreaTest.php | 4 +-
.../Drupal/views/Tests/Handler/FilterDateTest.php | 2 +-
.../lib/Drupal/views/Tests/Handler/HandlerTest.php | 4 +-
.../views/Tests/Plugin/ArgumentDefaultTest.php | 2 +-
.../Drupal/views/Tests/Plugin/DisplayFeedTest.php | 4 +-
.../lib/Drupal/views/Tests/Plugin/DisplayTest.php | 2 +-
.../lib/Drupal/views/Tests/Plugin/PagerTest.php | 18 +-
.../lib/Drupal/views/Tests/Wizard/BasicTest.php | 8 +-
.../Drupal/views/Tests/Wizard/ItemsPerPageTest.php | 2 +-
.../lib/Drupal/views/Tests/Wizard/MenuTest.php | 2 +-
.../lib/Drupal/views/Tests/Wizard/SortingTest.php | 4 +-
.../Drupal/views/Tests/Wizard/TaggedWithTest.php | 22 +-
.../lib/Drupal/views_ui/Tests/AnalyzeTest.php | 2 +-
.../lib/Drupal/views_ui/Tests/CachedDataUITest.php | 12 +-
.../Drupal/views_ui/Tests/CustomBooleanTest.php | 4 +-
.../lib/Drupal/views_ui/Tests/DefaultViewsTest.php | 16 +-
.../views_ui/Tests/DisplayAttachmentTest.php | 8 +-
.../views_ui/Tests/DisplayExtenderUITest.php | 4 +-
.../lib/Drupal/views_ui/Tests/DisplayPath.php | 18 +-
.../lib/Drupal/views_ui/Tests/DisplayTest.php | 46 ++--
.../Drupal/views_ui/Tests/ExposedFormUITest.php | 18 +-
.../lib/Drupal/views_ui/Tests/FieldUITest.php | 2 +-
.../Drupal/views_ui/Tests/FilterBooleanWebTest.php | 8 +-
.../lib/Drupal/views_ui/Tests/GroupByTest.php | 6 +-
.../lib/Drupal/views_ui/Tests/HandlerTest.php | 22 +-
.../Drupal/views_ui/Tests/OverrideDisplaysTest.php | 26 +--
.../lib/Drupal/views_ui/Tests/PreviewTest.php | 14 +-
.../lib/Drupal/views_ui/Tests/QueryTest.php | 4 +-
.../Drupal/views_ui/Tests/RearrangeFieldsTest.php | 4 +-
.../lib/Drupal/views_ui/Tests/RedirectTest.php | 6 +-
.../lib/Drupal/views_ui/Tests/RowUITest.php | 6 +-
.../lib/Drupal/views_ui/Tests/SettingsTest.php | 30 +--
.../lib/Drupal/views_ui/Tests/StorageTest.php | 4 +-
.../lib/Drupal/views_ui/Tests/StyleUITest.php | 10 +-
.../lib/Drupal/views_ui/Tests/ViewsUITourTest.php | 2 +-
.../lib/Drupal/standard/Tests/StandardTest.php | 2 +-
302 files changed, 1663 insertions(+), 1854 deletions(-)
diff --git a/core/modules/action/lib/Drupal/action/Tests/BulkFormTest.php b/core/modules/action/lib/Drupal/action/Tests/BulkFormTest.php
index 2ae5dea..ea83db2 100644
--- a/core/modules/action/lib/Drupal/action/Tests/BulkFormTest.php
+++ b/core/modules/action/lib/Drupal/action/Tests/BulkFormTest.php
@@ -60,7 +60,7 @@ public function testBulkForm() {
// Set all nodes to sticky and check that.
$edit += array('action' => 'node_make_sticky_action');
- $this->drupalPost(NULL, $edit, t('Apply'));
+ $this->drupalPostForm(NULL, $edit, t('Apply'));
foreach ($nodes as $node) {
$changed_node = node_load($node->id());
@@ -74,7 +74,7 @@ public function testBulkForm() {
$this->assertTrue($node->isPublished(), 'The node is published.');
$edit = array('action_bulk_form[0]' => TRUE, 'action' => 'node_unpublish_action');
- $this->drupalPost(NULL, $edit, t('Apply'));
+ $this->drupalPostForm(NULL, $edit, t('Apply'));
$this->assertText('Unpublish content was applied to 1 item.');
diff --git a/core/modules/action/lib/Drupal/action/Tests/ConfigurationTest.php b/core/modules/action/lib/Drupal/action/Tests/ConfigurationTest.php
index 3d62bbe..97448ae 100644
--- a/core/modules/action/lib/Drupal/action/Tests/ConfigurationTest.php
+++ b/core/modules/action/lib/Drupal/action/Tests/ConfigurationTest.php
@@ -41,7 +41,7 @@ function testActionConfiguration() {
// Make a POST request to admin/config/system/actions.
$edit = array();
$edit['action'] = Crypt::hashBase64('action_goto_action');
- $this->drupalPost('admin/config/system/actions', $edit, t('Create'));
+ $this->drupalPostForm('admin/config/system/actions', $edit, t('Create'));
$this->assertResponse(200);
// Make a POST request to the individual action configuration page.
@@ -50,7 +50,7 @@ function testActionConfiguration() {
$edit['label'] = $action_label;
$edit['id'] = strtolower($action_label);
$edit['url'] = 'admin';
- $this->drupalPost('admin/config/system/actions/add/' . Crypt::hashBase64('action_goto_action'), $edit, t('Save'));
+ $this->drupalPostForm('admin/config/system/actions/add/' . Crypt::hashBase64('action_goto_action'), $edit, t('Save'));
$this->assertResponse(200);
// Make sure that the new complex action was saved properly.
@@ -65,7 +65,7 @@ function testActionConfiguration() {
$new_action_label = $this->randomName();
$edit['label'] = $new_action_label;
$edit['url'] = 'admin';
- $this->drupalPost(NULL, $edit, t('Save'));
+ $this->drupalPostForm(NULL, $edit, t('Save'));
$this->assertResponse(200);
// Make sure that the action updated properly.
@@ -82,7 +82,7 @@ function testActionConfiguration() {
$this->clickLink(t('Delete'));
$this->assertResponse(200);
$edit = array();
- $this->drupalPost("admin/config/system/actions/configure/$aid/delete", $edit, t('Delete'));
+ $this->drupalPostForm("admin/config/system/actions/configure/$aid/delete", $edit, t('Delete'));
$this->assertResponse(200);
// Make sure that the action was actually deleted.
diff --git a/core/modules/aggregator/lib/Drupal/aggregator/Tests/AggregatorConfigurationTest.php b/core/modules/aggregator/lib/Drupal/aggregator/Tests/AggregatorConfigurationTest.php
index 59d5339..bd6b222 100644
--- a/core/modules/aggregator/lib/Drupal/aggregator/Tests/AggregatorConfigurationTest.php
+++ b/core/modules/aggregator/lib/Drupal/aggregator/Tests/AggregatorConfigurationTest.php
@@ -40,7 +40,7 @@ function testSettingsPage() {
'aggregator_parser' => 'aggregator_test_parser',
'aggregator_processors[aggregator_test_processor]' => 'aggregator_test_processor',
);
- $this->drupalPost('admin/config/services/aggregator/settings', $edit, t('Save configuration'));
+ $this->drupalPostForm('admin/config/services/aggregator/settings', $edit, t('Save configuration'));
$this->assertText(t('The configuration options have been saved.'));
foreach ($edit as $name => $value) {
@@ -53,7 +53,7 @@ function testSettingsPage() {
$edit = array(
'dummy_length' => 100,
);
- $this->drupalPost('admin/config/services/aggregator/settings', $edit, t('Save configuration'));
+ $this->drupalPostForm('admin/config/services/aggregator/settings', $edit, t('Save configuration'));
$this->assertText(t('The configuration options have been saved.'));
$this->assertFieldByName('dummy_length', 100, '"dummy_length" has correct default value.');
diff --git a/core/modules/aggregator/lib/Drupal/aggregator/Tests/AggregatorTestBase.php b/core/modules/aggregator/lib/Drupal/aggregator/Tests/AggregatorTestBase.php
index 4542116..43b4da5 100644
--- a/core/modules/aggregator/lib/Drupal/aggregator/Tests/AggregatorTestBase.php
+++ b/core/modules/aggregator/lib/Drupal/aggregator/Tests/AggregatorTestBase.php
@@ -54,7 +54,7 @@ function setUp() {
*/
function createFeed($feed_url = NULL, array $edit = array()) {
$edit = $this->getFeedEditArray($feed_url, $edit);
- $this->drupalPost('admin/config/services/aggregator/add/feed', $edit, t('Save'));
+ $this->drupalPostForm('admin/config/services/aggregator/add/feed', $edit, t('Save'));
$this->assertRaw(t('The feed %name has been added.', array('%name' => $edit['title'])), format_string('The feed !name has been added.', array('!name' => $edit['title'])));
$fid = db_query("SELECT fid FROM {aggregator_feed} WHERE title = :title AND url = :url", array(':title' => $edit['title'], ':url' => $edit['url']))->fetchField();
@@ -69,7 +69,7 @@ function createFeed($feed_url = NULL, array $edit = array()) {
* Feed object representing the feed.
*/
function deleteFeed(Feed $feed) {
- $this->drupalPost('admin/config/services/aggregator/delete/feed/' . $feed->id(), array(), t('Delete'));
+ $this->drupalPostForm('admin/config/services/aggregator/delete/feed/' . $feed->id(), array(), t('Delete'));
$this->assertRaw(t('The feed %title has been deleted.', array('%title' => $feed->label())), 'Feed deleted successfully.');
}
@@ -186,7 +186,7 @@ function updateFeedItems(Feed $feed, $expected_count = NULL) {
* Feed object representing the feed.
*/
function removeFeedItems(Feed $feed) {
- $this->drupalPost('admin/config/services/aggregator/remove/' . $feed->id(), array(), t('Remove items'));
+ $this->drupalPostForm('admin/config/services/aggregator/remove/' . $feed->id(), array(), t('Remove items'));
$this->assertRaw(t('The news items from %title have been removed.', array('%title' => $feed->label())), 'Feed items removed.');
}
@@ -362,7 +362,7 @@ function createSampleNodes($count = 5) {
$edit = array();
$edit['title'] = $this->randomName();
$edit["body[$langcode][0][value]"] = $this->randomName();
- $this->drupalPost('node/add/article', $edit, t('Save'));
+ $this->drupalPostForm('node/add/article', $edit, t('Save'));
}
}
diff --git a/core/modules/aggregator/lib/Drupal/aggregator/Tests/CategorizeFeedItemTest.php b/core/modules/aggregator/lib/Drupal/aggregator/Tests/CategorizeFeedItemTest.php
index 2485f17..404f156 100644
--- a/core/modules/aggregator/lib/Drupal/aggregator/Tests/CategorizeFeedItemTest.php
+++ b/core/modules/aggregator/lib/Drupal/aggregator/Tests/CategorizeFeedItemTest.php
@@ -30,7 +30,7 @@ function testCategorizeFeedItem() {
// Simulate form submission on "admin/config/services/aggregator/add/category".
$edit = array('title' => $this->randomName(10), 'description' => '');
- $this->drupalPost('admin/config/services/aggregator/add/category', $edit, t('Save'));
+ $this->drupalPostForm('admin/config/services/aggregator/add/category', $edit, t('Save'));
$this->assertRaw(t('The category %title has been added.', array('%title' => $edit['title'])), format_string('The category %title has been added.', array('%title' => $edit['title'])));
$category = db_query("SELECT * FROM {aggregator_category} WHERE title = :title", array(':title' => $edit['title']))->fetch();
diff --git a/core/modules/aggregator/lib/Drupal/aggregator/Tests/CategorizeFeedTest.php b/core/modules/aggregator/lib/Drupal/aggregator/Tests/CategorizeFeedTest.php
index 569f26a..56aef54 100644
--- a/core/modules/aggregator/lib/Drupal/aggregator/Tests/CategorizeFeedTest.php
+++ b/core/modules/aggregator/lib/Drupal/aggregator/Tests/CategorizeFeedTest.php
@@ -26,11 +26,11 @@ function testCategorizeFeed() {
// Create 2 categories.
$category_1 = array('title' => $this->randomName(10), 'description' => '');
- $this->drupalPost('admin/config/services/aggregator/add/category', $category_1, t('Save'));
+ $this->drupalPostForm('admin/config/services/aggregator/add/category', $category_1, t('Save'));
$this->assertRaw(t('The category %title has been added.', array('%title' => $category_1['title'])), format_string('The category %title has been added.', array('%title' => $category_1['title'])));
$category_2 = array('title' => $this->randomName(10), 'description' => '');
- $this->drupalPost('admin/config/services/aggregator/add/category', $category_2, t('Save'));
+ $this->drupalPostForm('admin/config/services/aggregator/add/category', $category_2, t('Save'));
$this->assertRaw(t('The category %title has been added.', array('%title' => $category_2['title'])), format_string('The category %title has been added.', array('%title' => $category_2['title'])));
// Get categories from database.
diff --git a/core/modules/aggregator/lib/Drupal/aggregator/Tests/ImportOpmlTest.php b/core/modules/aggregator/lib/Drupal/aggregator/Tests/ImportOpmlTest.php
index 7a9f463..6732d2d 100644
--- a/core/modules/aggregator/lib/Drupal/aggregator/Tests/ImportOpmlTest.php
+++ b/core/modules/aggregator/lib/Drupal/aggregator/Tests/ImportOpmlTest.php
@@ -66,7 +66,7 @@ function validateImportFormFields() {
$before = db_query('SELECT COUNT(*) FROM {aggregator_feed}')->fetchField();
$edit = array();
- $this->drupalPost('admin/config/services/aggregator/add/opml', $edit, t('Import'));
+ $this->drupalPostForm('admin/config/services/aggregator/add/opml', $edit, t('Import'));
$this->assertRaw(t('You must either upload a file or enter a URL.'), 'Error if no fields are filled.');
$path = $this->getEmptyOpml();
@@ -74,11 +74,11 @@ function validateImportFormFields() {
'files[upload]' => $path,
'remote' => file_create_url($path),
);
- $this->drupalPost('admin/config/services/aggregator/add/opml', $edit, t('Import'));
+ $this->drupalPostForm('admin/config/services/aggregator/add/opml', $edit, t('Import'));
$this->assertRaw(t('You must either upload a file or enter a URL.'), 'Error if both fields are filled.');
$edit = array('remote' => 'invalidUrl://empty');
- $this->drupalPost('admin/config/services/aggregator/add/opml', $edit, t('Import'));
+ $this->drupalPostForm('admin/config/services/aggregator/add/opml', $edit, t('Import'));
$this->assertText(t('The URL invalidUrl://empty is not valid.'), 'Error if the URL is invalid.');
$after = db_query('SELECT COUNT(*) FROM {aggregator_feed}')->fetchField();
@@ -92,11 +92,11 @@ function submitImportForm() {
$before = db_query('SELECT COUNT(*) FROM {aggregator_feed}')->fetchField();
$form['files[upload]'] = $this->getInvalidOpml();
- $this->drupalPost('admin/config/services/aggregator/add/opml', $form, t('Import'));
+ $this->drupalPostForm('admin/config/services/aggregator/add/opml', $form, t('Import'));
$this->assertText(t('No new feed has been added.'), 'Attempting to upload invalid XML.');
$edit = array('remote' => file_create_url($this->getEmptyOpml()));
- $this->drupalPost('admin/config/services/aggregator/add/opml', $edit, t('Import'));
+ $this->drupalPostForm('admin/config/services/aggregator/add/opml', $edit, t('Import'));
$this->assertText(t('No new feed has been added.'), 'Attempting to load empty OPML from remote URL.');
$after = db_query('SELECT COUNT(*) FROM {aggregator_feed}')->fetchField();
@@ -123,7 +123,7 @@ function submitImportForm() {
'refresh' => '900',
'category[1]' => $category,
);
- $this->drupalPost('admin/config/services/aggregator/add/opml', $edit, t('Import'));
+ $this->drupalPostForm('admin/config/services/aggregator/add/opml', $edit, t('Import'));
$this->assertRaw(t('A feed with the URL %url already exists.', array('%url' => $feeds[0]['url'])), 'Verifying that a duplicate URL was identified');
$this->assertRaw(t('A feed named %title already exists.', array('%title' => $feeds[1]['title'])), 'Verifying that a duplicate title was identified');
diff --git a/core/modules/aggregator/lib/Drupal/aggregator/Tests/UpdateFeedItemTest.php b/core/modules/aggregator/lib/Drupal/aggregator/Tests/UpdateFeedItemTest.php
index 2cc1c8c..0227612 100644
--- a/core/modules/aggregator/lib/Drupal/aggregator/Tests/UpdateFeedItemTest.php
+++ b/core/modules/aggregator/lib/Drupal/aggregator/Tests/UpdateFeedItemTest.php
@@ -44,7 +44,7 @@ function testUpdateFeedItem() {
$this->drupalGet($edit['url']);
$this->assertResponse(array(200), format_string('URL !url is accessible', array('!url' => $edit['url'])));
- $this->drupalPost('admin/config/services/aggregator/add/feed', $edit, t('Save'));
+ $this->drupalPostForm('admin/config/services/aggregator/add/feed', $edit, t('Save'));
$this->assertRaw(t('The feed %name has been added.', array('%name' => $edit['title'])), format_string('The feed !name has been added.', array('!name' => $edit['title'])));
$fid = db_query("SELECT fid FROM {aggregator_feed} WHERE url = :url", array(':url' => $edit['url']))->fetchField();
diff --git a/core/modules/aggregator/lib/Drupal/aggregator/Tests/UpdateFeedTest.php b/core/modules/aggregator/lib/Drupal/aggregator/Tests/UpdateFeedTest.php
index 8b25bc7..8b1f0e7 100644
--- a/core/modules/aggregator/lib/Drupal/aggregator/Tests/UpdateFeedTest.php
+++ b/core/modules/aggregator/lib/Drupal/aggregator/Tests/UpdateFeedTest.php
@@ -33,7 +33,7 @@ function testUpdateFeed() {
if (isset($feed->{$same_field}->value)) {
$edit[$same_field] = $feed->{$same_field}->value;
}
- $this->drupalPost('admin/config/services/aggregator/edit/feed/' . $feed->id(), $edit, t('Save'));
+ $this->drupalPostForm('admin/config/services/aggregator/edit/feed/' . $feed->id(), $edit, t('Save'));
$this->assertRaw(t('The feed %name has been updated.', array('%name' => $edit['title'])), format_string('The feed %name has been updated.', array('%name' => $edit['title'])));
// Check feed data.
diff --git a/core/modules/ban/lib/Drupal/ban/Tests/IpAddressBlockingTest.php b/core/modules/ban/lib/Drupal/ban/Tests/IpAddressBlockingTest.php
index 8009de3..0e5cacf 100644
--- a/core/modules/ban/lib/Drupal/ban/Tests/IpAddressBlockingTest.php
+++ b/core/modules/ban/lib/Drupal/ban/Tests/IpAddressBlockingTest.php
@@ -38,7 +38,7 @@ function testIPAddressValidation() {
// Ban a valid IP address.
$edit = array();
$edit['ip'] = '192.168.1.1';
- $this->drupalPost('admin/config/people/ban', $edit, t('Add'));
+ $this->drupalPostForm('admin/config/people/ban', $edit, t('Add'));
$ip = db_query("SELECT iid from {ban_ip} WHERE ip = :ip", array(':ip' => $edit['ip']))->fetchField();
$this->assertTrue($ip, 'IP address found in database.');
$this->assertRaw(t('The IP address %ip has been banned.', array('%ip' => $edit['ip'])), 'IP address was banned.');
@@ -46,30 +46,30 @@ function testIPAddressValidation() {
// Try to block an IP address that's already blocked.
$edit = array();
$edit['ip'] = '192.168.1.1';
- $this->drupalPost('admin/config/people/ban', $edit, t('Add'));
+ $this->drupalPostForm('admin/config/people/ban', $edit, t('Add'));
$this->assertText(t('This IP address is already banned.'));
// Try to block a reserved IP address.
$edit = array();
$edit['ip'] = '255.255.255.255';
- $this->drupalPost('admin/config/people/ban', $edit, t('Add'));
+ $this->drupalPostForm('admin/config/people/ban', $edit, t('Add'));
$this->assertText(t('Enter a valid IP address.'));
// Try to block a reserved IP address.
$edit = array();
$edit['ip'] = 'test.example.com';
- $this->drupalPost('admin/config/people/ban', $edit, t('Add'));
+ $this->drupalPostForm('admin/config/people/ban', $edit, t('Add'));
$this->assertText(t('Enter a valid IP address.'));
// Submit an empty form.
$edit = array();
$edit['ip'] = '';
- $this->drupalPost('admin/config/people/ban', $edit, t('Add'));
+ $this->drupalPostForm('admin/config/people/ban', $edit, t('Add'));
$this->assertText(t('Enter a valid IP address.'));
// Pass an IP address as a URL parameter and submit it.
$submit_ip = '1.2.3.4';
- $this->drupalPost('admin/config/people/ban/' . $submit_ip, NULL, t('Add'));
+ $this->drupalPostForm('admin/config/people/ban/' . $submit_ip, NULL, t('Add'));
$ip = db_query("SELECT iid from {ban_ip} WHERE ip = :ip", array(':ip' => $submit_ip))->fetchField();
$this->assertTrue($ip, 'IP address found in database');
$this->assertRaw(t('The IP address %ip has been banned.', array('%ip' => $submit_ip)), 'IP address was banned.');
@@ -79,7 +79,7 @@ function testIPAddressValidation() {
// TODO: On some systems this test fails due to a bug/inconsistency in cURL.
// $edit = array();
// $edit['ip'] = \Drupal::request()->getClientIP();
- // $this->drupalPost('admin/config/people/ban', $edit, t('Save'));
+ // $this->drupalPostForm('admin/config/people/ban', $edit, t('Save'));
// $this->assertText(t('You may not ban your own IP address.'));
}
}
diff --git a/core/modules/block/custom_block/lib/Drupal/custom_block/Tests/CustomBlockCreationTest.php b/core/modules/block/custom_block/lib/Drupal/custom_block/Tests/CustomBlockCreationTest.php
index 3ce4513..5dbf094 100644
--- a/core/modules/block/custom_block/lib/Drupal/custom_block/Tests/CustomBlockCreationTest.php
+++ b/core/modules/block/custom_block/lib/Drupal/custom_block/Tests/CustomBlockCreationTest.php
@@ -52,7 +52,7 @@ public function testCustomBlockCreation() {
$langcode = Language::LANGCODE_NOT_SPECIFIED;
$edit['info'] = $this->randomName(8);
$edit["block_body[$langcode][0][value]"] = $this->randomName(16);
- $this->drupalPost('block/add/basic', $edit, t('Save'));
+ $this->drupalPostForm('block/add/basic', $edit, t('Save'));
// Check that the Basic block has been created.
$this->assertRaw(format_string('!block %name has been created.', array(
@@ -67,7 +67,7 @@ public function testCustomBlockCreation() {
// Check that attempting to create another block with the same value for
// 'info' returns an error.
- $this->drupalPost('block/add/basic', $edit, t('Save'));
+ $this->drupalPostForm('block/add/basic', $edit, t('Save'));
// Check that the Basic block has been created.
$this->assertRaw(format_string('A block with description %name already exists.', array(
@@ -88,7 +88,7 @@ public function testDefaultCustomBlockCreation() {
$edit['info'] = $this->randomName(8);
$edit["block_body[$langcode][0][value]"] = $this->randomName(16);
// Don't pass the custom block type in the url so the default is forced.
- $this->drupalPost('block/add', $edit, t('Save'));
+ $this->drupalPostForm('block/add', $edit, t('Save'));
// Check that the block has been created and that it is a basic block.
$this->assertRaw(format_string('!block %name has been created.', array(
@@ -149,7 +149,7 @@ public function testBlockDelete() {
$edit['info'] = $this->randomName(8);
$body = $this->randomName(16);
$edit["block_body[$langcode][0][value]"] = $body;
- $this->drupalPost('block/add/basic', $edit, t('Save'));
+ $this->drupalPostForm('block/add/basic', $edit, t('Save'));
// Place the block.
$instance = array(
@@ -159,7 +159,7 @@ public function testBlockDelete() {
);
$block = entity_load('custom_block', 1);
$url = 'admin/structure/block/add/custom_block:' . $block->uuid() . '/' . \Drupal::config('system.theme')->get('default');
- $this->drupalPost($url, $instance, t('Save block'));
+ $this->drupalPostForm($url, $instance, t('Save block'));
$block = custom_block_load(1);
@@ -174,7 +174,7 @@ public function testBlockDelete() {
$this->drupalGet('block/1/delete');
$this->assertText(format_plural(1, 'This will also remove 1 placed block instance.', 'This will also remove @count placed block instance.'));
- $this->drupalPost(NULL, array(), 'Delete');
+ $this->drupalPostForm(NULL, array(), 'Delete');
$this->assertRaw(t('Custom block %name has been deleted.', array('%name' => $edit['info'])));
// Create another block and force the plugin cache to flush.
@@ -183,7 +183,7 @@ public function testBlockDelete() {
$edit2['info'] = $this->randomName(8);
$body2 = $this->randomName(16);
$edit2["block_body[$langcode][0][value]"] = $body2;
- $this->drupalPost('block/add/basic', $edit2, t('Save'));
+ $this->drupalPostForm('block/add/basic', $edit2, t('Save'));
$this->assertNoRaw('Error message');
@@ -193,7 +193,7 @@ public function testBlockDelete() {
$edit3['info'] = $this->randomName(8);
$body = $this->randomName(16);
$edit3["block_body[$langcode][0][value]"] = $body;
- $this->drupalPost('block/add/basic', $edit3, t('Save'));
+ $this->drupalPostForm('block/add/basic', $edit3, t('Save'));
// Show the delete confirm form.
$this->drupalGet('block/3/delete');
diff --git a/core/modules/block/custom_block/lib/Drupal/custom_block/Tests/CustomBlockFieldTest.php b/core/modules/block/custom_block/lib/Drupal/custom_block/Tests/CustomBlockFieldTest.php
index 53f8f5a..118467d 100644
--- a/core/modules/block/custom_block/lib/Drupal/custom_block/Tests/CustomBlockFieldTest.php
+++ b/core/modules/block/custom_block/lib/Drupal/custom_block/Tests/CustomBlockFieldTest.php
@@ -99,7 +99,7 @@ public function testBlockFields() {
$this->field['field_name'] . '[und][0][url]' => 'http://example.com',
$this->field['field_name'] . '[und][0][title]' => 'Example.com'
);
- $this->drupalPost(NULL, $edit, t('Save'));
+ $this->drupalPostForm(NULL, $edit, t('Save'));
$block = entity_load('custom_block', 1);
$url = 'admin/structure/block/add/custom_block:' . $block->uuid() . '/' . \Drupal::config('system.theme')->get('default');
// Place the block.
@@ -108,7 +108,7 @@ public function testBlockFields() {
'settings[label]' => $edit['info'],
'region' => 'sidebar_first',
);
- $this->drupalPost($url, $instance, t('Save block'));
+ $this->drupalPostForm($url, $instance, t('Save block'));
// Navigate to home page.
$this->drupalGet('');
$this->assertLinkByHref('http://example.com');
diff --git a/core/modules/block/custom_block/lib/Drupal/custom_block/Tests/CustomBlockListTest.php b/core/modules/block/custom_block/lib/Drupal/custom_block/Tests/CustomBlockListTest.php
index d7d8c5c..503749a 100644
--- a/core/modules/block/custom_block/lib/Drupal/custom_block/Tests/CustomBlockListTest.php
+++ b/core/modules/block/custom_block/lib/Drupal/custom_block/Tests/CustomBlockListTest.php
@@ -67,7 +67,7 @@ public function testListing() {
$langcode = Language::LANGCODE_NOT_SPECIFIED;
$edit['info'] = $label;
$edit["block_body[$langcode][0][value]"] = $this->randomName(16);
- $this->drupalPost(NULL, $edit, t('Save'));
+ $this->drupalPostForm(NULL, $edit, t('Save'));
// Confirm that once the user returns to the listing, the text of the label
// (versus elsewhere on the page).
@@ -93,7 +93,7 @@ public function testListing() {
$this->assertResponse(200);
$this->assertTitle(strip_tags(t('Edit custom block %label', array('%label' => $label)) . ' | Drupal'));
$edit = array('info' => $new_label);
- $this->drupalPost(NULL, $edit, t('Save'));
+ $this->drupalPostForm(NULL, $edit, t('Save'));
}
else {
$this->fail('Did not find Albatross block in the database.');
@@ -109,7 +109,7 @@ public function testListing() {
$this->clickLink($delete_text);
$this->assertResponse(200);
$this->assertTitle(strip_tags(t('Are you sure you want to delete %label?', array('%label' => $new_label)) . ' | Drupal'));
- $this->drupalPost(NULL, array(), $delete_text);
+ $this->drupalPostForm(NULL, array(), $delete_text);
// Verify that the text of the label and machine name does not appear in
// the list (though it may appear elsewhere on the page).
diff --git a/core/modules/block/custom_block/lib/Drupal/custom_block/Tests/CustomBlockTypeTest.php b/core/modules/block/custom_block/lib/Drupal/custom_block/Tests/CustomBlockTypeTest.php
index 9b0dc0b..e36fc48 100644
--- a/core/modules/block/custom_block/lib/Drupal/custom_block/Tests/CustomBlockTypeTest.php
+++ b/core/modules/block/custom_block/lib/Drupal/custom_block/Tests/CustomBlockTypeTest.php
@@ -61,7 +61,7 @@ public function testCustomBlockTypeCreation() {
'id' => 'foo',
'label' => 'title for foo',
);
- $this->drupalPost('admin/structure/block/custom-blocks/types/add', $edit, t('Save'));
+ $this->drupalPostForm('admin/structure/block/custom-blocks/types/add', $edit, t('Save'));
$block_type = entity_load('custom_block_type', 'foo');
$this->assertTrue($block_type, 'The new block type has been created.');
@@ -90,7 +90,7 @@ public function testCustomBlockTypeEditing() {
$edit = array(
'label' => 'Bar',
);
- $this->drupalPost('admin/structure/block/custom-blocks/manage/basic', $edit, t('Save'));
+ $this->drupalPostForm('admin/structure/block/custom-blocks/manage/basic', $edit, t('Save'));
field_info_cache_clear();
$this->drupalGet('block/add');
@@ -99,9 +99,9 @@ public function testCustomBlockTypeEditing() {
$this->assertEqual(url('block/add/basic', array('absolute' => TRUE)), $this->getUrl(), 'Original machine name was used in URL.');
// Remove the body field.
- $this->drupalPost('admin/structure/block/custom-blocks/manage/basic/fields/custom_block.basic.block_body/delete', array(), t('Delete'));
+ $this->drupalPostForm('admin/structure/block/custom-blocks/manage/basic/fields/custom_block.basic.block_body/delete', array(), t('Delete'));
// Resave the settings for this type.
- $this->drupalPost('admin/structure/block/custom-blocks/manage/basic', array(), t('Save'));
+ $this->drupalPostForm('admin/structure/block/custom-blocks/manage/basic', array(), t('Save'));
// Check that the body field doesn't exist.
$this->drupalGet('block/add/basic');
$this->assertNoRaw('Block body', 'Body field was not found.');
@@ -160,7 +160,7 @@ public function testsCustomBlockAddTypes() {
$this->clickLink(t('Add custom block'));
$this->clickLink('foo');
$edit = array('info' => $this->randomName(8));
- $this->drupalPost(NULL, $edit, t('Save'));
+ $this->drupalPostForm(NULL, $edit, t('Save'));
$blocks = $storage_controller->loadByProperties(array('info' => $edit['info']));
if (!empty($blocks)) {
$block = reset($blocks);
@@ -177,7 +177,7 @@ public function testsCustomBlockAddTypes() {
$this->clickLink(t('Add custom block'));
$this->clickLink('foo');
$edit = array('info' => $this->randomName(8));
- $this->drupalPost(NULL, $edit, t('Save'));
+ $this->drupalPostForm(NULL, $edit, t('Save'));
$blocks = $storage_controller->loadByProperties(array('info' => $edit['info']));
if (!empty($blocks)) {
$block = reset($blocks);
diff --git a/core/modules/block/custom_block/lib/Drupal/custom_block/Tests/PageEditTest.php b/core/modules/block/custom_block/lib/Drupal/custom_block/Tests/PageEditTest.php
index dab0eb6..33dabbd 100644
--- a/core/modules/block/custom_block/lib/Drupal/custom_block/Tests/PageEditTest.php
+++ b/core/modules/block/custom_block/lib/Drupal/custom_block/Tests/PageEditTest.php
@@ -38,7 +38,7 @@ public function testPageEdit() {
$edit = array();
$edit['info'] = drupal_strtolower($this->randomName(8));
$edit[$body_key] = $this->randomName(16);
- $this->drupalPost('block/add/basic', $edit, t('Save'));
+ $this->drupalPostForm('block/add/basic', $edit, t('Save'));
// Check that the block exists in the database.
$blocks = \Drupal::entityQuery('custom_block')->condition('info', $edit['info'])->execute();
@@ -55,7 +55,7 @@ public function testPageEdit() {
$edit[$title_key] = $this->randomName(8);
$edit[$body_key] = $this->randomName(16);
// Stay on the current page, without reloading.
- $this->drupalPost(NULL, $edit, t('Save'));
+ $this->drupalPostForm(NULL, $edit, t('Save'));
// Edit the same block, creating a new revision.
$this->drupalGet("block/" . $block->id());
@@ -63,7 +63,7 @@ public function testPageEdit() {
$edit['info'] = $this->randomName(8);
$edit[$body_key] = $this->randomName(16);
$edit['revision'] = TRUE;
- $this->drupalPost(NULL, $edit, t('Save'));
+ $this->drupalPostForm(NULL, $edit, t('Save'));
// Ensure that the block revision has been created.
$revised_block = entity_load('custom_block', $block->id->value, TRUE);
@@ -71,7 +71,7 @@ public function testPageEdit() {
// Test deleting the block.
$this->drupalGet("block/" . $revised_block->id());
- $this->drupalPost(NULL, array(), t('Delete'));
+ $this->drupalPostForm(NULL, array(), t('Delete'));
$this->assertText(format_string('Are you sure you want to delete !label?', array('!label' => $revised_block->label())));
}
diff --git a/core/modules/block/lib/Drupal/block/Tests/BlockAdminThemeTest.php b/core/modules/block/lib/Drupal/block/Tests/BlockAdminThemeTest.php
index c3a220f..d553440 100644
--- a/core/modules/block/lib/Drupal/block/Tests/BlockAdminThemeTest.php
+++ b/core/modules/block/lib/Drupal/block/Tests/BlockAdminThemeTest.php
@@ -44,7 +44,7 @@ function testAdminTheme() {
// Enable admin theme and confirm that tab is accessible.
theme_enable(array('bartik'));
$edit['admin_theme'] = 'bartik';
- $this->drupalPost('admin/appearance', $edit, t('Save configuration'));
+ $this->drupalPostForm('admin/appearance', $edit, t('Save configuration'));
$this->drupalGet('admin/structure/block/list/bartik');
$this->assertResponse(200);
}
diff --git a/core/modules/block/lib/Drupal/block/Tests/BlockInvalidRegionTest.php b/core/modules/block/lib/Drupal/block/Tests/BlockInvalidRegionTest.php
index 54417f8..1faddcb 100644
--- a/core/modules/block/lib/Drupal/block/Tests/BlockInvalidRegionTest.php
+++ b/core/modules/block/lib/Drupal/block/Tests/BlockInvalidRegionTest.php
@@ -52,11 +52,11 @@ function testBlockInInvalidRegion() {
$warning_message = t('The block %info was assigned to the invalid region %region and has been disabled.', array('%info' => $block->id(), '%region' => 'invalid_region'));
// Clearing the cache should disable the test block placed in the invalid region.
- $this->drupalPost('admin/config/development/performance', array(), 'Clear all caches');
+ $this->drupalPostForm('admin/config/development/performance', array(), 'Clear all caches');
$this->assertRaw($warning_message, 'Enabled block was in the invalid region and has been disabled.');
// Clear the cache to check if the warning message is not triggered.
- $this->drupalPost('admin/config/development/performance', array(), 'Clear all caches');
+ $this->drupalPostForm('admin/config/development/performance', array(), 'Clear all caches');
$this->assertNoRaw($warning_message, 'Disabled block in the invalid region will not trigger the warning.');
// Place disabled test block in the invalid region of the default theme.
@@ -65,7 +65,7 @@ function testBlockInInvalidRegion() {
$block->save();
// Clear the cache to check if the warning message is not triggered.
- $this->drupalPost('admin/config/development/performance', array(), 'Clear all caches');
+ $this->drupalPostForm('admin/config/development/performance', array(), 'Clear all caches');
$this->assertNoRaw($warning_message, 'Disabled block in the invalid region will not trigger the warning.');
}
}
diff --git a/core/modules/block/lib/Drupal/block/Tests/BlockLanguageTest.php b/core/modules/block/lib/Drupal/block/Tests/BlockLanguageTest.php
index a078821..915e4bb 100644
--- a/core/modules/block/lib/Drupal/block/Tests/BlockLanguageTest.php
+++ b/core/modules/block/lib/Drupal/block/Tests/BlockLanguageTest.php
@@ -45,7 +45,7 @@ function setUp() {
$edit = array(
'predefined_langcode' => 'fr',
);
- $this->drupalPost('admin/config/regional/language/add', $edit, t('Add language'));
+ $this->drupalPostForm('admin/config/regional/language/add', $edit, t('Add language'));
$this->assertText('French', 'Language added successfully.');
}
@@ -65,13 +65,13 @@ public function testLanguageBlockVisibility() {
'machine_name' => strtolower($this->randomName(8)),
'region' => 'sidebar_first',
);
- $this->drupalPost('admin/structure/block/add/system_powered_by_block' . '/' . $default_theme, $edit, t('Save block'));
+ $this->drupalPostForm('admin/structure/block/add/system_powered_by_block' . '/' . $default_theme, $edit, t('Save block'));
// Change the default language.
$edit = array(
'site_default_language' => 'fr',
);
- $this->drupalpost('admin/config/regional/settings', $edit, t('Save configuration'));
+ $this->drupalPostForm('admin/config/regional/settings', $edit, t('Save configuration'));
// Reset the static cache of the language list.
drupal_static_reset('language_list');
@@ -109,7 +109,7 @@ public function testLanguageBlockVisibilityLanguageDelete() {
$this->assertTrue('fr' === $language, 'Language is set in the block configuration.');
// Delete the language.
- $this->drupalPost('admin/config/regional/language/delete/fr', array(), t('Delete'));
+ $this->drupalPostForm('admin/config/regional/language/delete/fr', array(), t('Delete'));
// Check that the language is no longer stored in the configuration after
// it is deleted.
diff --git a/core/modules/block/lib/Drupal/block/Tests/BlockTest.php b/core/modules/block/lib/Drupal/block/Tests/BlockTest.php
index e90e407..536a71c 100644
--- a/core/modules/block/lib/Drupal/block/Tests/BlockTest.php
+++ b/core/modules/block/lib/Drupal/block/Tests/BlockTest.php
@@ -40,7 +40,7 @@ function testBlockVisibility() {
// authenticated users.
$edit['visibility[path][pages]'] = 'user*';
$edit['visibility[role][roles][' . DRUPAL_AUTHENTICATED_RID . ']'] = TRUE;
- $this->drupalPost('admin/structure/block/add/' . $block_name . '/' . $default_theme, $edit, t('Save block'));
+ $this->drupalPostForm('admin/structure/block/add/' . $block_name . '/' . $default_theme, $edit, t('Save block'));
$this->assertText('The block configuration has been saved.', 'Block was saved');
$this->drupalGet('');
@@ -80,7 +80,7 @@ function testBlockVisibilityListedEmpty() {
);
// Set the block to be hidden on any user path, and to be shown only to
// authenticated users.
- $this->drupalPost('admin/structure/block/add/' . $block_name . '/' . $default_theme, $edit, t('Save block'));
+ $this->drupalPostForm('admin/structure/block/add/' . $block_name . '/' . $default_theme, $edit, t('Save block'));
$this->assertText('The block configuration has been saved.', 'Block was saved');
$this->drupalGet('user');
@@ -108,7 +108,7 @@ function testBlock() {
$block['region'] = 'header';
// Set block title to confirm that interface works and override any custom titles.
- $this->drupalPost('admin/structure/block/add/' . $block['id'] . '/' . $block['theme'], array('settings[label]' => $block['settings[label]'], 'machine_name' => $block['machine_name'], 'region' => $block['region']), t('Save block'));
+ $this->drupalPostForm('admin/structure/block/add/' . $block['id'] . '/' . $block['theme'], array('settings[label]' => $block['settings[label]'], 'machine_name' => $block['machine_name'], 'region' => $block['region']), t('Save block'));
$this->assertText(t('The block configuration has been saved.'), 'Block title set.');
// Check to see if the block was created by checking its configuration.
$instance = entity_load('block', $block['theme'] . '.' . $block['machine_name']);
@@ -123,7 +123,7 @@ function testBlock() {
// Set the block to the disabled region.
$edit = array();
$edit['blocks[' . $block['theme'] . '.' . $block['machine_name'] . '][region]'] = -1;
- $this->drupalPost('admin/structure/block', $edit, t('Save blocks'));
+ $this->drupalPostForm('admin/structure/block', $edit, t('Save blocks'));
// Confirm that the block is now listed as disabled.
$this->assertText(t('The block settings have been updated.'), 'Block successfully move to disabled region.');
@@ -138,9 +138,9 @@ function testBlock() {
// Test deleting the block from the edit form.
$this->drupalGet('admin/structure/block/manage/' . $block['theme'] . '.' . $block['machine_name']);
- $this->drupalPost(NULL, array(), t('Delete'));
+ $this->drupalPostForm(NULL, array(), t('Delete'));
$this->assertRaw(t('Are you sure you want to delete the block %name?', array('%name' => $block['settings[label]'])));
- $this->drupalPost(NULL, array(), t('Delete'));
+ $this->drupalPostForm(NULL, array(), t('Delete'));
$this->assertRaw(t('The block %name has been removed.', array('%name' => $block['settings[label]'])));
}
@@ -157,7 +157,7 @@ public function testBlockThemeSelector() {
$block['machine_name'] = strtolower($this->randomName(8));
$block['theme'] = $theme;
$block['region'] = 'content';
- $this->drupalPost('admin/structure/block/add/system_powered_by_block', $block, t('Save block'));
+ $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=' . drupal_html_class($theme . ':' . $block['machine_name']));
@@ -184,7 +184,7 @@ function testHideBlockTitle() {
'region' => 'sidebar_first',
'settings[label]' => $title,
);
- $this->drupalPost('admin/structure/block/add/' . $block_name . '/' . $default_theme, $edit, t('Save block'));
+ $this->drupalPostForm('admin/structure/block/add/' . $block_name . '/' . $default_theme, $edit, t('Save block'));
$this->assertText('The block configuration has been saved.', 'Block was saved');
$this->drupalGet('user');
@@ -193,7 +193,7 @@ function testHideBlockTitle() {
$edit = array(
'settings[label_display]' => FALSE,
);
- $this->drupalPost('admin/structure/block/manage/' . $default_theme . '.' . $machine_name, $edit, t('Save block'));
+ $this->drupalPostForm('admin/structure/block/manage/' . $default_theme . '.' . $machine_name, $edit, t('Save block'));
$this->assertText('The block configuration has been saved.', 'Block was saved');
$this->drupalGet('user');
@@ -217,7 +217,7 @@ function moveBlockToRegion(array $block, $region) {
$block += array('theme' => \Drupal::config('system.theme')->get('default'));
$edit = array();
$edit['blocks[' . $block['theme'] . '.' . $block['machine_name'] . '][region]'] = $region;
- $this->drupalPost('admin/structure/block', $edit, t('Save blocks'));
+ $this->drupalPostForm('admin/structure/block', $edit, t('Save blocks'));
// Confirm that the block was moved to the proper region.
$this->assertText(t('The block settings have been updated.'), format_string('Block successfully moved to %region_name region.', array( '%region_name' => $region)));
@@ -325,13 +325,13 @@ function testBlockModuleDisable() {
'machine_name' => strtolower($this->randomName(8)),
'region' => 'sidebar_first',
);
- $this->drupalPost('admin/structure/block/add/system_powered_by_block/stark', $edit, t('Save block'));
+ $this->drupalPostForm('admin/structure/block/add/system_powered_by_block/stark', $edit, t('Save block'));
$this->assertText(t('The block configuration has been saved.'));
$this->assertText($edit['settings[label]']);
// Update the weight of a block.
$edit = array('blocks[stark.' . $edit['machine_name'] . '][weight]' => -1);
- $this->drupalPost('admin/structure/block', $edit, t('Save blocks'));
+ $this->drupalPostForm('admin/structure/block', $edit, t('Save blocks'));
$this->assertText(t('The block settings have been updated.'));
// Re-enable the module and refresh the definitions cache.
diff --git a/core/modules/block/lib/Drupal/block/Tests/BlockTestBase.php b/core/modules/block/lib/Drupal/block/Tests/BlockTestBase.php
index 5c8bf6a..96ea288 100644
--- a/core/modules/block/lib/Drupal/block/Tests/BlockTestBase.php
+++ b/core/modules/block/lib/Drupal/block/Tests/BlockTestBase.php
@@ -91,7 +91,7 @@ function moveBlockToRegion(array $block, $region) {
// Set the created block to a specific region.
$edit = array();
$edit['blocks[0][region]'] = $region;
- $this->drupalPost('admin/structure/block', $edit, t('Save blocks'));
+ $this->drupalPostForm('admin/structure/block', $edit, t('Save blocks'));
// Confirm that the block was moved to the proper region.
$this->assertText(t('The block settings have been updated.'), format_string('Block successfully moved to %region_name region.', array( '%region_name' => $region)));
diff --git a/core/modules/block/lib/Drupal/block/Tests/BlockUiTest.php b/core/modules/block/lib/Drupal/block/Tests/BlockUiTest.php
index 9921f8e..d996b1e 100644
--- a/core/modules/block/lib/Drupal/block/Tests/BlockUiTest.php
+++ b/core/modules/block/lib/Drupal/block/Tests/BlockUiTest.php
@@ -89,7 +89,7 @@ function testBlockAdminUiPage() {
// Change the test block's weight.
$edit['blocks[stark.' . $values['settings']['machine_name'] . '][weight]'] = $values['test_weight'];
}
- $this->drupalPost('admin/structure/block', $edit, t('Save blocks'));
+ $this->drupalPostForm('admin/structure/block', $edit, t('Save blocks'));
foreach ($this->testBlocks as $values) {
// Check if the region and weight settings changes have persisted.
$this->assertOptionSelected(
@@ -136,12 +136,12 @@ public function testMachineNameSuggestion() {
$url = 'admin/structure/block/add/test_block_instantiation/stark';
$this->drupalGet($url);
$this->assertFieldByName('machine_name', 'displaymessage', 'Block form uses raw machine name suggestion when no instance already exists.');
- $this->drupalPost($url, array(), 'Save block');
+ $this->drupalPostForm($url, array(), 'Save block');
// Now, check to make sure the form starts by autoincrementing correctly.
$this->drupalGet($url);
$this->assertFieldByName('machine_name', 'displaymessage_2', 'Block form appends _2 to plugin-suggested machine name when an instance already exists.');
- $this->drupalPost($url, array(), 'Save block');
+ $this->drupalPostForm($url, array(), 'Save block');
// And verify that it continues working beyond just the first two.
$this->drupalGet($url);
diff --git a/core/modules/block/lib/Drupal/block/Tests/Views/DisplayBlockTest.php b/core/modules/block/lib/Drupal/block/Tests/Views/DisplayBlockTest.php
index 65a9ed9..48f204f 100644
--- a/core/modules/block/lib/Drupal/block/Tests/Views/DisplayBlockTest.php
+++ b/core/modules/block/lib/Drupal/block/Tests/Views/DisplayBlockTest.php
@@ -112,7 +112,7 @@ public function testViewsBlockForm() {
// saved as expected from the default value.
$this->assertNoFieldById('edit-machine-name', 'stark.views_block__test_view_block_1', 'The machine name is hidden on the views block form.');
// Save the block.
- $this->drupalPost(NULL, array(), t('Save block'));
+ $this->drupalPostForm(NULL, array(), t('Save block'));
$storage = $this->container->get('entity.manager')->getStorageController('block');
$block = $storage->load('stark.views_block__test_view_block_block_1');
// This will only return a result if our new block has been created with the
@@ -121,7 +121,7 @@ public function testViewsBlockForm() {
for ($i = 2; $i <= 3; $i++) {
// Place the same block again and make sure we have a new ID.
- $this->drupalPost('admin/structure/block/add/views_block:test_view_block-block_1/' . $default_theme, array(), t('Save block'));
+ $this->drupalPostForm('admin/structure/block/add/views_block:test_view_block-block_1/' . $default_theme, array(), t('Save block'));
$block = $storage->load('stark.views_block__test_view_block_block_1_' . $i);
// This will only return a result if our new block has been created with the
// expected machine name.
@@ -133,14 +133,14 @@ public function testViewsBlockForm() {
$edit = array();
$edit['settings[override][items_per_page]'] = 10;
- $this->drupalPost('admin/structure/block/add/views_block:test_view_block-block_1/' . $default_theme, $edit, t('Save block'));
+ $this->drupalPostForm('admin/structure/block/add/views_block:test_view_block-block_1/' . $default_theme, $edit, t('Save block'));
$block = $storage->load('stark.views_block__test_view_block_block_1_4');
$config = $block->getPlugin()->getConfiguration();
$this->assertEqual(10, $config['items_per_page'], "'Items per page' is properly saved.");
$edit['settings[override][items_per_page]'] = 5;
- $this->drupalPost('admin/structure/block/manage/stark.views_block__test_view_block_block_1_4', $edit, t('Save block'));
+ $this->drupalPostForm('admin/structure/block/manage/stark.views_block__test_view_block_block_1_4', $edit, t('Save block'));
$block = $storage->load('stark.views_block__test_view_block_block_1_4');
@@ -162,16 +162,8 @@ public function testBlockContextualLinks() {
// Get server-rendered contextual links.
// @see \Drupal\contextual\Tests\ContextualDynamicContextTest:renderContextualLinks()
- $post = urlencode('ids[0]') . '=' . urlencode($id);
- $response = $this->curlExec(array(
- CURLOPT_URL => url('contextual/render', array('absolute' => TRUE, 'query' => array('destination' => 'test-page'))),
- CURLOPT_POST => TRUE,
- CURLOPT_POSTFIELDS => $post,
- CURLOPT_HTTPHEADER => array(
- 'Accept: application/json',
- 'Content-Type: application/x-www-form-urlencoded',
- ),
- ));
+ $post = array('ids[0]' => $id);
+ $response = $this->drupalPost('contextual/render', 'application/json', $post, array('query' => array('destination' => 'test-page')));
$this->assertResponse(200);
$json = drupal_json_decode($response);
$this->assertIdentical($json[$id], '');
diff --git a/core/modules/book/lib/Drupal/book/Tests/BookTest.php b/core/modules/book/lib/Drupal/book/Tests/BookTest.php
index f4ad875..53976df 100644
--- a/core/modules/book/lib/Drupal/book/Tests/BookTest.php
+++ b/core/modules/book/lib/Drupal/book/Tests/BookTest.php
@@ -128,7 +128,7 @@ function testBook() {
$other_book = $this->createBookNode('new');
$node = $this->createBookNode($book->id());
$edit = array('book[bid]' => $other_book->id());
- $this->drupalPost('node/' . $node->id() . '/edit', $edit, t('Save'));
+ $this->drupalPostForm('node/' . $node->id() . '/edit', $edit, t('Save'));
$this->drupalLogout();
$this->drupalLogin($this->web_user);
@@ -249,13 +249,13 @@ function createBookNode($book_nid, $parent = NULL) {
$edit['book[bid]'] = $book_nid;
if ($parent !== NULL) {
- $this->drupalPost('node/add/book', $edit, t('Change book (update list of parents)'));
+ $this->drupalPostForm('node/add/book', $edit, t('Change book (update list of parents)'));
$edit['book[plid]'] = $parent;
- $this->drupalPost(NULL, $edit, t('Save'));
+ $this->drupalPostForm(NULL, $edit, t('Save'));
}
else {
- $this->drupalPost('node/add/book', $edit, t('Save'));
+ $this->drupalPostForm('node/add/book', $edit, t('Save'));
}
// Check to make sure the book node was created.
@@ -323,7 +323,7 @@ function testBookNavigationBlock() {
// Give anonymous users the permission 'node test view'.
$edit = array();
$edit[DRUPAL_ANONYMOUS_RID . '[node test view]'] = TRUE;
- $this->drupalPost('admin/people/permissions/' . DRUPAL_ANONYMOUS_RID, $edit, t('Save permissions'));
+ $this->drupalPostForm('admin/people/permissions/' . DRUPAL_ANONYMOUS_RID, $edit, t('Save permissions'));
$this->assertText(t('The changes have been saved.'), "Permission 'node test view' successfully assigned to anonymous users.");
// Test correct display of the block.
@@ -344,7 +344,7 @@ function testNavigationBlockOnAccessModuleEnabled() {
// Give anonymous users the permission 'node test view'.
$edit = array();
$edit[DRUPAL_ANONYMOUS_RID . '[node test view]'] = TRUE;
- $this->drupalPost('admin/people/permissions/' . DRUPAL_ANONYMOUS_RID, $edit, t('Save permissions'));
+ $this->drupalPostForm('admin/people/permissions/' . DRUPAL_ANONYMOUS_RID, $edit, t('Save permissions'));
$this->assertText(t('The changes have been saved.'), "Permission 'node test view' successfully assigned to anonymous users.");
// Create a book.
@@ -376,7 +376,7 @@ function testBookDelete() {
// Test access to delete top-level and child book nodes.
$this->drupalGet('node/' . $this->book->id() . '/outline/remove');
$this->assertResponse('403', 'Deleting top-level book node properly forbidden.');
- $this->drupalPost('node/' . $nodes[4]->id() . '/outline/remove', $edit, t('Remove'));
+ $this->drupalPostForm('node/' . $nodes[4]->id() . '/outline/remove', $edit, t('Remove'));
$node4 = node_load($nodes[4]->id(), TRUE);
$this->assertTrue(empty($node4->book), 'Deleting child book node properly allowed.');
@@ -385,7 +385,7 @@ function testBookDelete() {
$nids[] = $node->id();
}
entity_delete_multiple('node', $nids);
- $this->drupalPost('node/' . $this->book->id() . '/outline/remove', $edit, t('Remove'));
+ $this->drupalPostForm('node/' . $this->book->id() . '/outline/remove', $edit, t('Remove'));
$node = node_load($this->book->id(), TRUE);
$this->assertTrue(empty($node->book), 'Deleting childless top-level book node properly allowed.');
}
@@ -400,7 +400,7 @@ function testBookNodeTypeChange() {
'name' => 'Bar',
'type' => 'bar',
);
- $this->drupalPost('admin/structure/types/manage/book', $edit, t('Save content type'));
+ $this->drupalPostForm('admin/structure/types/manage/book', $edit, t('Save content type'));
// Ensure that the config book.settings:allowed_types has been updated with
// the new machine and the old one has been removed.
@@ -412,7 +412,7 @@ function testBookNodeTypeChange() {
'title_label' => 'Title for basic page',
'type' => 'page',
);
- $this->drupalPost('admin/structure/types/add', $edit, t('Save content type'));
+ $this->drupalPostForm('admin/structure/types/add', $edit, t('Save content type'));
// Add page to the allowed node types.
$edit = array(
@@ -420,7 +420,7 @@ function testBookNodeTypeChange() {
'book_allowed_types[bar]' => 'bar',
);
- $this->drupalPost('admin/structure/book/settings', $edit, t('Save configuration'));
+ $this->drupalPostForm('admin/structure/book/settings', $edit, t('Save configuration'));
$this->assertTrue(book_type_is_allowed('bar'), 'Config book.settings:allowed_types contains the bar node type.');
$this->assertTrue(book_type_is_allowed('page'), 'Config book.settings:allowed_types contains the page node type.');
@@ -436,7 +436,7 @@ function testBookNodeTypeChange() {
// );
// @endcode
$current_config = \Drupal::config('book.settings')->init()->get();
- $this->drupalPost('admin/structure/book/settings', array(), t('Save configuration'));
+ $this->drupalPostForm('admin/structure/book/settings', array(), t('Save configuration'));
$this->assertIdentical($current_config, \Drupal::config('book.settings')->init()->get());
// Change the name, machine name and description.
@@ -444,7 +444,7 @@ function testBookNodeTypeChange() {
'name' => 'Zebra book',
'type' => 'zebra',
);
- $this->drupalPost('admin/structure/types/manage/bar', $edit, t('Save content type'));
+ $this->drupalPostForm('admin/structure/types/manage/bar', $edit, t('Save content type'));
$this->assertTrue(book_type_is_allowed('zebra'), 'Config book.settings:allowed_types contains the zebra node type.');
$this->assertTrue(book_type_is_allowed('page'), 'Config book.settings:allowed_types contains the page node type.');
@@ -457,14 +457,14 @@ function testBookNodeTypeChange() {
// );
// @endcode
$current_config = \Drupal::config('book.settings')->init()->get();
- $this->drupalPost('admin/structure/book/settings', array(), t('Save configuration'));
+ $this->drupalPostForm('admin/structure/book/settings', array(), t('Save configuration'));
$this->assertIdentical($current_config, \Drupal::config('book.settings')->init()->get());
$edit = array(
'name' => 'Animal book',
'type' => 'zebra',
);
- $this->drupalPost('admin/structure/types/manage/zebra', $edit, t('Save content type'));
+ $this->drupalPostForm('admin/structure/types/manage/zebra', $edit, t('Save content type'));
// Test the order of the book.settings::allowed_types configuration is as
// expected. The order should be:
@@ -475,7 +475,7 @@ function testBookNodeTypeChange() {
// );
// @endcode
$current_config = \Drupal::config('book.settings')->init()->get();
- $this->drupalPost('admin/structure/book/settings', array(), t('Save configuration'));
+ $this->drupalPostForm('admin/structure/book/settings', array(), t('Save configuration'));
$this->assertIdentical($current_config, \Drupal::config('book.settings')->init()->get());
// Ensure that after all the node type changes book.settings:child_type has
@@ -504,7 +504,7 @@ public function testBookOrdering() {
// Put node 2 under node 1.
"table[book-admin-{$node2->id()}][plid]" => $plid,
);
- $this->drupalPost(NULL, $edit, t('Save book pages'));
+ $this->drupalPostForm(NULL, $edit, t('Save book pages'));
// Verify weight was updated.
$this->assertFieldByName("table[book-admin-{$node1->id()}][weight]", 1);
$this->assertFieldByName("table[book-admin-{$node2->id()}][weight]", 2);
diff --git a/core/modules/ckeditor/lib/Drupal/ckeditor/Tests/CKEditorAdminTest.php b/core/modules/ckeditor/lib/Drupal/ckeditor/Tests/CKEditorAdminTest.php
index e0e3cac..d2e42f9 100644
--- a/core/modules/ckeditor/lib/Drupal/ckeditor/Tests/CKEditorAdminTest.php
+++ b/core/modules/ckeditor/lib/Drupal/ckeditor/Tests/CKEditorAdminTest.php
@@ -71,7 +71,7 @@ function testAdmin() {
$edit = array(
'editor[editor]' => 'ckeditor',
);
- $this->drupalPost(NULL, $edit, t('Save configuration'));
+ $this->drupalPostForm(NULL, $edit, t('Save configuration'));
$this->assertRaw(t('You must configure the selected text editor.'));
// Ensure the CKEditor editor returns the expected default settings.
@@ -92,7 +92,7 @@ function testAdmin() {
$this->assertIdentical($ckeditor->getDefaultSettings(), $expected_default_settings);
// Keep the "CKEditor" editor selected and click the "Configure" button.
- $this->drupalPostAjax(NULL, $edit, 'editor_configure');
+ $this->drupalPostAjaxForm(NULL, $edit, 'editor_configure');
$editor = entity_load('editor', 'filtered_html');
$this->assertFalse($editor, 'No Editor config entity exists yet.');
@@ -107,7 +107,7 @@ function testAdmin() {
$this->assertTrue(count($styles_textarea) === 1, 'The "styles" textarea exists.');
// Submit the form to save the selection of CKEditor as the chosen editor.
- $this->drupalPost(NULL, $edit, t('Save configuration'));
+ $this->drupalPostForm(NULL, $edit, t('Save configuration'));
// Ensure an Editor object exists now, with the proper settings.
$expected_settings = $expected_default_settings;
@@ -121,7 +121,7 @@ function testAdmin() {
$edit = array(
'editor[settings][plugins][stylescombo][styles]' => "h1.title|Title\np.callout|Callout\n\n",
);
- $this->drupalPost(NULL, $edit, t('Save configuration'));
+ $this->drupalPostForm(NULL, $edit, t('Save configuration'));
$expected_settings['plugins']['stylescombo']['styles'] = "h1.title|Title\np.callout|Callout\n\n";
$editor = entity_load('editor', 'filtered_html');
$this->assertTrue($editor instanceof Editor, 'An Editor config entity exists.');
@@ -138,7 +138,7 @@ function testAdmin() {
$edit = array(
'editor[settings][toolbar][buttons]' => json_encode($expected_settings['toolbar']['buttons']),
);
- $this->drupalPost(NULL, $edit, t('Save configuration'));
+ $this->drupalPostForm(NULL, $edit, t('Save configuration'));
$editor = entity_load('editor', 'filtered_html');
$this->assertTrue($editor instanceof Editor, 'An Editor config entity exists.');
$this->assertIdentical($expected_settings, $editor->settings, 'The Editor config entity has the correct settings.');
@@ -159,7 +159,7 @@ function testAdmin() {
$edit = array(
'editor[settings][plugins][llama_contextual_and_button][ultra_llama_mode]' => '1',
);
- $this->drupalPost(NULL, $edit, t('Save configuration'));
+ $this->drupalPostForm(NULL, $edit, t('Save configuration'));
$this->drupalGet('admin/config/content/formats/manage/filtered_html');
$ultra_llama_mode_checkbox = $this->xpath('//input[@type="checkbox" and @name="editor[settings][plugins][llama_contextual_and_button][ultra_llama_mode]" and @checked="checked"]');
$this->assertTrue(count($ultra_llama_mode_checkbox) === 1, 'The "Ultra llama mode" checkbox exists and is checked.');
diff --git a/core/modules/color/lib/Drupal/color/Tests/ColorTest.php b/core/modules/color/lib/Drupal/color/Tests/ColorTest.php
index 897943c..315d85d 100644
--- a/core/modules/color/lib/Drupal/color/Tests/ColorTest.php
+++ b/core/modules/color/lib/Drupal/color/Tests/ColorTest.php
@@ -88,7 +88,7 @@ function _testColor($theme, $test_values) {
$this->assertResponse(200);
$edit['scheme'] = '';
$edit[$test_values['palette_input']] = '#123456';
- $this->drupalPost($settings_path, $edit, t('Save configuration'));
+ $this->drupalPostForm($settings_path, $edit, t('Save configuration'));
$this->drupalGet('');
$stylesheets = \Drupal::config('color.' . $theme)->get('stylesheets');
@@ -100,7 +100,7 @@ function _testColor($theme, $test_values) {
$this->drupalGet($settings_path);
$this->assertResponse(200);
$edit['scheme'] = $test_values['scheme'];
- $this->drupalPost($settings_path, $edit, t('Save configuration'));
+ $this->drupalPostForm($settings_path, $edit, t('Save configuration'));
$this->drupalGet('');
$stylesheets = \Drupal::config('color.' . $theme)->get('stylesheets');
@@ -136,7 +136,7 @@ function testValidColor() {
foreach ($this->colorTests as $color => $is_valid) {
$edit['palette[bg]'] = $color;
- $this->drupalPost($settings_path, $edit, t('Save configuration'));
+ $this->drupalPostForm($settings_path, $edit, t('Save configuration'));
if($is_valid) {
$this->assertText('The configuration options have been saved.');
diff --git a/core/modules/comment/lib/Drupal/comment/Tests/CommentAnonymousTest.php b/core/modules/comment/lib/Drupal/comment/Tests/CommentAnonymousTest.php
index 5fe19ba..d285e45 100644
--- a/core/modules/comment/lib/Drupal/comment/Tests/CommentAnonymousTest.php
+++ b/core/modules/comment/lib/Drupal/comment/Tests/CommentAnonymousTest.php
@@ -75,7 +75,7 @@ function testAnonymous() {
'subject' => $this->randomName(),
"comment_body[$langcode][0][value]" => $this->randomName(),
);
- $this->drupalPost('comment/reply/' . $this->node->id(), $edit, t('Save'));
+ $this->drupalPostForm('comment/reply/' . $this->node->id(), $edit, t('Save'));
$this->assertText(t('The name you used belongs to a registered user.'));
// Require contact info.
diff --git a/core/modules/comment/lib/Drupal/comment/Tests/CommentApprovalTest.php b/core/modules/comment/lib/Drupal/comment/Tests/CommentApprovalTest.php
index 6f70b0c..6c0a90a 100644
--- a/core/modules/comment/lib/Drupal/comment/Tests/CommentApprovalTest.php
+++ b/core/modules/comment/lib/Drupal/comment/Tests/CommentApprovalTest.php
@@ -72,7 +72,7 @@ function testApprovalAdminInterface() {
"comments[{$comments[0]->id()}]" => 1,
"comments[{$comments[1]->id()}]" => 1,
);
- $this->drupalPost(NULL, $edit, t('Update'));
+ $this->drupalPostForm(NULL, $edit, t('Update'));
$this->assertText(t('Unapproved comments (@count)', array('@count' => 0)), 'All comments were approved.');
// Delete multiple comments in one operation.
@@ -82,9 +82,9 @@ function testApprovalAdminInterface() {
"comments[{$comments[1]->id()}]" => 1,
"comments[{$anonymous_comment4->id()}]" => 1,
);
- $this->drupalPost(NULL, $edit, t('Update'));
+ $this->drupalPostForm(NULL, $edit, t('Update'));
$this->assertText(t('Are you sure you want to delete these comments and all their children?'), 'Confirmation required.');
- $this->drupalPost(NULL, $edit, t('Delete comments'));
+ $this->drupalPostForm(NULL, $edit, t('Delete comments'));
$this->assertText(t('No comments available.'), 'All comments were deleted.');
}
diff --git a/core/modules/comment/lib/Drupal/comment/Tests/CommentFieldsTest.php b/core/modules/comment/lib/Drupal/comment/Tests/CommentFieldsTest.php
index f9d25f1..09625a5 100644
--- a/core/modules/comment/lib/Drupal/comment/Tests/CommentFieldsTest.php
+++ b/core/modules/comment/lib/Drupal/comment/Tests/CommentFieldsTest.php
@@ -71,19 +71,19 @@ function testCommentEnable() {
// Disable the comment module.
$edit = array();
$edit['modules[Core][comment][enable]'] = FALSE;
- $this->drupalPost('admin/modules', $edit, t('Save configuration'));
+ $this->drupalPostForm('admin/modules', $edit, t('Save configuration'));
$this->rebuildContainer();
$this->assertFalse(module_exists('comment'), 'Comment module disabled.');
// Enable core content type module (book).
$edit = array();
$edit['modules[Core][book][enable]'] = 'book';
- $this->drupalPost('admin/modules', $edit, t('Save configuration'));
+ $this->drupalPostForm('admin/modules', $edit, t('Save configuration'));
// Now enable the comment module.
$edit = array();
$edit['modules[Core][comment][enable]'] = 'comment';
- $this->drupalPost('admin/modules', $edit, t('Save configuration'));
+ $this->drupalPostForm('admin/modules', $edit, t('Save configuration'));
$this->rebuildContainer();
$this->assertTrue(module_exists('comment'), 'Comment module enabled.');
@@ -107,11 +107,11 @@ function testCommentFormat() {
// Disable text processing for comments.
$this->drupalLogin($this->admin_user);
$edit = array('instance[settings][text_processing]' => 0);
- $this->drupalPost('admin/structure/types/manage/article/comment/fields/comment.comment_node_article.comment_body', $edit, t('Save settings'));
+ $this->drupalPostForm('admin/structure/types/manage/article/comment/fields/comment.comment_node_article.comment_body', $edit, t('Save settings'));
// Post a comment without an explicit subject.
$this->drupalLogin($this->web_user);
$edit = array('comment_body[und][0][value]' => $this->randomName(8));
- $this->drupalPost('node/' . $this->node->id(), $edit, t('Save'));
+ $this->drupalPostForm('node/' . $this->node->id(), $edit, t('Save'));
}
}
diff --git a/core/modules/comment/lib/Drupal/comment/Tests/CommentLanguageTest.php b/core/modules/comment/lib/Drupal/comment/Tests/CommentLanguageTest.php
index 4064b22..479beba 100644
--- a/core/modules/comment/lib/Drupal/comment/Tests/CommentLanguageTest.php
+++ b/core/modules/comment/lib/Drupal/comment/Tests/CommentLanguageTest.php
@@ -45,11 +45,11 @@ function setUp() {
// Add language.
$edit = array('predefined_langcode' => 'fr');
- $this->drupalPost('admin/config/regional/language/add', $edit, t('Add language'));
+ $this->drupalPostForm('admin/config/regional/language/add', $edit, t('Add language'));
// Set "Article" content type to use multilingual support.
$edit = array('language_configuration[language_show]' => TRUE);
- $this->drupalPost('admin/structure/types/manage/article', $edit, t('Save content type'));
+ $this->drupalPostForm('admin/structure/types/manage/article', $edit, t('Save content type'));
// Enable content language negotiation UI.
\Drupal::state()->set('language_test.content_language_type', TRUE);
@@ -63,12 +63,12 @@ function setUp() {
'language_content[enabled][language-url]' => TRUE,
'language_content[enabled][language-interface]' => FALSE,
);
- $this->drupalPost('admin/config/regional/language/detection', $edit, t('Save settings'));
+ $this->drupalPostForm('admin/config/regional/language/detection', $edit, t('Save settings'));
// Change user language preference, this way interface language is always
// French no matter what path prefix the URLs have.
$edit = array('preferred_langcode' => 'fr');
- $this->drupalPost("user/" . $admin_user->id() . "/edit", $edit, t('Save'));
+ $this->drupalPostForm("user/" . $admin_user->id() . "/edit", $edit, t('Save'));
// Make comment body translatable.
$field = field_info_field('comment', 'comment_body');
@@ -99,7 +99,7 @@ function testCommentLanguage() {
"body[$langcode_not_specified][0][value]" => $this->randomName(),
"langcode" => $node_langcode,
);
- $this->drupalPost("node/add/article", $edit, t('Save'));
+ $this->drupalPostForm("node/add/article", $edit, t('Save'));
$node = $this->drupalGetNodeByTitle($title);
$prefixes = language_negotiation_url_prefixes();
@@ -111,8 +111,8 @@ function testCommentLanguage() {
'subject' => $this->randomName(),
"comment_body[$langcode][0][value]" => $comment_values[$node_langcode][$langcode],
);
- $this->drupalPost($prefix . 'node/' . $node->id(), $edit, t('Preview'));
- $this->drupalPost(NULL, $edit, t('Save'));
+ $this->drupalPostForm($prefix . 'node/' . $node->id(), $edit, t('Preview'));
+ $this->drupalPostForm(NULL, $edit, t('Save'));
// Check that comment language matches the current content language.
$cid = db_select('comment', 'c')
diff --git a/core/modules/comment/lib/Drupal/comment/Tests/CommentPreviewTest.php b/core/modules/comment/lib/Drupal/comment/Tests/CommentPreviewTest.php
index e69507a..d7b9c77 100644
--- a/core/modules/comment/lib/Drupal/comment/Tests/CommentPreviewTest.php
+++ b/core/modules/comment/lib/Drupal/comment/Tests/CommentPreviewTest.php
@@ -78,13 +78,13 @@ function testCommentPreview() {
$edit['signature[value]'] = '' . $test_signature. '';
$image = current($this->drupalGetTestFiles('image'));
$edit['files[user_picture_und_0]'] = drupal_realpath($image->uri);
- $this->drupalPost('user/' . $this->web_user->id() . '/edit', $edit, t('Save'));
+ $this->drupalPostForm('user/' . $this->web_user->id() . '/edit', $edit, t('Save'));
// As the web user, fill in the comment form and preview the comment.
$edit = array();
$edit['subject'] = $this->randomName(8);
$edit['comment_body[' . $langcode . '][0][value]'] = $this->randomName(16);
- $this->drupalPost('node/' . $this->node->id(), $edit, t('Preview'));
+ $this->drupalPostForm('node/' . $this->node->id(), $edit, t('Preview'));
// Check that the preview is displaying the title and body.
$this->assertTitle(t('Preview comment | Drupal'), 'Page title is "Preview comment".');
@@ -126,7 +126,7 @@ function testCommentEditPreviewSave() {
$expected_form_date = $date->format('Y-m-d');
$expected_form_time = $date->format('H:i:s');
$comment = $this->postComment($this->node, $edit['subject'], $edit['comment_body[' . $langcode . '][0][value]'], TRUE);
- $this->drupalPost('comment/' . $comment->id() . '/edit', $edit, t('Preview'));
+ $this->drupalPostForm('comment/' . $comment->id() . '/edit', $edit, t('Preview'));
// Check that the preview is displaying the subject, comment, author and date correctly.
$this->assertTitle(t('Preview comment | Drupal'), 'Page title is "Preview comment".');
@@ -143,7 +143,7 @@ function testCommentEditPreviewSave() {
$this->assertFieldByName('date[time]', $edit['date[time]'], 'Time field displayed.');
// Check that saving a comment produces a success message.
- $this->drupalPost('comment/' . $comment->id() . '/edit', $edit, t('Save'));
+ $this->drupalPostForm('comment/' . $comment->id() . '/edit', $edit, t('Save'));
$this->assertText(t('Your comment has been posted.'), 'Comment posted.');
// Check that the comment fields are correct after loading the saved comment.
@@ -161,7 +161,7 @@ function testCommentEditPreviewSave() {
$displayed['name'] = (string) current($this->xpath("//input[@id='edit-name']/@value"));
$displayed['date[date]'] = (string) current($this->xpath("//input[@id='edit-date-date']/@value"));
$displayed['date[time]'] = (string) current($this->xpath("//input[@id='edit-date-time']/@value"));
- $this->drupalPost('comment/' . $comment->id() . '/edit', $displayed, t('Save'));
+ $this->drupalPostForm('comment/' . $comment->id() . '/edit', $displayed, t('Save'));
// Check that the saved comment is still correct.
$comment_loaded = comment_load($comment->id(), TRUE);
diff --git a/core/modules/comment/lib/Drupal/comment/Tests/CommentTestBase.php b/core/modules/comment/lib/Drupal/comment/Tests/CommentTestBase.php
index 8b9ab47..2f7fbda 100644
--- a/core/modules/comment/lib/Drupal/comment/Tests/CommentTestBase.php
+++ b/core/modules/comment/lib/Drupal/comment/Tests/CommentTestBase.php
@@ -120,19 +120,19 @@ function postComment($entity, $comment, $subject = '', $contact = NULL) {
case DRUPAL_REQUIRED:
// Preview required so no save button should be found.
$this->assertNoFieldByName('op', t('Save'), 'Save button not found.');
- $this->drupalPost(NULL, $edit, t('Preview'));
+ $this->drupalPostForm(NULL, $edit, t('Preview'));
// Don't break here so that we can test post-preview field presence and
// function below.
case DRUPAL_OPTIONAL:
$this->assertFieldByName('op', t('Preview'), 'Preview button found.');
$this->assertFieldByName('op', t('Save'), 'Save button found.');
- $this->drupalPost(NULL, $edit, t('Save'));
+ $this->drupalPostForm(NULL, $edit, t('Save'));
break;
case DRUPAL_DISABLED:
$this->assertNoFieldByName('op', t('Preview'), 'Preview button not found.');
$this->assertFieldByName('op', t('Save'), 'Save button found.');
- $this->drupalPost(NULL, $edit, t('Save'));
+ $this->drupalPostForm(NULL, $edit, t('Save'));
break;
}
$match = array();
@@ -186,7 +186,7 @@ function commentExists(CommentInterface $comment = NULL, $reply = FALSE) {
* Comment to delete.
*/
function deleteComment(CommentInterface $comment) {
- $this->drupalPost('comment/' . $comment->id() . '/delete', array(), t('Delete'));
+ $this->drupalPostForm('comment/' . $comment->id() . '/delete', array(), t('Delete'));
$this->assertText(t('The comment and all its replies have been deleted.'), 'Comment deleted.');
}
@@ -297,10 +297,10 @@ function performCommentOperation(CommentInterface $comment, $operation, $approva
$edit = array();
$edit['operation'] = $operation;
$edit['comments[' . $comment->id() . ']'] = TRUE;
- $this->drupalPost('admin/content/comment' . ($approval ? '/approval' : ''), $edit, t('Update'));
+ $this->drupalPostForm('admin/content/comment' . ($approval ? '/approval' : ''), $edit, t('Update'));
if ($operation == 'delete') {
- $this->drupalPost(NULL, array(), t('Delete comments'));
+ $this->drupalPostForm(NULL, array(), t('Delete comments'));
$this->assertRaw(format_plural(1, 'Deleted 1 comment.', 'Deleted @count comments.'), format_string('Operation "@operation" was performed on comment.', array('@operation' => $operation)));
}
else {
diff --git a/core/modules/comment/lib/Drupal/comment/Tests/Views/WizardTest.php b/core/modules/comment/lib/Drupal/comment/Tests/Views/WizardTest.php
index de1487a..3d7b6e9 100644
--- a/core/modules/comment/lib/Drupal/comment/Tests/Views/WizardTest.php
+++ b/core/modules/comment/lib/Drupal/comment/Tests/Views/WizardTest.php
@@ -45,14 +45,14 @@ public function testCommentWizard() {
// Just triggering the saving should automatically choose a proper row
// plugin.
- $this->drupalPost('admin/structure/views/add', $view, t('Save and edit'));
+ $this->drupalPostForm('admin/structure/views/add', $view, t('Save and edit'));
$this->assertUrl('admin/structure/views/view/' . $view['id'], array(), 'Make sure the view saving was successful and the browser got redirected to the edit page.');
// If we update the type first we should get a selection of comment valid
// row plugins as the select field.
$this->drupalGet('admin/structure/views/add');
- $this->drupalPost('admin/structure/views/add', $view, t('Update "of type" choice'));
+ $this->drupalPostForm('admin/structure/views/add', $view, t('Update "of type" choice'));
// Check for available options of the row plugin.
$xpath = $this->constructFieldXpath('name', 'page[style][row_plugin]');
@@ -68,7 +68,7 @@ public function testCommentWizard() {
$this->assertEqual($options, $expected_options);
$view['id'] = strtolower($this->randomName(16));
- $this->drupalPost(NULL, $view, t('Save and edit'));
+ $this->drupalPostForm(NULL, $view, t('Save and edit'));
$this->assertUrl('admin/structure/views/view/' . $view['id'], array(), 'Make sure the view saving was successful and the browser got redirected to the edit page.');
$view = views_get_view($view['id']);
diff --git a/core/modules/config/lib/Drupal/config/Tests/ConfigEntityListTest.php b/core/modules/config/lib/Drupal/config/Tests/ConfigEntityListTest.php
index f1a3703..b26e7f2 100644
--- a/core/modules/config/lib/Drupal/config/Tests/ConfigEntityListTest.php
+++ b/core/modules/config/lib/Drupal/config/Tests/ConfigEntityListTest.php
@@ -199,7 +199,7 @@ function testListUI() {
'id' => 'antelope',
'weight' => 1,
);
- $this->drupalPost(NULL, $edit, t('Save'));
+ $this->drupalPostForm(NULL, $edit, t('Save'));
// Ensure that the entity's sort method was called.
$this->assertTrue(\Drupal::state()->get('config_entity_sort'), 'ConfigTest::sort() was called.');
@@ -216,7 +216,7 @@ function testListUI() {
$this->assertResponse(200);
$this->assertTitle('Edit Antelope | Drupal');
$edit = array('label' => 'Albatross', 'id' => 'albatross');
- $this->drupalPost(NULL, $edit, t('Save'));
+ $this->drupalPostForm(NULL, $edit, t('Save'));
// Confirm that the user is returned to the listing, and verify that the
// text of the label and machine name appears in the list (versus elsewhere
@@ -229,7 +229,7 @@ function testListUI() {
$this->clickLink('Delete', 1);
$this->assertResponse(200);
$this->assertTitle('Are you sure you want to delete Albatross | Drupal');
- $this->drupalPost(NULL, array(), t('Delete'));
+ $this->drupalPostForm(NULL, array(), t('Delete'));
// Verify that the text of the label and machine name does not appear in
// the list (though it may appear elsewhere on the page).
@@ -240,7 +240,7 @@ function testListUI() {
$this->clickLink('Delete');
$this->assertResponse(200);
$this->assertTitle('Are you sure you want to delete Default | Drupal');
- $this->drupalPost(NULL, array(), t('Delete'));
+ $this->drupalPostForm(NULL, array(), t('Delete'));
// Verify that the text of the label and machine name does not appear in
// the list (though it may appear elsewhere on the page).
diff --git a/core/modules/config/lib/Drupal/config/Tests/ConfigEntityStatusUITest.php b/core/modules/config/lib/Drupal/config/Tests/ConfigEntityStatusUITest.php
index 642fe2e..da36cab 100644
--- a/core/modules/config/lib/Drupal/config/Tests/ConfigEntityStatusUITest.php
+++ b/core/modules/config/lib/Drupal/config/Tests/ConfigEntityStatusUITest.php
@@ -39,7 +39,7 @@ function testCRUD() {
'id' => $id,
'label' => $this->randomName(),
);
- $this->drupalPost('admin/structure/config_test/add', $edit, 'Save');
+ $this->drupalPostForm('admin/structure/config_test/add', $edit, 'Save');
$uri = entity_load('config_test', $id)->uri();
diff --git a/core/modules/config/lib/Drupal/config/Tests/ConfigEntityTest.php b/core/modules/config/lib/Drupal/config/Tests/ConfigEntityTest.php
index faaccde..3e2a718 100644
--- a/core/modules/config/lib/Drupal/config/Tests/ConfigEntityTest.php
+++ b/core/modules/config/lib/Drupal/config/Tests/ConfigEntityTest.php
@@ -203,7 +203,7 @@ function testCRUDUI() {
'id' => $id,
'label' => $label1,
);
- $this->drupalPost('admin/structure/config_test/add', $edit, 'Save');
+ $this->drupalPostForm('admin/structure/config_test/add', $edit, 'Save');
$this->assertUrl('admin/structure/config_test');
$this->assertResponse(200);
$this->assertRaw($message_insert);
@@ -214,7 +214,7 @@ function testCRUDUI() {
$edit = array(
'label' => $label2,
);
- $this->drupalPost("admin/structure/config_test/manage/$id", $edit, 'Save');
+ $this->drupalPostForm("admin/structure/config_test/manage/$id", $edit, 'Save');
$this->assertUrl('admin/structure/config_test');
$this->assertResponse(200);
$this->assertNoRaw($message_insert);
@@ -224,9 +224,9 @@ function testCRUDUI() {
// Delete the configuration entity.
$this->drupalGet("admin/structure/config_test/manage/$id");
- $this->drupalPost(NULL, array(), 'Delete');
+ $this->drupalPostForm(NULL, array(), 'Delete');
$this->assertUrl("admin/structure/config_test/manage/$id/delete");
- $this->drupalPost(NULL, array(), 'Delete');
+ $this->drupalPostForm(NULL, array(), 'Delete');
$this->assertUrl('admin/structure/config_test');
$this->assertResponse(200);
$this->assertNoRaw($message_update);
@@ -239,7 +239,7 @@ function testCRUDUI() {
'id' => $id,
'label' => $label1,
);
- $this->drupalPost('admin/structure/config_test/add', $edit, 'Save');
+ $this->drupalPostForm('admin/structure/config_test/add', $edit, 'Save');
$this->assertUrl('admin/structure/config_test');
$this->assertResponse(200);
$this->assertText($label1);
@@ -250,7 +250,7 @@ function testCRUDUI() {
'id' => strtolower($this->randomName()),
'label' => $label3,
);
- $this->drupalPost("admin/structure/config_test/manage/$id", $edit, 'Save');
+ $this->drupalPostForm("admin/structure/config_test/manage/$id", $edit, 'Save');
$this->assertUrl('admin/structure/config_test');
$this->assertResponse(200);
$this->assertNoText($label1);
@@ -265,13 +265,13 @@ function testCRUDUI() {
'id' => '0',
'label' => '0',
);
- $this->drupalPost('admin/structure/config_test/add', $edit, 'Save');
+ $this->drupalPostForm('admin/structure/config_test/add', $edit, 'Save');
$this->assertResponse(200);
$message_insert = format_string('%label configuration has been created.', array('%label' => $edit['label']));
$this->assertRaw($message_insert);
$this->assertLinkByHref('admin/structure/config_test/manage/0');
$this->assertLinkByHref('admin/structure/config_test/manage/0/delete');
- $this->drupalPost('admin/structure/config_test/manage/0/delete', array(), 'Delete');
+ $this->drupalPostForm('admin/structure/config_test/manage/0/delete', array(), 'Delete');
$this->assertFalse(entity_load('config_test', '0'), 'Test entity deleted');
}
diff --git a/core/modules/config/lib/Drupal/config/Tests/ConfigExportUITest.php b/core/modules/config/lib/Drupal/config/Tests/ConfigExportUITest.php
index 8d7ba53..80c63d6 100644
--- a/core/modules/config/lib/Drupal/config/Tests/ConfigExportUITest.php
+++ b/core/modules/config/lib/Drupal/config/Tests/ConfigExportUITest.php
@@ -48,7 +48,7 @@ function testExport() {
$this->assertFieldById('edit-submit', t('Export'));
// Submit the export form and verify response.
- $this->drupalPost('admin/config/development/export', array(), t('Export'));
+ $this->drupalPostForm('admin/config/development/export', array(), t('Export'));
$this->assertResponse(200, 'User can access the download callback.');
// Get the archived binary file provided to user for download.
diff --git a/core/modules/config/lib/Drupal/config/Tests/ConfigImportUITest.php b/core/modules/config/lib/Drupal/config/Tests/ConfigImportUITest.php
index 59cd19c..737ddf8 100644
--- a/core/modules/config/lib/Drupal/config/Tests/ConfigImportUITest.php
+++ b/core/modules/config/lib/Drupal/config/Tests/ConfigImportUITest.php
@@ -71,7 +71,7 @@ function testImport() {
$this->assertFieldById('edit-submit', t('Import all'));
// Import and verify that both do not appear anymore.
- $this->drupalPost(NULL, array(), t('Import all'));
+ $this->drupalPostForm(NULL, array(), t('Import all'));
$this->assertNoText($name);
$this->assertNoText($dynamic_name);
$this->assertNoFieldById('edit-submit', t('Import all'));
@@ -106,7 +106,7 @@ function testImportLock() {
$this->container->get('lock')->acquire($config_importer_lock);
// Attempt to import configuration and verify that an error message appears.
- $this->drupalPost(NULL, array(), t('Import all'));
+ $this->drupalPostForm(NULL, array(), t('Import all'));
$this->assertText(t('Another request may be synchronizing configuration already.'));
// Release the lock, just to keep testing sane.
diff --git a/core/modules/config/lib/Drupal/config/Tests/ConfigImportUploadTest.php b/core/modules/config/lib/Drupal/config/Tests/ConfigImportUploadTest.php
index e753695..89cdf6f 100644
--- a/core/modules/config/lib/Drupal/config/Tests/ConfigImportUploadTest.php
+++ b/core/modules/config/lib/Drupal/config/Tests/ConfigImportUploadTest.php
@@ -42,7 +42,7 @@ function testImport() {
// Attempt to upload a non-tar file.
$text_file = current($this->drupalGetTestFiles('text'));
$edit = array('files[import_tarball]' => drupal_realpath($text_file->uri));
- $this->drupalPost('admin/config/development/import', $edit, t('Upload'));
+ $this->drupalPostForm('admin/config/development/import', $edit, t('Upload'));
$this->assertText(t('Could not extract the contents of the tar file'));
}
diff --git a/core/modules/config/lib/Drupal/config/Tests/ConfigLocaleOverrideWebTest.php b/core/modules/config/lib/Drupal/config/Tests/ConfigLocaleOverrideWebTest.php
index 99bee07..f98a1e0 100644
--- a/core/modules/config/lib/Drupal/config/Tests/ConfigLocaleOverrideWebTest.php
+++ b/core/modules/config/lib/Drupal/config/Tests/ConfigLocaleOverrideWebTest.php
@@ -44,7 +44,7 @@ function testSiteNameTranslation() {
'name' => $name,
'direction' => '0',
);
- $this->drupalPost('admin/config/regional/language/add', $edit, t('Add custom language'));
+ $this->drupalPostForm('admin/config/regional/language/add', $edit, t('Add custom language'));
// Save an override for the XX language.
\Drupal::config('locale.config.xx.system.site')->set('name', 'XX site name')->save();
diff --git a/core/modules/contact/lib/Drupal/contact/Tests/ContactPersonalTest.php b/core/modules/contact/lib/Drupal/contact/Tests/ContactPersonalTest.php
index e735180..e974ec6 100644
--- a/core/modules/contact/lib/Drupal/contact/Tests/ContactPersonalTest.php
+++ b/core/modules/contact/lib/Drupal/contact/Tests/ContactPersonalTest.php
@@ -134,7 +134,7 @@ function testPersonalContactAccess() {
// Disable the personal contact form.
$this->drupalLogin($this->admin_user);
$edit = array('contact_default_status' => FALSE);
- $this->drupalPost('admin/config/people/accounts', $edit, t('Save configuration'));
+ $this->drupalPostForm('admin/config/people/accounts', $edit, t('Save configuration'));
$this->assertText(t('The configuration options have been saved.'), 'Setting successfully saved.');
$this->drupalLogout();
@@ -171,7 +171,7 @@ function testPersonalContactAccess() {
$this->drupalGet('user/' . $this->web_user->id() . '/edit');
$this->assertNoFieldChecked('edit-contact--2');
$this->assertFalse(\Drupal::service('user.data')->get('contact', $this->web_user->id(), 'enabled'), 'Personal contact form disabled');
- $this->drupalPost(NULL, array('contact' => TRUE), t('Save'));
+ $this->drupalPostForm(NULL, array('contact' => TRUE), t('Save'));
$this->assertFieldChecked('edit-contact--2');
$this->assertTrue(\Drupal::service('user.data')->get('contact', $this->web_user->id(), 'enabled'), 'Personal contact form enabled');
}
@@ -220,7 +220,7 @@ protected function submitPersonalContact($account, array $message = array()) {
'subject' => $this->randomName(16),
'message' => $this->randomName(64),
);
- $this->drupalPost('user/' . $account->id() . '/contact', $message, t('Send message'));
+ $this->drupalPostForm('user/' . $account->id() . '/contact', $message, t('Send message'));
return $message;
}
}
diff --git a/core/modules/contact/lib/Drupal/contact/Tests/ContactSitewideTest.php b/core/modules/contact/lib/Drupal/contact/Tests/ContactSitewideTest.php
index b524dfa..2a4da64 100644
--- a/core/modules/contact/lib/Drupal/contact/Tests/ContactSitewideTest.php
+++ b/core/modules/contact/lib/Drupal/contact/Tests/ContactSitewideTest.php
@@ -53,7 +53,7 @@ function testSiteWideContact() {
// Set settings.
$edit = array();
$edit['contact_default_status'] = TRUE;
- $this->drupalPost('admin/config/people/accounts', $edit, t('Save configuration'));
+ $this->drupalPostForm('admin/config/people/accounts', $edit, t('Save configuration'));
$this->assertText(t('The configuration options have been saved.'));
$this->drupalGet('admin/structure/contact');
@@ -241,9 +241,9 @@ function testSiteWideContact() {
'fields[_add_new_field][type]' => 'text',
);
$field_name = 'field_' . $edit['fields[_add_new_field][field_name]'];
- $this->drupalPost(NULL, $edit, t('Save'));
- $this->drupalPost(NULL, array(), t('Save field settings'));
- $this->drupalPost(NULL, array(), t('Save settings'));
+ $this->drupalPostForm(NULL, $edit, t('Save'));
+ $this->drupalPostForm(NULL, array(), t('Save field settings'));
+ $this->drupalPostForm(NULL, array(), t('Save settings'));
// Check that the field is displayed.
$this->drupalGet('contact/' . $category);
@@ -255,7 +255,7 @@ function testSiteWideContact() {
'message' => $this->randomName(),
$field_name . '[und][0][value]' => $this->randomName(),
);
- $this->drupalPost(NULL, $edit, t('Send message'));
+ $this->drupalPostForm(NULL, $edit, t('Send message'));
$mails = $this->drupalGetMails();
$mail = array_pop($mails);
$this->assertEqual($mail['subject'], t('[@label] @subject', array('@label' => $label, '@subject' => $edit['subject'])));
@@ -330,7 +330,7 @@ function addCategory($id, $label, $recipients, $reply, $selected) {
$edit['recipients'] = $recipients;
$edit['reply'] = $reply;
$edit['selected'] = ($selected ? TRUE : FALSE);
- $this->drupalPost('admin/structure/contact/add', $edit, t('Save'));
+ $this->drupalPostForm('admin/structure/contact/add', $edit, t('Save'));
}
/**
@@ -354,7 +354,7 @@ function updateCategory($id, $label, $recipients, $reply, $selected) {
$edit['recipients'] = $recipients;
$edit['reply'] = $reply;
$edit['selected'] = ($selected ? TRUE : FALSE);
- $this->drupalPost("admin/structure/contact/manage/$id", $edit, t('Save'));
+ $this->drupalPostForm("admin/structure/contact/manage/$id", $edit, t('Save'));
}
/**
@@ -378,10 +378,10 @@ function submitContact($name, $mail, $subject, $id, $message) {
$edit['subject'] = $subject;
$edit['message'] = $message;
if ($id == \Drupal::config('contact.settings')->get('default_category')) {
- $this->drupalPost('contact', $edit, t('Send message'));
+ $this->drupalPostForm('contact', $edit, t('Send message'));
}
else {
- $this->drupalPost('contact/' . $id, $edit, t('Send message'));
+ $this->drupalPostForm('contact/' . $id, $edit, t('Send message'));
}
}
@@ -397,7 +397,7 @@ function deleteCategories() {
$this->assertResponse(403);
}
else {
- $this->drupalPost("admin/structure/contact/manage/$id/delete", array(), t('Delete'));
+ $this->drupalPostForm("admin/structure/contact/manage/$id/delete", array(), t('Delete'));
$this->assertRaw(t('Category %label has been deleted.', array('%label' => $category->label())));
$this->assertFalse(entity_load('contact_category', $id), format_string('Category %category not found', array('%category' => $category->label())));
}
diff --git a/core/modules/content_translation/lib/Drupal/content_translation/Tests/ContentTranslationSettingsTest.php b/core/modules/content_translation/lib/Drupal/content_translation/Tests/ContentTranslationSettingsTest.php
index f4e2f13..ecab4c4 100644
--- a/core/modules/content_translation/lib/Drupal/content_translation/Tests/ContentTranslationSettingsTest.php
+++ b/core/modules/content_translation/lib/Drupal/content_translation/Tests/ContentTranslationSettingsTest.php
@@ -110,7 +110,7 @@ function testSettingsUI() {
$this->drupalGet('admin/structure/types/manage/article');
$this->assertField('language_configuration[content_translation]');
$this->assertNoFieldChecked('edit-language-configuration-content-translation');
- $this->drupalPost('admin/structure/types/manage/article', $edit, t('Save content type'));
+ $this->drupalPostForm('admin/structure/types/manage/article', $edit, t('Save content type'));
$this->drupalGet('admin/structure/types/manage/article');
$this->assertFieldChecked('edit-language-configuration-content-translation');
}
@@ -131,7 +131,7 @@ function testSettingsUI() {
* TRUE if the assertion succeeded, FALSE otherwise.
*/
protected function assertSettings($entity_type, $bundle, $enabled, $edit) {
- $this->drupalPost('admin/config/regional/content-language', $edit, t('Save'));
+ $this->drupalPostForm('admin/config/regional/content-language', $edit, t('Save'));
$args = array('@entity_type' => $entity_type, '@bundle' => $bundle, '@enabled' => $enabled ? 'enabled' : 'disabled');
$message = format_string('Translation for entity @entity_type (@bundle) is @enabled.', $args);
field_info_cache_clear();
diff --git a/core/modules/content_translation/lib/Drupal/content_translation/Tests/ContentTranslationUITest.php b/core/modules/content_translation/lib/Drupal/content_translation/Tests/ContentTranslationUITest.php
index 74b779b..608d9f9 100644
--- a/core/modules/content_translation/lib/Drupal/content_translation/Tests/ContentTranslationUITest.php
+++ b/core/modules/content_translation/lib/Drupal/content_translation/Tests/ContentTranslationUITest.php
@@ -66,7 +66,7 @@ protected function assertBasicTranslation() {
$base_path = $this->controller->getBasePath($entity);
$path = $langcode . '/' . $base_path . '/translations/add/' . $default_langcode . '/' . $langcode;
- $this->drupalPost($path, $this->getEditValues($values, $langcode), $this->getFormSubmitAction($entity));
+ $this->drupalPostForm($path, $this->getEditValues($values, $langcode), $this->getFormSubmitAction($entity));
if ($this->testLanguageSelector) {
$this->assertNoFieldByXPath('//select[@id="edit-langcode"]', NULL, 'Language selector correclty disabled on translations.');
}
@@ -77,13 +77,13 @@ protected function assertBasicTranslation() {
$source_langcode = 'it';
$edit = array('source_langcode[source]' => $source_langcode);
$path = $langcode . '/' . $base_path . '/translations/add/' . $default_langcode . '/' . $langcode;
- $this->drupalPost($path, $edit, t('Change'));
+ $this->drupalPostForm($path, $edit, t('Change'));
$this->assertFieldByXPath("//input[@name=\"{$this->fieldName}[fr][0][value]\"]", $values[$source_langcode][$this->fieldName][0]['value'], 'Source language correctly switched.');
// Add another translation and mark the other ones as outdated.
$values[$langcode] = $this->getNewEntityValues($langcode);
$edit = $this->getEditValues($values, $langcode) + array('content_translation[retranslate]' => TRUE);
- $this->drupalPost($path, $edit, $this->getFormSubmitAction($entity));
+ $this->drupalPostForm($path, $edit, $this->getFormSubmitAction($entity));
$entity = entity_load($this->entityType, $this->entityId, TRUE);
// Check that the entered values have been correctly stored.
@@ -108,7 +108,7 @@ protected function assertOutdatedStatus() {
// Mark translations as outdated.
$edit = array('content_translation[retranslate]' => TRUE);
- $this->drupalPost($langcode . '/' . $this->controller->getEditPath($entity), $edit, $this->getFormSubmitAction($entity));
+ $this->drupalPostForm($langcode . '/' . $this->controller->getEditPath($entity), $edit, $this->getFormSubmitAction($entity));
$entity = entity_load($this->entityType, $this->entityId, TRUE);
// Check that every translation has the correct "outdated" status.
@@ -122,7 +122,7 @@ protected function assertOutdatedStatus() {
else {
$this->assertFieldByXPath('//input[@name="content_translation[outdated]"]', TRUE, 'The translate flag is checked by default.');
$edit = array('content_translation[outdated]' => FALSE);
- $this->drupalPost($path, $edit, $this->getFormSubmitAction($entity));
+ $this->drupalPostForm($path, $edit, $this->getFormSubmitAction($entity));
$this->drupalGet($path);
$this->assertFieldByXPath('//input[@name="content_translation[retranslate]"]', FALSE, 'The retranslate flag is now shown.');
$entity = entity_load($this->entityType, $this->entityId, TRUE);
@@ -142,7 +142,7 @@ protected function assertPublishedStatus() {
foreach ($this->langcodes as $index => $langcode) {
if ($index > 0) {
$edit = array('content_translation[status]' => FALSE);
- $this->drupalPost($langcode . '/' . $path, $edit, $this->getFormSubmitAction($entity));
+ $this->drupalPostForm($langcode . '/' . $path, $edit, $this->getFormSubmitAction($entity));
$entity = entity_load($this->entityType, $this->entityId, TRUE);
$this->assertFalse($entity->translation[$langcode]['status'], 'The translation has been correctly unpublished.');
}
@@ -173,7 +173,7 @@ protected function assertAuthoringInfo() {
'content_translation[created]' => format_date($values[$langcode]['created'], 'custom', 'Y-m-d H:i:s O'),
);
$prefix = $index > 0 ? $langcode . '/' : '';
- $this->drupalPost($prefix . $path, $edit, $this->getFormSubmitAction($entity));
+ $this->drupalPostForm($prefix . $path, $edit, $this->getFormSubmitAction($entity));
}
$entity = entity_load($this->entityType, $this->entityId, TRUE);
@@ -189,7 +189,7 @@ protected function assertAuthoringInfo() {
'content_translation[name]' => $this->randomName(12),
'content_translation[created]' => '19/11/1978',
);
- $this->drupalPost($path, $edit, $this->getFormSubmitAction($entity));
+ $this->drupalPostForm($path, $edit, $this->getFormSubmitAction($entity));
$this->assertTrue($this->xpath('//div[contains(@class, "error")]//ul'), 'Invalid values generate a list of form errors.');
$this->assertEqual($entity->translation[$langcode]['uid'] == $values[$langcode]['uid'], 'Translation author correctly kept.');
$this->assertEqual($entity->translation[$langcode]['created'] == $values[$langcode]['created'], 'Translation date correctly kept.');
@@ -202,8 +202,8 @@ protected function assertTranslationDeletion() {
// Confirm and delete a translation.
$langcode = 'fr';
$entity = entity_load($this->entityType, $this->entityId, TRUE);
- $this->drupalPost($langcode . '/' . $this->controller->getEditPath($entity), array(), t('Delete translation'));
- $this->drupalPost(NULL, array(), t('Delete'));
+ $this->drupalPostForm($langcode . '/' . $this->controller->getEditPath($entity), array(), t('Delete translation'));
+ $this->drupalPostForm(NULL, array(), t('Delete'));
$entity = entity_load($this->entityType, $this->entityId, TRUE);
if ($this->assertTrue(is_object($entity), 'Entity found')) {
$translations = $entity->getTranslationLanguages();
diff --git a/core/modules/content_translation/lib/Drupal/content_translation/Tests/ContentTranslationWorkflowsTest.php b/core/modules/content_translation/lib/Drupal/content_translation/Tests/ContentTranslationWorkflowsTest.php
index ec414f9..c523900 100644
--- a/core/modules/content_translation/lib/Drupal/content_translation/Tests/ContentTranslationWorkflowsTest.php
+++ b/core/modules/content_translation/lib/Drupal/content_translation/Tests/ContentTranslationWorkflowsTest.php
@@ -68,7 +68,7 @@ protected function setupEntity() {
// Create a translation.
$this->drupalLogin($this->translator);
$add_translation_path = $this->controller->getBasePath($this->entity) . "/translations/add/$default_langcode/{$this->langcodes[2]}";
- $this->drupalPost($add_translation_path, array(), t('Save'));
+ $this->drupalPostForm($add_translation_path, array(), t('Save'));
$this->rebuildContainer();
}
diff --git a/core/modules/contextual/lib/Drupal/contextual/Tests/ContextualDynamicContextTest.php b/core/modules/contextual/lib/Drupal/contextual/Tests/ContextualDynamicContextTest.php
index 3c35e48..638ce15 100644
--- a/core/modules/contextual/lib/Drupal/contextual/Tests/ContextualDynamicContextTest.php
+++ b/core/modules/contextual/lib/Drupal/contextual/Tests/ContextualDynamicContextTest.php
@@ -147,30 +147,10 @@ protected function assertNoContextualLinkPlaceHolder($id) {
* The response body.
*/
protected function renderContextualLinks($ids, $current_path) {
- // Build POST values.
$post = array();
for ($i = 0; $i < count($ids); $i++) {
$post['ids[' . $i . ']'] = $ids[$i];
}
-
- // Serialize POST values.
- foreach ($post as $key => $value) {
- // Encode according to application/x-www-form-urlencoded
- // Both names and values needs to be urlencoded, according to
- // http://www.w3.org/TR/html4/interact/forms.html#h-17.13.4.1
- $post[$key] = urlencode($key) . '=' . urlencode($value);
- }
- $post = implode('&', $post);
-
- // Perform HTTP request.
- return $this->curlExec(array(
- CURLOPT_URL => url('contextual/render', array('absolute' => TRUE, 'query' => array('destination' => $current_path))),
- CURLOPT_POST => TRUE,
- CURLOPT_POSTFIELDS => $post,
- CURLOPT_HTTPHEADER => array(
- 'Accept: application/json',
- 'Content-Type: application/x-www-form-urlencoded',
- ),
- ));
+ return $this->drupalPost('contextual/render', 'application/json', $post, array('query' => array('destination' => $current_path)));
}
}
diff --git a/core/modules/datetime/lib/Drupal/datetime/Tests/DatetimeFieldTest.php b/core/modules/datetime/lib/Drupal/datetime/Tests/DatetimeFieldTest.php
index 09d4380..d3cfca4 100644
--- a/core/modules/datetime/lib/Drupal/datetime/Tests/DatetimeFieldTest.php
+++ b/core/modules/datetime/lib/Drupal/datetime/Tests/DatetimeFieldTest.php
@@ -113,7 +113,7 @@ function testDateField() {
'name' => $this->randomName(),
"{$field_name}[$langcode][0][value][date]" => $date->format($date_format),
);
- $this->drupalPost(NULL, $edit, t('Save'));
+ $this->drupalPostForm(NULL, $edit, t('Save'));
preg_match('|entity_test/manage/(\d+)/edit|', $this->url, $match);
$id = $match[1];
$this->assertText(t('entity_test @id has been created.', array('@id' => $id)));
@@ -185,7 +185,7 @@ function testDatetimeField() {
"{$field_name}[$langcode][0][value][date]" => $date->format($date_format),
"{$field_name}[$langcode][0][value][time]" => $date->format($time_format),
);
- $this->drupalPost(NULL, $edit, t('Save'));
+ $this->drupalPostForm(NULL, $edit, t('Save'));
preg_match('|entity_test/manage/(\d+)/edit|', $this->url, $match);
$id = $match[1];
$this->assertText(t('entity_test @id has been created.', array('@id' => $id)));
@@ -279,7 +279,7 @@ function testDatelistWidget() {
$edit["{$field_name}[$langcode][0][value][$part]"] = $value;
}
- $this->drupalPost(NULL, $edit, t('Save'));
+ $this->drupalPostForm(NULL, $edit, t('Save'));
preg_match('|entity_test/manage/(\d+)/edit|', $this->url, $match);
$id = $match[1];
$this->assertText(t('entity_test @id has been created.', array('@id' => $id)));
@@ -355,7 +355,7 @@ function testInvalidField() {
"{$field_name}[$langcode][0][value][date]" => $date_value,
"{$field_name}[$langcode][0][value][time]" => '12:00:00',
);
- $this->drupalPost(NULL, $edit, t('Save'));
+ $this->drupalPostForm(NULL, $edit, t('Save'));
$this->assertText('date is invalid', 'Empty date value has been caught.');
$date_value = 'aaaa-12-01';
@@ -363,7 +363,7 @@ function testInvalidField() {
"{$field_name}[$langcode][0][value][date]" => $date_value,
"{$field_name}[$langcode][0][value][time]" => '00:00:00',
);
- $this->drupalPost(NULL, $edit, t('Save'));
+ $this->drupalPostForm(NULL, $edit, t('Save'));
$this->assertText('date is invalid', format_string('Invalid year value %date has been caught.', array('%date' => $date_value)));
$date_value = '2012-75-01';
@@ -371,7 +371,7 @@ function testInvalidField() {
"{$field_name}[$langcode][0][value][date]" => $date_value,
"{$field_name}[$langcode][0][value][time]" => '00:00:00',
);
- $this->drupalPost(NULL, $edit, t('Save'));
+ $this->drupalPostForm(NULL, $edit, t('Save'));
$this->assertText('date is invalid', format_string('Invalid month value %date has been caught.', array('%date' => $date_value)));
$date_value = '2012-12-99';
@@ -379,7 +379,7 @@ function testInvalidField() {
"{$field_name}[$langcode][0][value][date]" => $date_value,
"{$field_name}[$langcode][0][value][time]" => '00:00:00',
);
- $this->drupalPost(NULL, $edit, t('Save'));
+ $this->drupalPostForm(NULL, $edit, t('Save'));
$this->assertText('date is invalid', format_string('Invalid day value %date has been caught.', array('%date' => $date_value)));
$date_value = '2012-12-01';
@@ -388,7 +388,7 @@ function testInvalidField() {
"{$field_name}[$langcode][0][value][date]" => $date_value,
"{$field_name}[$langcode][0][value][time]" => $time_value,
);
- $this->drupalPost(NULL, $edit, t('Save'));
+ $this->drupalPostForm(NULL, $edit, t('Save'));
$this->assertText('date is invalid', 'Empty time value has been caught.');
$date_value = '2012-12-01';
@@ -397,7 +397,7 @@ function testInvalidField() {
"{$field_name}[$langcode][0][value][date]" => $date_value,
"{$field_name}[$langcode][0][value][time]" => $time_value,
);
- $this->drupalPost(NULL, $edit, t('Save'));
+ $this->drupalPostForm(NULL, $edit, t('Save'));
$this->assertText('date is invalid', format_string('Invalid hour value %time has been caught.', array('%time' => $time_value)));
$date_value = '2012-12-01';
@@ -406,7 +406,7 @@ function testInvalidField() {
"{$field_name}[$langcode][0][value][date]" => $date_value,
"{$field_name}[$langcode][0][value][time]" => $time_value,
);
- $this->drupalPost(NULL, $edit, t('Save'));
+ $this->drupalPostForm(NULL, $edit, t('Save'));
$this->assertText('date is invalid', format_string('Invalid minute value %time has been caught.', array('%time' => $time_value)));
$date_value = '2012-12-01';
@@ -415,7 +415,7 @@ function testInvalidField() {
"{$field_name}[$langcode][0][value][date]" => $date_value,
"{$field_name}[$langcode][0][value][time]" => $time_value,
);
- $this->drupalPost(NULL, $edit, t('Save'));
+ $this->drupalPostForm(NULL, $edit, t('Save'));
$this->assertText('date is invalid', format_string('Invalid second value %time has been caught.', array('%time' => $time_value)));
}
diff --git a/core/modules/dblog/lib/Drupal/dblog/Tests/DbLogTest.php b/core/modules/dblog/lib/Drupal/dblog/Tests/DbLogTest.php
index c9a34bc..24142b9 100644
--- a/core/modules/dblog/lib/Drupal/dblog/Tests/DbLogTest.php
+++ b/core/modules/dblog/lib/Drupal/dblog/Tests/DbLogTest.php
@@ -86,7 +86,7 @@ private function verifyRowLimit($row_limit) {
// Change the database log row limit.
$edit = array();
$edit['dblog_row_limit'] = $row_limit;
- $this->drupalPost('admin/config/development/logging', $edit, t('Save configuration'));
+ $this->drupalPostForm('admin/config/development/logging', $edit, t('Save configuration'));
$this->assertResponse(200);
// Check row limit variable.
@@ -227,7 +227,7 @@ private function doUser() {
$edit['pass[pass1]'] = $pass;
$edit['pass[pass2]'] = $pass;
$edit['status'] = 1;
- $this->drupalPost('admin/people/create', $edit, t('Create new account'));
+ $this->drupalPostForm('admin/people/create', $edit, t('Create new account'));
$this->assertResponse(200);
// Retrieve the user object.
$user = user_load_by_name($name);
@@ -250,7 +250,7 @@ private function doUser() {
$this->drupalLogin($this->big_user);
// Delete the user created at the start of this test.
// We need to POST here to invoke batch_process() in the internal browser.
- $this->drupalPost('user/' . $user->id() . '/cancel', array('user_cancel_method' => 'user_cancel_reassign'), t('Cancel account'));
+ $this->drupalPostForm('user/' . $user->id() . '/cancel', array('user_cancel_method' => 'user_cancel_reassign'), t('Cancel account'));
// View the database log report.
$this->drupalGet('admin/reports/dblog');
@@ -314,17 +314,17 @@ private function doNode($type) {
$edit = $this->getContent($type);
$langcode = Language::LANGCODE_NOT_SPECIFIED;
$title = $edit["title"];
- $this->drupalPost('node/add/' . $type, $edit, t('Save'));
+ $this->drupalPostForm('node/add/' . $type, $edit, t('Save'));
$this->assertResponse(200);
// Retrieve the node object.
$node = $this->drupalGetNodeByTitle($title);
$this->assertTrue($node != NULL, format_string('Node @title was loaded', array('@title' => $title)));
// Edit the node.
$edit = $this->getContentUpdate($type);
- $this->drupalPost('node/' . $node->id() . '/edit', $edit, t('Save'));
+ $this->drupalPostForm('node/' . $node->id() . '/edit', $edit, t('Save'));
$this->assertResponse(200);
// Delete the node.
- $this->drupalPost('node/' . $node->id() . '/delete', array(), t('Delete'));
+ $this->drupalPostForm('node/' . $node->id() . '/delete', array(), t('Delete'));
$this->assertResponse(200);
// View the node (to generate page not found event).
$this->drupalGet('node/' . $node->id());
@@ -437,7 +437,7 @@ protected function testDBLogAddAndClear() {
// Login the admin user.
$this->drupalLogin($this->big_user);
// Post in order to clear the database table.
- $this->drupalPost('admin/reports/dblog', array(), t('Clear log messages'));
+ $this->drupalPostForm('admin/reports/dblog', array(), t('Clear log messages'));
// Count the rows in watchdog that previously related to the deleted user.
$count = db_query('SELECT COUNT(*) FROM {watchdog}')->fetchField();
$this->assertEqual($count, 0, format_string('DBLog contains :count records after a clear.', array(':count' => $count)));
@@ -483,7 +483,7 @@ protected function testFilter() {
$edit = array(
'type[]' => array($type_name),
);
- $this->drupalPost(NULL, $edit, t('Filter'));
+ $this->drupalPostForm(NULL, $edit, t('Filter'));
// Count the number of entries of this type.
$type_count = 0;
@@ -504,7 +504,7 @@ protected function testFilter() {
'type[]' => array($type['type']),
'severity[]' => array($type['severity']),
);
- $this->drupalPost(NULL, $edit, t('Filter'));
+ $this->drupalPostForm(NULL, $edit, t('Filter'));
$count = $this->getTypeCount($types);
$this->assertEqual(array_sum($count), $type['count'], 'Count matched');
@@ -515,7 +515,7 @@ protected function testFilter() {
$this->assertText(t('Operations'), 'Operations text found');
// Clear all logs and make sure the confirmation message is found.
- $this->drupalPost('admin/reports/dblog', array(), t('Clear log messages'));
+ $this->drupalPostForm('admin/reports/dblog', array(), t('Clear log messages'));
$this->assertText(t('Database log cleared.'), 'Confirmation message found');
}
diff --git a/core/modules/edit/lib/Drupal/edit/Tests/EditLoadingTest.php b/core/modules/edit/lib/Drupal/edit/Tests/EditLoadingTest.php
index d3e474c..b9d1386 100644
--- a/core/modules/edit/lib/Drupal/edit/Tests/EditLoadingTest.php
+++ b/core/modules/edit/lib/Drupal/edit/Tests/EditLoadingTest.php
@@ -86,18 +86,21 @@ function testUserWithoutPermission() {
$this->assertRaw('data-edit-id="node/1/body/und/full"');
// Retrieving the metadata should result in an empty 403 response.
- $response = $this->retrieveMetadata(array('node/1/body/und/full'));
+ $post = array('fields[0]' => 'node/1/body/und/full');
+ $response = $this->drupalPost('edit/metadata', 'application/json', $post);
$this->assertIdentical('{}', $response);
$this->assertResponse(403);
// Edit's JavaScript would never hit these endpoints if the metadata was
// empty as above, but we need to make sure that malicious users aren't able
// to use any of the other endpoints either.
- $response = $this->retrieveAttachments(array('form'));
+ $post = array('editors[0]' => 'form') + $this->getAjaxPageStatePostData();
+ $response = $this->drupalPost('edit/attachments', 'application/vnd.drupal-ajax', $post);
// @todo Uncomment the below once https://drupal.org/node/2063303 is fixed.
// $this->assertIdentical('[]', $response);
$this->assertResponse(403);
- $response = $this->retrieveFieldForm('node/1/body/und/full');
+ $post = array('nocssjs' => 'true') + $this->getAjaxPageStatePostData();
+ $response = $this->drupalPost('edit/form/' . 'node/1/body/und/full', 'application/vnd.drupal-ajax', $post);
// @todo Uncomment the below once https://drupal.org/node/2063303 is fixed.
// $this->assertIdentical('[]', $response);
$this->assertResponse(403);
@@ -109,11 +112,12 @@ function testUserWithoutPermission() {
$edit['body[und][0][value]'] = 'Malicious content.
';
$edit['body[und][0][format]'] = 'filtered_html';
$edit['op'] = t('Save');
- $response = $this->submitFieldForm('node/1/body/und/full', $edit);
+ $response = $this->drupalPost('edit/form/' . 'node/1/body/und/full', 'application/vnd.drupal-ajax', $post);
// @todo Uncomment the below once https://drupal.org/node/2063303 is fixed.
// $this->assertIdentical('[]', $response);
$this->assertResponse(403);
- $response = $this->saveEntity('node/1');
+ $post = array('nocssjs' => 'true');
+ $response = $this->drupalPost('edit/entity/' . 'node/1', 'application/json', $post);
// @todo Uncomment the below once https://drupal.org/node/2063303 is fixed.
// $this->assertIdentical('[]', $response);
$this->assertResponse(403);
@@ -140,7 +144,8 @@ function testUserWithPermission() {
// Retrieving the metadata should result in a 200 JSON response.
$htmlPageDrupalSettings = $this->drupalSettings;
- $response = $this->retrieveMetadata(array('node/1/body/und/full'));
+ $post = array('fields[0]' => 'node/1/body/und/full');
+ $response = $this->drupalPost('edit/metadata', 'application/json', $post);
$this->assertResponse(200);
$expected = array(
'node/1/body/und/full' => array(
@@ -158,7 +163,8 @@ function testUserWithPermission() {
// Retrieving the attachments should result in a 200 response, containing:
// 1. a settings command with useless metadata: AjaxController is dumb
// 2. an insert command that loads the required in-place editors
- $response = $this->retrieveAttachments(array('form'));
+ $post = array('editors[0]' => 'form') + $this->getAjaxPageStatePostData();
+ $response = $this->drupalPost('edit/attachments', 'application/vnd.drupal-ajax', $post);
$ajax_commands = drupal_json_decode($response);
$this->assertIdentical(2, count($ajax_commands), 'The attachments HTTP request results in two AJAX commands.');
// First command: settings.
@@ -170,32 +176,35 @@ function testUserWithPermission() {
// Retrieving the form for this field should result in a 200 response,
// containing only an editFieldForm command.
- $response = $this->retrieveFieldForm('node/1/body/und/full');
+ $post = array('nocssjs' => 'true') + $this->getAjaxPageStatePostData();
+ $response = $this->drupalPost('edit/form/' . 'node/1/body/und/full', 'application/vnd.drupal-ajax', $post);
$this->assertResponse(200);
$ajax_commands = drupal_json_decode($response);
$this->assertIdentical(1, count($ajax_commands), 'The field form HTTP request results in one AJAX command.');
$this->assertIdentical('editFieldForm', $ajax_commands[0]['command'], 'The first AJAX command is an editFieldForm command.');
$this->assertIdentical('