.../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 | 10 +-- .../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 | 2 +- .../Drupal/datetime/Tests/DatetimeFieldTest.php | 22 +++--- .../dblog/lib/Drupal/dblog/Tests/DbLogTest.php | 20 +++--- .../edit/lib/Drupal/edit/Tests/EditLoadingTest.php | 22 +++--- .../editor/Tests/EditIntegrationLoadingTest.php | 4 +- .../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 | 30 ++++---- .../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 | 36 +++++----- .../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 | 36 +++++----- .../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, 1557 insertions(+), 1557 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 3e192b1..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'); @@ -163,7 +163,7 @@ public function testBlockContextualLinks() { // Get server-rendered contextual links. // @see \Drupal\contextual\Tests\ContextualDynamicContextTest:renderContextualLinks() $post = array('ids[0]' => $id); - $response = $this->drupalPostUrl('contextual/render', 'application/json', $post, array('query' => array('destination' => 'test-page'))); + $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 82c7e73..638ce15 100644 --- a/core/modules/contextual/lib/Drupal/contextual/Tests/ContextualDynamicContextTest.php +++ b/core/modules/contextual/lib/Drupal/contextual/Tests/ContextualDynamicContextTest.php @@ -151,6 +151,6 @@ protected function renderContextualLinks($ids, $current_path) { for ($i = 0; $i < count($ids); $i++) { $post['ids[' . $i . ']'] = $ids[$i]; } - return $this->drupalPostUrl('contextual/render', 'application/json', $post, array('query' => array('destination' => $current_path))); + 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 f5fc0cb..b9d1386 100644 --- a/core/modules/edit/lib/Drupal/edit/Tests/EditLoadingTest.php +++ b/core/modules/edit/lib/Drupal/edit/Tests/EditLoadingTest.php @@ -87,7 +87,7 @@ function testUserWithoutPermission() { // Retrieving the metadata should result in an empty 403 response. $post = array('fields[0]' => 'node/1/body/und/full'); - $response = $this->drupalPostUrl('edit/metadata', 'application/json', $post); + $response = $this->drupalPost('edit/metadata', 'application/json', $post); $this->assertIdentical('{}', $response); $this->assertResponse(403); @@ -95,12 +95,12 @@ function testUserWithoutPermission() { // empty as above, but we need to make sure that malicious users aren't able // to use any of the other endpoints either. $post = array('editors[0]' => 'form') + $this->getAjaxPageStatePostData(); - $response = $this->drupalPostUrl('edit/attachments', 'application/vnd.drupal-ajax', $post); + $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); $post = array('nocssjs' => 'true') + $this->getAjaxPageStatePostData(); - $response = $this->drupalPostUrl('edit/form/' . 'node/1/body/und/full', 'application/vnd.drupal-ajax', $post); + $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); @@ -112,12 +112,12 @@ function testUserWithoutPermission() { $edit['body[und][0][value]'] = '

Malicious content.

'; $edit['body[und][0][format]'] = 'filtered_html'; $edit['op'] = t('Save'); - $response = $this->drupalPostUrl('edit/form/' . 'node/1/body/und/full', 'application/vnd.drupal-ajax', $post); + $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); $post = array('nocssjs' => 'true'); - $response = $this->drupalPostUrl('edit/entity/' . 'node/1', 'application/json', $post); + $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); @@ -145,7 +145,7 @@ function testUserWithPermission() { // Retrieving the metadata should result in a 200 JSON response. $htmlPageDrupalSettings = $this->drupalSettings; $post = array('fields[0]' => 'node/1/body/und/full'); - $response = $this->drupalPostUrl('edit/metadata', 'application/json', $post); + $response = $this->drupalPost('edit/metadata', 'application/json', $post); $this->assertResponse(200); $expected = array( 'node/1/body/und/full' => array( @@ -164,7 +164,7 @@ function testUserWithPermission() { // 1. a settings command with useless metadata: AjaxController is dumb // 2. an insert command that loads the required in-place editors $post = array('editors[0]' => 'form') + $this->getAjaxPageStatePostData(); - $response = $this->drupalPostUrl('edit/attachments', 'application/vnd.drupal-ajax', $post); + $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. @@ -177,14 +177,14 @@ function testUserWithPermission() { // Retrieving the form for this field should result in a 200 response, // containing only an editFieldForm command. $post = array('nocssjs' => 'true') + $this->getAjaxPageStatePostData(); - $response = $this->drupalPostUrl('edit/form/' . 'node/1/body/und/full', 'application/vnd.drupal-ajax', $post); + $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('
drupalPostUrl('edit/form/' . 'node/1/body/und/full', 'application/vnd.drupal-ajax', $post); + $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.'); @@ -217,7 +217,7 @@ function testUserWithPermission() { // Save the entity by moving the TempStore values to entity storage. $post = array('nocssjs' => 'true'); - $response = $this->drupalPostUrl('edit/entity/' . 'node/1', 'application/json', $post); + $response = $this->drupalPost('edit/entity/' . 'node/1', 'application/json', $post); $this->assertResponse(200); $ajax_commands = drupal_json_decode($response); $this->assertIdentical(1, count($ajax_commands), 'The entity submission HTTP request results in one AJAX command.'); diff --git a/core/modules/editor/lib/Drupal/editor/Tests/EditIntegrationLoadingTest.php b/core/modules/editor/lib/Drupal/editor/Tests/EditIntegrationLoadingTest.php index 113719b..edd74bc 100644 --- a/core/modules/editor/lib/Drupal/editor/Tests/EditIntegrationLoadingTest.php +++ b/core/modules/editor/lib/Drupal/editor/Tests/EditIntegrationLoadingTest.php @@ -93,7 +93,7 @@ function testUsersWithoutPermission() { $this->assertRaw('

Do you also love Drupal?

Druplicon
'); // Retrieving the untransformed text should result in an empty 403 response. - $response = $this->drupalPostUrl('editor/' . 'node/1/body/und/full', 'application/vnd.drupal-ajax', array()); + $response = $this->drupalPost('editor/' . 'node/1/body/und/full', 'application/vnd.drupal-ajax', array()); $this->assertResponse(403); // @todo Uncomment the below once https://drupal.org/node/2063303 is fixed. // $this->assertIdentical('[]', $response); @@ -111,7 +111,7 @@ function testUserWithPermission() { // Ensure the text is transformed. $this->assertRaw('

Do you also love Drupal?

Druplicon
'); - $response = $this->drupalPostUrl('editor/' . 'node/1/body/und/full', 'application/vnd.drupal-ajax', array()); + $response = $this->drupalPost('editor/' . 'node/1/body/und/full', 'application/vnd.drupal-ajax', array()); $this->assertResponse(200); $ajax_commands = drupal_json_decode($response); $this->assertIdentical(1, count($ajax_commands), 'The untransformed text POST request results in one AJAX command.'); diff --git a/core/modules/editor/lib/Drupal/editor/Tests/EditorAdminTest.php b/core/modules/editor/lib/Drupal/editor/Tests/EditorAdminTest.php index 0bc89e1..f988cf7 100644 --- a/core/modules/editor/lib/Drupal/editor/Tests/EditorAdminTest.php +++ b/core/modules/editor/lib/Drupal/editor/Tests/EditorAdminTest.php @@ -79,7 +79,7 @@ function testAddEditorToExistingFormat() { $edit = $this->selectUnicornEditor(); // Configure Unicorn Editor's setting to another value. $edit['editor[settings][foo]'] = 'baz'; - $this->drupalPost(NULL, $edit, t('Save configuration')); + $this->drupalPostForm(NULL, $edit, t('Save configuration')); $this->verifyUnicornEditorConfiguration('filtered_html', 'baz'); } @@ -96,7 +96,7 @@ function testAddEditorToNewFormat() { 'format' => 'monocerus', ); $edit += $this->selectUnicornEditor(); - $this->drupalPost(NULL, $edit, t('Save configuration')); + $this->drupalPostForm(NULL, $edit, t('Save configuration')); $this->verifyUnicornEditorConfiguration($edit['format']); } @@ -133,7 +133,7 @@ protected function selectUnicornEditor() { $edit = array( 'editor[editor]' => 'unicorn', ); - $this->drupalPostAjax(NULL, $edit, 'editor_configure'); + $this->drupalPostAjaxForm(NULL, $edit, 'editor_configure'); $unicorn_setting_foo = $this->xpath('//input[@name="editor[settings][foo]" and @type="text" and @value="bar"]'); $this->assertTrue(count($unicorn_setting_foo), "Unicorn Editor's settings form is present."); diff --git a/core/modules/email/lib/Drupal/email/Tests/EmailFieldTest.php b/core/modules/email/lib/Drupal/email/Tests/EmailFieldTest.php index d051ba2..587135d 100644 --- a/core/modules/email/lib/Drupal/email/Tests/EmailFieldTest.php +++ b/core/modules/email/lib/Drupal/email/Tests/EmailFieldTest.php @@ -103,7 +103,7 @@ function testEmailField() { 'name' => $this->randomName(), "{$field_name}[$langcode][0][value]" => $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))); diff --git a/core/modules/entity/lib/Drupal/entity/Tests/EntityDisplayModeTest.php b/core/modules/entity/lib/Drupal/entity/Tests/EntityDisplayModeTest.php index ba73fdb..74625e1 100644 --- a/core/modules/entity/lib/Drupal/entity/Tests/EntityDisplayModeTest.php +++ b/core/modules/entity/lib/Drupal/entity/Tests/EntityDisplayModeTest.php @@ -52,16 +52,16 @@ public function testEntityViewModeUI() { 'id' => strtolower($this->randomName()), 'label' => $this->randomString(), ); - $this->drupalPost(NULL, $edit, t('Save')); + $this->drupalPostForm(NULL, $edit, t('Save')); $this->assertRaw(t('Saved the %label view mode.', array('%label' => $edit['label']))); // Test editing the view mode. $this->drupalGet('admin/structure/display-modes/view/manage/entity_test_render.' . $edit['id']); // Test deleting the view mode. - $this->drupalPost(NULL, NULL, t('Delete')); + $this->drupalPostForm(NULL, NULL, t('Delete')); $this->assertRaw(t('Are you sure you want to delete the %label view mode?', array('%label' => $edit['label']))); - $this->drupalPost(NULL, NULL, t('Delete')); + $this->drupalPostForm(NULL, NULL, t('Delete')); $this->assertRaw(t('Deleted the %label view mode.', array('%label' => $edit['label']))); } @@ -88,16 +88,16 @@ public function testEntityFormModeUI() { 'id' => strtolower($this->randomName()), 'label' => $this->randomString(), ); - $this->drupalPost(NULL, $edit, t('Save')); + $this->drupalPostForm(NULL, $edit, t('Save')); $this->assertRaw(t('Saved the %label form mode.', array('%label' => $edit['label']))); // Test editing the form mode. $this->drupalGet('admin/structure/display-modes/form/manage/entity_test.' . $edit['id']); // Test deleting the form mode. - $this->drupalPost(NULL, NULL, t('Delete')); + $this->drupalPostForm(NULL, NULL, t('Delete')); $this->assertRaw(t('Are you sure you want to delete the %label form mode?', array('%label' => $edit['label']))); - $this->drupalPost(NULL, NULL, t('Delete')); + $this->drupalPostForm(NULL, NULL, t('Delete')); $this->assertRaw(t('Deleted the %label form mode.', array('%label' => $edit['label']))); } diff --git a/core/modules/entity_reference/lib/Drupal/entity_reference/Tests/EntityReferenceAdminTest.php b/core/modules/entity_reference/lib/Drupal/entity_reference/Tests/EntityReferenceAdminTest.php index bdf0b3e..acef71e 100644 --- a/core/modules/entity_reference/lib/Drupal/entity_reference/Tests/EntityReferenceAdminTest.php +++ b/core/modules/entity_reference/lib/Drupal/entity_reference/Tests/EntityReferenceAdminTest.php @@ -66,7 +66,7 @@ public function testFieldAdminHandler() { $bundle_path = 'admin/structure/types/manage/' . $this->type; // First step: 'Add new field' on the 'Manage fields' page. - $this->drupalPost($bundle_path . '/fields', array( + $this->drupalPostForm($bundle_path . '/fields', array( 'fields[_add_new_field][label]' => 'Test label', 'fields[_add_new_field][field_name]' => 'test', 'fields[_add_new_field][type]' => 'entity_reference', @@ -76,7 +76,7 @@ public function testFieldAdminHandler() { $this->assertFieldByName('field[settings][target_type]', 'node'); // Second step: 'Instance settings' form. - $this->drupalPost(NULL, array(), t('Save field settings')); + $this->drupalPostForm(NULL, array(), t('Save field settings')); // The base handler should be selected by default. $this->assertFieldByName('instance[settings][handler]', 'default'); @@ -95,13 +95,13 @@ public function testFieldAdminHandler() { $this->assertFieldByName('instance[settings][handler_settings][sort][field]', '_none'); $this->assertNoFieldByName('instance[settings][handler_settings][sort][direction]'); // Option 1: sort by field. - $this->drupalPostAJAX(NULL, array('instance[settings][handler_settings][sort][field]' => 'nid'), 'instance[settings][handler_settings][sort][field]'); + $this->drupalPostAjaxForm(NULL, array('instance[settings][handler_settings][sort][field]' => 'nid'), 'instance[settings][handler_settings][sort][field]'); $this->assertFieldByName('instance[settings][handler_settings][sort][direction]', 'ASC'); // Set back to no sort. - $this->drupalPostAJAX(NULL, array('instance[settings][handler_settings][sort][field]' => '_none'), 'instance[settings][handler_settings][sort][field]'); + $this->drupalPostAjaxForm(NULL, array('instance[settings][handler_settings][sort][field]' => '_none'), 'instance[settings][handler_settings][sort][field]'); // Third step: confirm. - $this->drupalPost(NULL, array( + $this->drupalPostForm(NULL, array( 'instance[settings][handler_settings][target_bundles][' . key($bundles) . ']' => key($bundles), ), t('Save settings')); diff --git a/core/modules/entity_reference/lib/Drupal/entity_reference/Tests/EntityReferenceAutoCreateTest.php b/core/modules/entity_reference/lib/Drupal/entity_reference/Tests/EntityReferenceAutoCreateTest.php index d81dc5e..ba5d779 100644 --- a/core/modules/entity_reference/lib/Drupal/entity_reference/Tests/EntityReferenceAutoCreateTest.php +++ b/core/modules/entity_reference/lib/Drupal/entity_reference/Tests/EntityReferenceAutoCreateTest.php @@ -98,7 +98,7 @@ public function testAutoCreate() { 'title' => $this->randomName(), 'test_field[und][0][target_id]' => $new_title, ); - $this->drupalPost("node/add/$this->referencing_type", $edit, 'Save'); + $this->drupalPostForm("node/add/$this->referencing_type", $edit, 'Save'); // Assert referenced node was created. $query = clone $base_query; diff --git a/core/modules/field/lib/Drupal/field/Tests/FormTest.php b/core/modules/field/lib/Drupal/field/Tests/FormTest.php index 2a8f43c..716b412 100644 --- a/core/modules/field/lib/Drupal/field/Tests/FormTest.php +++ b/core/modules/field/lib/Drupal/field/Tests/FormTest.php @@ -121,7 +121,7 @@ function testFieldFormSingle() { 'name' => $this->randomName(), "{$field_name}[$langcode][0][value]" => -1 ); - $this->drupalPost(NULL, $edit, t('Save')); + $this->drupalPostForm(NULL, $edit, t('Save')); $this->assertRaw(t('%name does not accept the value -1.', array('%name' => $this->instance['label'])), 'Field validation fails with invalid input.'); // TODO : check that the correct field is flagged for error. @@ -132,7 +132,7 @@ function testFieldFormSingle() { 'name' => $this->randomName(), "{$field_name}[$langcode][0][value]" => $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)), 'Entity was created'); @@ -151,7 +151,7 @@ function testFieldFormSingle() { 'name' => $this->randomName(), "{$field_name}[$langcode][0][value]" => $value, ); - $this->drupalPost(NULL, $edit, t('Save')); + $this->drupalPostForm(NULL, $edit, t('Save')); $this->assertText(t('entity_test @id has been updated.', array('@id' => $id)), 'Entity was updated'); $this->container->get('entity.manager')->getStorageController('entity_test')->resetCache(array($id)); $entity = entity_load('entity_test', $id); @@ -164,7 +164,7 @@ function testFieldFormSingle() { 'name' => $this->randomName(), "{$field_name}[$langcode][0][value]" => $value ); - $this->drupalPost('entity_test/manage/' . $id . '/edit', $edit, t('Save')); + $this->drupalPostForm('entity_test/manage/' . $id . '/edit', $edit, t('Save')); $this->assertText(t('entity_test @id has been updated.', array('@id' => $id)), 'Entity was updated'); $this->container->get('entity.manager')->getStorageController('entity_test')->resetCache(array($id)); $entity = entity_load('entity_test', $id); @@ -198,7 +198,7 @@ function testFieldFormDefaultValue() { 'name' => $this->randomName(), "{$field_name}[$langcode][0][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)), 'Entity was created.'); @@ -220,7 +220,7 @@ function testFieldFormSingleRequired() { // Submit with missing required value. $edit = array(); - $this->drupalPost('entity_test/add', $edit, t('Save')); + $this->drupalPostForm('entity_test/add', $edit, t('Save')); $this->assertRaw(t('!name field is required.', array('!name' => $this->instance['label'])), 'Required field with no value fails validation'); // Create an entity @@ -230,7 +230,7 @@ function testFieldFormSingleRequired() { 'name' => $this->randomName(), "{$field_name}[$langcode][0][value]" => $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)), 'Entity was created'); @@ -244,7 +244,7 @@ function testFieldFormSingleRequired() { 'name' => $this->randomName(), "{$field_name}[$langcode][0][value]" => $value, ); - $this->drupalPost('entity_test/manage/' . $id . '/edit', $edit, t('Save')); + $this->drupalPostForm('entity_test/manage/' . $id . '/edit', $edit, t('Save')); $this->assertRaw(t('!name field is required.', array('!name' => $this->instance['label'])), 'Required field with no value fails validation'); } @@ -273,14 +273,14 @@ function testFieldFormUnlimited() { $this->assertNoField("{$field_name}[$langcode][1][value]", 'No extraneous widget is displayed'); // Press 'add more' button -> 2 widgets. - $this->drupalPost(NULL, array(), t('Add another item')); + $this->drupalPostForm(NULL, array(), t('Add another item')); $this->assertFieldByName("{$field_name}[$langcode][0][value]", '', 'Widget 1 is displayed'); $this->assertFieldByName("{$field_name}[$langcode][1][value]", '', 'New widget is displayed'); $this->assertNoField("{$field_name}[$langcode][2][value]", 'No extraneous widget is displayed'); // TODO : check that non-field inpurs are preserved ('title')... // Yet another time so that we can play with more values -> 3 widgets. - $this->drupalPost(NULL, array(), t('Add another item')); + $this->drupalPostForm(NULL, array(), t('Add another item')); // Prepare values and weights. $count = 3; @@ -308,7 +308,7 @@ function testFieldFormUnlimited() { } // Press 'add more' button -> 4 widgets - $this->drupalPost(NULL, $edit, t('Add another item')); + $this->drupalPostForm(NULL, $edit, t('Add another item')); for ($delta = 0; $delta <= $delta_range; $delta++) { $this->assertFieldByName("{$field_name}[$langcode][$delta][value]", $values[$delta], "Widget $delta is displayed and has the right value"); $this->assertFieldByName("{$field_name}[$langcode][$delta][_weight]", $weights[$delta], "Widget $delta has the right weight"); @@ -321,7 +321,7 @@ function testFieldFormUnlimited() { $this->assertNoField("{$field_name}[$langcode][" . ($delta + 1) . '][value]', 'No extraneous widget is displayed'); // Submit the form and create the entity. - $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)), 'Entity was created'); @@ -380,7 +380,7 @@ function testFieldFormMultivalueWithRequiredRadio() { $this->drupalGet('entity_test/add'); // Press the 'Add more' button. - $this->drupalPost(NULL, array(), t('Add another item')); + $this->drupalPostForm(NULL, array(), t('Add another item')); // Verify that no error is thrown by the radio element. $this->assertNoFieldByXpath('//div[contains(@class, "error")]', FALSE, 'No error message is displayed.'); @@ -406,10 +406,10 @@ function testFieldFormJSAddMore() { $this->drupalGet('entity_test/add'); // Press 'add more' button a couple times -> 3 widgets. - // drupalPostAJAX() will not work iteratively, so we add those through + // drupalPostAjaxForm() will not work iteratively, so we add those through // non-JS submission. - $this->drupalPost(NULL, array(), t('Add another item')); - $this->drupalPost(NULL, array(), t('Add another item')); + $this->drupalPostForm(NULL, array(), t('Add another item')); + $this->drupalPostForm(NULL, array(), t('Add another item')); // Prepare values and weights. $count = 3; @@ -433,7 +433,7 @@ function testFieldFormJSAddMore() { } // Press 'add more' button through Ajax, and place the expected HTML result // as the tested content. - $commands = $this->drupalPostAJAX(NULL, $edit, $field_name . '_add_more'); + $commands = $this->drupalPostAjaxForm(NULL, $edit, $field_name . '_add_more'); $this->content = $commands[1]['data']; for ($delta = 0; $delta <= $delta_range; $delta++) { @@ -476,7 +476,7 @@ function testFieldFormMultipleWidget() { 'name' => $this->randomName(), "{$field_name}[$langcode]" => '1, 2, 3', ); - $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]; @@ -490,7 +490,7 @@ function testFieldFormMultipleWidget() { // Submit the form with more values than the field accepts. $edit = array("{$field_name}[$langcode]" => '1, 2, 3, 4, 5'); - $this->drupalPost(NULL, $edit, t('Save')); + $this->drupalPostForm(NULL, $edit, t('Save')); $this->assertRaw('this field cannot hold more than 4 values', 'Form validation failed.'); // Check that the field values were not submitted. $this->assertFieldValues($entity_init, $field_name, $langcode, array(1, 2, 3)); @@ -558,7 +558,7 @@ function testFieldFormAccess() { 'name' => $this->randomName(), "{$field_name}[$langcode][0][value]" => 1, ); - $this->drupalPost(NULL, $edit, t('Save')); + $this->drupalPostForm(NULL, $edit, t('Save')); preg_match("|$entity_type/manage/(\d+)/edit|", $this->url, $match); $id = $match[1]; @@ -574,7 +574,7 @@ function testFieldFormAccess() { "{$field_name}[$langcode][0][value]" => 2, 'revision' => TRUE, ); - $this->drupalPost($entity_type . '/manage/' . $id . '/edit', $edit, t('Save')); + $this->drupalPostForm($entity_type . '/manage/' . $id . '/edit', $edit, t('Save')); // Check that the new revision has the expected values. $this->container->get('entity.manager')->getStorageController($entity_type)->resetCache(array($id)); @@ -616,7 +616,7 @@ function testFieldFormHiddenWidget() { // Create an entity and test that the default value is assigned correctly to // the field that uses the hidden widget. $this->assertNoField("{$field_name}[$langcode][0][value]", 'The hidden widget is not displayed'); - $this->drupalPost(NULL, array('user_id' => 1, 'name' => $this->randomName()), t('Save')); + $this->drupalPostForm(NULL, array('user_id' => 1, 'name' => $this->randomName()), t('Save')); preg_match('|' . $entity_type . '/manage/(\d+)/edit|', $this->url, $match); $id = $match[1]; $this->assertText(t('entity_test_rev @id has been created.', array('@id' => $id)), 'Entity was created'); @@ -640,7 +640,7 @@ function testFieldFormHiddenWidget() { // Update the entity. $value = mt_rand(1, 127); $edit = array("{$field_name}[$langcode][0][value]" => $value); - $this->drupalPost(NULL, $edit, t('Save')); + $this->drupalPostForm(NULL, $edit, t('Save')); $this->assertText(t('entity_test_rev @id has been updated.', array('@id' => $id)), 'Entity was updated'); entity_get_controller($entity_type)->resetCache(array($id)); $entity = entity_load($entity_type, $id); @@ -655,7 +655,7 @@ function testFieldFormHiddenWidget() { // Create a new revision. $edit = array('revision' => TRUE); - $this->drupalPost($entity_type . '/manage/' . $id . '/edit', $edit, t('Save')); + $this->drupalPostForm($entity_type . '/manage/' . $id . '/edit', $edit, t('Save')); // Check that the expected value has been carried over to the new revision. entity_get_controller($entity_type)->resetCache(array($id)); diff --git a/core/modules/field/lib/Drupal/field/Tests/NestedFormTest.php b/core/modules/field/lib/Drupal/field/Tests/NestedFormTest.php index e812ff5..0a8b0f0 100644 --- a/core/modules/field/lib/Drupal/field/Tests/NestedFormTest.php +++ b/core/modules/field/lib/Drupal/field/Tests/NestedFormTest.php @@ -107,7 +107,7 @@ function testNestedFieldForm() { 'entity_2[field_unlimited][und][0][value]' => 12, 'entity_2[field_unlimited][und][1][value]' => 13, ); - $this->drupalPost(NULL, $edit, t('Save')); + $this->drupalPostForm(NULL, $edit, t('Save')); field_cache_clear(); $entity_1 = entity_load($entity_type, 1); $entity_2 = entity_load($entity_type, 2); @@ -121,14 +121,14 @@ function testNestedFieldForm() { $edit = array( 'field_unlimited[und][1][value]' => -1, ); - $this->drupalPost('test-entity/nested/1/2', $edit, t('Save')); + $this->drupalPostForm('test-entity/nested/1/2', $edit, t('Save')); $this->assertRaw(t('%label does not accept the value -1', array('%label' => 'Unlimited field')), 'Entity 1: the field validation error was reported.'); $error_field = $this->xpath('//input[@id=:id and contains(@class, "error")]', array(':id' => 'edit-field-unlimited-und-1-value')); $this->assertTrue($error_field, 'Entity 1: the error was flagged on the correct element.'); $edit = array( 'entity_2[field_unlimited][und][1][value]' => -1, ); - $this->drupalPost('test-entity/nested/1/2', $edit, t('Save')); + $this->drupalPostForm('test-entity/nested/1/2', $edit, t('Save')); $this->assertRaw(t('%label does not accept the value -1', array('%label' => 'Unlimited field')), 'Entity 2: the field validation error was reported.'); $error_field = $this->xpath('//input[@id=:id and contains(@class, "error")]', array(':id' => 'edit-entity-2-field-unlimited-und-1-value')); $this->assertTrue($error_field, 'Entity 2: the error was flagged on the correct element.'); @@ -140,17 +140,17 @@ function testNestedFieldForm() { 'entity_2[field_unlimited][und][0][_weight]' => 0, 'entity_2[field_unlimited][und][1][_weight]' => -1, ); - $this->drupalPost('test-entity/nested/1/2', $edit, t('Save')); + $this->drupalPostForm('test-entity/nested/1/2', $edit, t('Save')); field_cache_clear(); $this->assertFieldValues($entity_1, 'field_unlimited', Language::LANGCODE_NOT_SPECIFIED, array(3, 2)); $this->assertFieldValues($entity_2, 'field_unlimited', Language::LANGCODE_NOT_SPECIFIED, array(13, 12)); // Test the 'add more' buttons. Only Ajax submission is tested, because // the two 'add more' buttons present in the form have the same #value, - // which confuses drupalPost(). + // which confuses drupalPostForm(). // 'Add more' button in the first entity: $this->drupalGet('test-entity/nested/1/2'); - $this->drupalPostAJAX(NULL, array(), 'field_unlimited_add_more'); + $this->drupalPostAjaxForm(NULL, array(), 'field_unlimited_add_more'); $this->assertFieldByName('field_unlimited[und][0][value]', 3, 'Entity 1: field_unlimited value 0 appears correctly is the form.'); $this->assertFieldByName('field_unlimited[und][1][value]', 2, 'Entity 1: field_unlimited value 1 appears correctly is the form.'); $this->assertFieldByName('field_unlimited[und][2][value]', '', 'Entity 1: field_unlimited value 2 appears correctly is the form.'); @@ -161,13 +161,13 @@ function testNestedFieldForm() { 'entity_2[field_unlimited][und][1][value]' => 14, 'entity_2[field_unlimited][und][2][value]' => 15, ); - $this->drupalPostAJAX(NULL, $edit, 'entity_2_field_unlimited_add_more'); + $this->drupalPostAjaxForm(NULL, $edit, 'entity_2_field_unlimited_add_more'); $this->assertFieldByName('entity_2[field_unlimited][und][0][value]', 13, 'Entity 2: field_unlimited value 0 appears correctly is the form.'); $this->assertFieldByName('entity_2[field_unlimited][und][1][value]', 14, 'Entity 2: field_unlimited value 1 appears correctly is the form.'); $this->assertFieldByName('entity_2[field_unlimited][und][2][value]', 15, 'Entity 2: field_unlimited value 2 appears correctly is the form.'); $this->assertFieldByName('entity_2[field_unlimited][und][3][value]', '', 'Entity 2: an empty widget was added for field_unlimited value 3.'); // Save the form and check values are saved correctly. - $this->drupalPost(NULL, array(), t('Save')); + $this->drupalPostForm(NULL, array(), t('Save')); field_cache_clear(); $this->assertFieldValues($entity_1, 'field_unlimited', Language::LANGCODE_NOT_SPECIFIED, array(3, 2)); $this->assertFieldValues($entity_2, 'field_unlimited', Language::LANGCODE_NOT_SPECIFIED, array(13, 14, 15)); diff --git a/core/modules/field/lib/Drupal/field/Tests/TranslationWebTest.php b/core/modules/field/lib/Drupal/field/Tests/TranslationWebTest.php index d4b95da..5eee2ba 100644 --- a/core/modules/field/lib/Drupal/field/Tests/TranslationWebTest.php +++ b/core/modules/field/lib/Drupal/field/Tests/TranslationWebTest.php @@ -123,7 +123,7 @@ function testFieldFormTranslationRevisions() { "{$field_name}[$langcode][0][value]" => $entity->{$field_name}->value, 'revision' => TRUE, ); - $this->drupalPost($this->entity_type . '/manage/' . $entity->id() . '/edit', $edit, t('Save')); + $this->drupalPostForm($this->entity_type . '/manage/' . $entity->id() . '/edit', $edit, t('Save')); // Check translation revisions. $this->checkTranslationRevisions($entity->id(), $entity->getRevisionId(), $available_langcodes); diff --git a/core/modules/field/lib/Drupal/field/Tests/Views/FieldUITest.php b/core/modules/field/lib/Drupal/field/Tests/Views/FieldUITest.php index 5c9b253..f2b577a 100644 --- a/core/modules/field/lib/Drupal/field/Tests/Views/FieldUITest.php +++ b/core/modules/field/lib/Drupal/field/Tests/Views/FieldUITest.php @@ -58,18 +58,18 @@ public function testHandlerUI() { sort($options, SORT_STRING); $this->assertEqual($options, array('text_default', 'text_plain', 'text_trimmed'), 'The text formatters for a simple text field appear as expected.'); - $this->drupalPost(NULL, array('options[type]' => 'text_trimmed'), t('Apply')); + $this->drupalPostForm(NULL, array('options[type]' => 'text_trimmed'), t('Apply')); $this->drupalGet($url); $this->assertOptionSelected('edit-options-type', 'text_trimmed'); $random_number = rand(100, 400); - $this->drupalPost(NULL, array('options[settings][trim_length]' => $random_number), t('Apply')); + $this->drupalPostForm(NULL, array('options[settings][trim_length]' => $random_number), t('Apply')); $this->drupalGet($url); $this->assertFieldByName('options[settings][trim_length]', $random_number, 'The formatter setting got saved.'); // Save the view and test whether the settings are saved. - $this->drupalPost('admin/structure/views/view/test_view_fieldapi', array(), t('Save')); + $this->drupalPostForm('admin/structure/views/view/test_view_fieldapi', array(), t('Save')); $view = views_get_view('test_view_fieldapi'); $view->initHandlers(); $this->assertEqual($view->field['field_name_0']->options['type'], 'text_trimmed'); diff --git a/core/modules/field/lib/Drupal/field/Tests/reEnableModuleFieldTest.php b/core/modules/field/lib/Drupal/field/Tests/reEnableModuleFieldTest.php index 0b5400d..bef1c1d 100644 --- a/core/modules/field/lib/Drupal/field/Tests/reEnableModuleFieldTest.php +++ b/core/modules/field/lib/Drupal/field/Tests/reEnableModuleFieldTest.php @@ -88,7 +88,7 @@ function testReEnabledField() { "title" => $this->randomName(), "field_telephone[und][0][value]" => "123456789", ); - $this->drupalPost(NULL, $edit, t('Save')); + $this->drupalPostForm(NULL, $edit, t('Save')); $this->assertRaw(''); // Disable the telephone module and re-enable it. diff --git a/core/modules/field_ui/lib/Drupal/field_ui/Tests/FieldUiTestBase.php b/core/modules/field_ui/lib/Drupal/field_ui/Tests/FieldUiTestBase.php index 8d397f1..9116d09 100644 --- a/core/modules/field_ui/lib/Drupal/field_ui/Tests/FieldUiTestBase.php +++ b/core/modules/field_ui/lib/Drupal/field_ui/Tests/FieldUiTestBase.php @@ -54,13 +54,13 @@ function setUp() { * @param $bundle_path * Admin path of the bundle that the new field is to be attached to. * @param $initial_edit - * $edit parameter for drupalPost() on the first step ('Manage fields' + * $edit parameter for drupalPostForm() on the first step ('Manage fields' * screen). * @param $field_edit - * $edit parameter for drupalPost() on the second step ('Field settings' + * $edit parameter for drupalPostForm() on the second step ('Field settings' * form). * @param $instance_edit - * $edit parameter for drupalPost() on the third step ('Instance settings' + * $edit parameter for drupalPostForm() on the third step ('Instance settings' * form). */ function fieldUIAddNewField($bundle_path, $initial_edit, $field_edit = array(), $instance_edit = array()) { @@ -71,15 +71,15 @@ function fieldUIAddNewField($bundle_path, $initial_edit, $field_edit = array(), $label = $initial_edit['fields[_add_new_field][label]']; // First step : 'Add new field' on the 'Manage fields' page. - $this->drupalPost("$bundle_path/fields", $initial_edit, t('Save')); + $this->drupalPostForm("$bundle_path/fields", $initial_edit, t('Save')); $this->assertRaw(t('These settings apply to the %label field everywhere it is used.', array('%label' => $label)), 'Field settings page was displayed.'); // Second step : 'Field settings' form. - $this->drupalPost(NULL, $field_edit, t('Save field settings')); + $this->drupalPostForm(NULL, $field_edit, t('Save field settings')); $this->assertRaw(t('Updated field %label field settings.', array('%label' => $label)), 'Redirected to instance and widget settings page.'); // Third step : 'Instance settings' form. - $this->drupalPost(NULL, $instance_edit, t('Save settings')); + $this->drupalPostForm(NULL, $instance_edit, t('Save settings')); $this->assertRaw(t('Saved %label configuration.', array('%label' => $label)), 'Redirected to "Manage fields" page.'); // Check that the field appears in the overview form. @@ -92,20 +92,20 @@ function fieldUIAddNewField($bundle_path, $initial_edit, $field_edit = array(), * @param $bundle_path * Admin path of the bundle that the field is to be attached to. * @param $initial_edit - * $edit parameter for drupalPost() on the first step ('Manage fields' + * $edit parameter for drupalPostForm() on the first step ('Manage fields' * screen). * @param $instance_edit - * $edit parameter for drupalPost() on the second step ('Instance settings' + * $edit parameter for drupalPostForm() on the second step ('Instance settings' * form). */ function fieldUIAddExistingField($bundle_path, $initial_edit, $instance_edit = array()) { $label = $initial_edit['fields[_add_existing_field][label]']; // First step : 'Re-use existing field' on the 'Manage fields' page. - $this->drupalPost("$bundle_path/fields", $initial_edit, t('Save')); + $this->drupalPostForm("$bundle_path/fields", $initial_edit, t('Save')); // Second step : 'Instance settings' form. - $this->drupalPost(NULL, $instance_edit, t('Save settings')); + $this->drupalPostForm(NULL, $instance_edit, t('Save settings')); $this->assertRaw(t('Saved %label configuration.', array('%label' => $label)), 'Redirected to "Manage fields" page.'); // Check that the field appears in the overview form. @@ -130,7 +130,7 @@ function fieldUIDeleteField($bundle_path, $field_name, $label, $bundle_label) { $this->assertRaw(t('Are you sure you want to delete the field %label', array('%label' => $label)), 'Delete confirmation was found.'); // Submit confirmation form. - $this->drupalPost(NULL, array(), t('Delete')); + $this->drupalPostForm(NULL, array(), t('Delete')); $this->assertRaw(t('The field %label has been deleted from the %type content type.', array('%label' => $label, '%type' => $bundle_label)), 'Delete message was found.'); // Check that the field does not appear in the overview form. diff --git a/core/modules/field_ui/lib/Drupal/field_ui/Tests/ManageDisplayTest.php b/core/modules/field_ui/lib/Drupal/field_ui/Tests/ManageDisplayTest.php index d1edd6d..da18637 100644 --- a/core/modules/field_ui/lib/Drupal/field_ui/Tests/ManageDisplayTest.php +++ b/core/modules/field_ui/lib/Drupal/field_ui/Tests/ManageDisplayTest.php @@ -59,7 +59,7 @@ function testFormatterUI() { // Change the formatter and check that the summary is updated. $edit = array('fields[field_test][type]' => 'field_test_multiple', 'refresh_rows' => 'field_test'); - $this->drupalPostAJAX(NULL, $edit, array('op' => t('Refresh'))); + $this->drupalPostAjaxForm(NULL, $edit, array('op' => t('Refresh'))); $format = 'field_test_multiple'; $default_settings = \Drupal::service('plugin.manager.field.formatter')->getDefaultSettings($format); $setting_name = key($default_settings); @@ -68,7 +68,7 @@ function testFormatterUI() { $this->assertText("$setting_name: $setting_value", 'The expected summary is displayed.'); // Submit the form and check that the display is updated. - $this->drupalPost(NULL, array(), t('Save')); + $this->drupalPostForm(NULL, array(), t('Save')); $display = entity_get_display('node', $this->type, 'default'); $display_options = $display->getComponent('field_test'); $current_format = $display_options['type']; @@ -81,17 +81,17 @@ function testFormatterUI() { // Click on the formatter settings button to open the formatter settings // form. - $this->drupalPostAJAX(NULL, array(), "field_test_settings_edit"); + $this->drupalPostAjaxForm(NULL, array(), "field_test_settings_edit"); // Assert that the field added in // field_test_field_formatter_settings_form_alter() is present. $fieldname = 'fields[field_test][settings_edit_form][settings][field_test_formatter_settings_form_alter]'; $this->assertField($fieldname, 'The field added in hook_field_formatter_settings_form_alter() is present on the settings form.'); $edit = array($fieldname => 'foo'); - $this->drupalPostAJAX(NULL, $edit, "field_test_plugin_settings_update"); + $this->drupalPostAjaxForm(NULL, $edit, "field_test_plugin_settings_update"); // Confirm that the settings are updated on the settings form. - $this->drupalPostAJAX(NULL, array(), "field_test_settings_edit"); + $this->drupalPostAjaxForm(NULL, array(), "field_test_settings_edit"); $this->assertFieldByName($fieldname, 'foo'); } @@ -125,7 +125,7 @@ public function testWidgetUI() { // Change the widget and check that the summary is updated. $edit = array('fields[field_test][type]' => 'test_field_widget_multiple', 'refresh_rows' => 'field_test'); - $this->drupalPostAJAX(NULL, $edit, array('op' => t('Refresh'))); + $this->drupalPostAjaxForm(NULL, $edit, array('op' => t('Refresh'))); $widget_type = 'test_field_widget_multiple'; $default_settings = \Drupal::service('plugin.manager.field.widget')->getDefaultSettings($widget_type); $setting_name = key($default_settings); @@ -134,7 +134,7 @@ public function testWidgetUI() { $this->assertText("$setting_name: $setting_value", 'The expected summary is displayed.'); // Submit the form and check that the display is updated. - $this->drupalPost(NULL, array(), t('Save')); + $this->drupalPostForm(NULL, array(), t('Save')); $display = entity_get_form_display('node', $this->type, 'default'); $display_options = $display->getComponent('field_test'); $current_widget = $display_options['type']; @@ -146,17 +146,17 @@ public function testWidgetUI() { $this->assertText('field_test_field_widget_settings_summary_alter'); // Click on the widget settings button to open the widget settings form. - $this->drupalPostAJAX(NULL, array(), "field_test_settings_edit"); + $this->drupalPostAjaxForm(NULL, array(), "field_test_settings_edit"); // Assert that the field added in // field_test_field_widget_settings_form_alter() is present. $fieldname = 'fields[field_test][settings_edit_form][settings][field_test_widget_settings_form_alter]'; $this->assertField($fieldname, 'The field added in hook_field_widget_settings_form_alter() is present on the settings form.'); $edit = array($fieldname => 'foo'); - $this->drupalPostAJAX(NULL, $edit, "field_test_plugin_settings_update"); + $this->drupalPostAjaxForm(NULL, $edit, "field_test_plugin_settings_update"); // Confirm that the settings are updated on the settings form. - $this->drupalPostAJAX(NULL, array(), "field_test_settings_edit"); + $this->drupalPostAjaxForm(NULL, array(), "field_test_settings_edit"); $this->assertFieldByName($fieldname, 'foo'); } @@ -197,14 +197,14 @@ function testViewModeCustom() { $edit = array( 'fields[field_test][type]' => 'field_test_with_prepare_view', ); - $this->drupalPost('admin/structure/types/manage/' . $this->type . '/display', $edit, t('Save')); + $this->drupalPostForm('admin/structure/types/manage/' . $this->type . '/display', $edit, t('Save')); $this->assertNodeViewText($node, 'rss', $output['field_test_with_prepare_view'], "The field is displayed as expected in view modes that use 'default' settings."); // Specialize the 'rss' mode, check that the field is displayed the same. $edit = array( "display_modes_custom[rss]" => TRUE, ); - $this->drupalPost('admin/structure/types/manage/' . $this->type . '/display', $edit, t('Save')); + $this->drupalPostForm('admin/structure/types/manage/' . $this->type . '/display', $edit, t('Save')); $this->assertNodeViewText($node, 'rss', $output['field_test_with_prepare_view'], "The field is displayed as expected in newly specialized 'rss' mode."); // Set the field to 'hidden' in the view mode, check that the field is @@ -212,7 +212,7 @@ function testViewModeCustom() { $edit = array( 'fields[field_test][type]' => 'hidden', ); - $this->drupalPost('admin/structure/types/manage/' . $this->type . '/display/rss', $edit, t('Save')); + $this->drupalPostForm('admin/structure/types/manage/' . $this->type . '/display/rss', $edit, t('Save')); $this->assertNodeViewNoText($node, 'rss', $value, "The field is hidden in 'rss' mode."); // Set the view mode back to 'default', check that the field is displayed @@ -220,14 +220,14 @@ function testViewModeCustom() { $edit = array( "display_modes_custom[rss]" => FALSE, ); - $this->drupalPost('admin/structure/types/manage/' . $this->type . '/display', $edit, t('Save')); + $this->drupalPostForm('admin/structure/types/manage/' . $this->type . '/display', $edit, t('Save')); $this->assertNodeViewText($node, 'rss', $output['field_test_with_prepare_view'], "The field is displayed as expected when 'rss' mode is set back to 'default' settings."); // Specialize the view mode again. $edit = array( "display_modes_custom[rss]" => TRUE, ); - $this->drupalPost('admin/structure/types/manage/' . $this->type . '/display', $edit, t('Save')); + $this->drupalPostForm('admin/structure/types/manage/' . $this->type . '/display', $edit, t('Save')); // Check that the previous settings for the view mode have been kept. $this->assertNodeViewNoText($node, 'rss', $value, "The previous settings are kept when 'rss' mode is specialized again."); } @@ -261,7 +261,7 @@ function testSingleViewMode() { $this->assertNoText('Use custom display settings for the following view modes', 'Custom display settings fieldset found.'); // This may not trigger a notice when 'view_modes_custom' isn't available. - $this->drupalPost('admin/structure/taxonomy/manage/' . $this->vocabulary . '/display', array(), t('Save')); + $this->drupalPostForm('admin/structure/taxonomy/manage/' . $this->vocabulary . '/display', array(), t('Save')); } /** diff --git a/core/modules/field_ui/lib/Drupal/field_ui/Tests/ManageFieldsTest.php b/core/modules/field_ui/lib/Drupal/field_ui/Tests/ManageFieldsTest.php index 3e09d8f..447d4cf 100644 --- a/core/modules/field_ui/lib/Drupal/field_ui/Tests/ManageFieldsTest.php +++ b/core/modules/field_ui/lib/Drupal/field_ui/Tests/ManageFieldsTest.php @@ -132,14 +132,14 @@ function updateField() { $edit = array( 'field[settings][test_field_setting]' => $string, ); - $this->drupalPost(NULL, $edit, t('Save field settings')); + $this->drupalPostForm(NULL, $edit, t('Save field settings')); // Go to the field instance edit page. $this->drupalGet('admin/structure/types/manage/' . $this->type . '/fields/' . $instance_id); $edit = array( 'instance[settings][test_instance_setting]' => $string, ); - $this->drupalPost(NULL, $edit, t('Save settings')); + $this->drupalPostForm(NULL, $edit, t('Save settings')); // Assert the field settings are correct. $this->assertFieldSettings($this->type, $this->field_name, $string); @@ -183,7 +183,7 @@ function cardinalitySettings() { 'field[cardinality]' => 'number', 'field[cardinality_number]' => '', ); - $this->drupalPost($field_edit_path, $edit, t('Save field settings')); + $this->drupalPostForm($field_edit_path, $edit, t('Save field settings')); $this->assertText('Number of values is required.'); // Submit a custom number. @@ -191,7 +191,7 @@ function cardinalitySettings() { 'field[cardinality]' => 'number', 'field[cardinality_number]' => 6, ); - $this->drupalPost($field_edit_path, $edit, t('Save field settings')); + $this->drupalPostForm($field_edit_path, $edit, t('Save field settings')); $this->assertText('Updated field Body field settings.'); $this->drupalGet($field_edit_path); $this->assertFieldByXPath("//select[@name='field[cardinality]']", 'number'); @@ -201,7 +201,7 @@ function cardinalitySettings() { $edit = array( 'field[cardinality]' => FIELD_CARDINALITY_UNLIMITED, ); - $this->drupalPost($field_edit_path, $edit, t('Save field settings')); + $this->drupalPostForm($field_edit_path, $edit, t('Save field settings')); $this->assertText('Updated field Body field settings.'); $this->drupalGet($field_edit_path); $this->assertFieldByXPath("//select[@name='field[cardinality]']", FIELD_CARDINALITY_UNLIMITED); @@ -249,7 +249,7 @@ function testFieldPrefix() { 'fields[_add_new_field][label]' => $field_exceed_max_length_label, 'fields[_add_new_field][field_name]' => $field_exceed_max_length_input, ); - $this->drupalPost('admin/structure/types/manage/' . $this->type . '/fields', $edit, t('Save')); + $this->drupalPostForm('admin/structure/types/manage/' . $this->type . '/fields', $edit, t('Save')); $this->assertText('New field name cannot be longer than 22 characters but is currently 23 characters long.'); // Create a valid field. @@ -293,12 +293,12 @@ function testDefaultValue() { // Check that invalid default values are rejected. $edit = array($element_name => '-1'); - $this->drupalPost($admin_path, $edit, t('Save settings')); + $this->drupalPostForm($admin_path, $edit, t('Save settings')); $this->assertText("$field_name does not accept the value -1", 'Form vaildation failed.'); // Check that the default value is saved. $edit = array($element_name => '1'); - $this->drupalPost($admin_path, $edit, t('Save settings')); + $this->drupalPostForm($admin_path, $edit, t('Save settings')); $this->assertText("Saved $field_name configuration", 'The form was successfully submitted.'); field_info_cache_clear(); $instance = field_info_instance('node', $field_name, $this->type); @@ -310,7 +310,7 @@ function testDefaultValue() { // Check that the default value can be emptied. $edit = array($element_name => ''); - $this->drupalPost(NULL, $edit, t('Save settings')); + $this->drupalPostForm(NULL, $edit, t('Save settings')); $this->assertText("Saved $field_name configuration", 'The form was successfully submitted.'); field_info_cache_clear(); $instance = field_info_instance('node', $field_name, $this->type); @@ -454,7 +454,7 @@ function testRenameBundle() { $options = array( 'type' => $type2, ); - $this->drupalPost('admin/structure/types/manage/' . $this->type, $options, t('Save content type')); + $this->drupalPostForm('admin/structure/types/manage/' . $this->type, $options, t('Save content type')); $this->manageFieldsPage($type2); } @@ -470,7 +470,7 @@ function testDuplicateFieldName() { 'fields[_add_new_field][type]' => 'taxonomy_term_reference', ); $url = 'admin/structure/types/manage/' . $this->type . '/fields'; - $this->drupalPost($url, $edit, t('Save')); + $this->drupalPostForm($url, $edit, t('Save')); $this->assertText(t('The machine-readable name is already in use. It must be unique.')); $this->assertUrl($url, array(), 'Stayed on the same page.'); @@ -522,12 +522,12 @@ function testHelpDescriptions() { $edit = array( 'instance[description]' => 'Test with an upload field.', ); - $this->drupalPost('admin/structure/types/manage/article/fields/node.article.field_image', $edit, t('Save settings')); + $this->drupalPostForm('admin/structure/types/manage/article/fields/node.article.field_image', $edit, t('Save settings')); $edit = array( 'instance[description]' => 'Test with a non upload field.', ); - $this->drupalPost('admin/structure/types/manage/article/fields/node.article.field_tags', $edit, t('Save settings')); + $this->drupalPostForm('admin/structure/types/manage/article/fields/node.article.field_tags', $edit, t('Save settings')); $this->drupalGet('node/add/article'); $this->assertRaw('Test with an upload field.'); diff --git a/core/modules/file/lib/Drupal/file/Tests/FileFieldDisplayTest.php b/core/modules/file/lib/Drupal/file/Tests/FileFieldDisplayTest.php index 11d8322..0773c59 100644 --- a/core/modules/file/lib/Drupal/file/Tests/FileFieldDisplayTest.php +++ b/core/modules/file/lib/Drupal/file/Tests/FileFieldDisplayTest.php @@ -48,7 +48,7 @@ function testNodeDisplay() { $edit = array( "fields[$field_name][type]" => $formatter, ); - $this->drupalPost("admin/structure/types/manage/$type_name/display", $edit, t('Save')); + $this->drupalPostForm("admin/structure/types/manage/$type_name/display", $edit, t('Save')); $this->drupalGet('node/' . $node->id()); $this->assertNoText($field_name, format_string('Field label is hidden when no file attached for formatter %formatter', array('%formatter' => $formatter))); } @@ -70,7 +70,7 @@ function testNodeDisplay() { // Turn the "display" option off and check that the file is no longer displayed. $edit = array($field_name . '[' . Language::LANGCODE_NOT_SPECIFIED . '][0][display]' => FALSE); - $this->drupalPost('node/' . $nid . '/edit', $edit, t('Save and keep published')); + $this->drupalPostForm('node/' . $nid . '/edit', $edit, t('Save and keep published')); $this->assertNoRaw($default_output, 'Field is hidden when "display" option is unchecked.'); @@ -80,7 +80,7 @@ function testNodeDisplay() { $field_name . '[' . Language::LANGCODE_NOT_SPECIFIED . '][0][description]' => $description, $field_name . '[' . Language::LANGCODE_NOT_SPECIFIED . '][0][display]' => TRUE, ); - $this->drupalPost('node/' . $nid . '/edit', $edit, t('Save and keep published')); + $this->drupalPostForm('node/' . $nid . '/edit', $edit, t('Save and keep published')); $this->assertText($description); } } diff --git a/core/modules/file/lib/Drupal/file/Tests/FileFieldRSSContentTest.php b/core/modules/file/lib/Drupal/file/Tests/FileFieldRSSContentTest.php index 4a94de2..ba46dc6 100644 --- a/core/modules/file/lib/Drupal/file/Tests/FileFieldRSSContentTest.php +++ b/core/modules/file/lib/Drupal/file/Tests/FileFieldRSSContentTest.php @@ -50,12 +50,12 @@ function testFileFieldRSSContent() { $edit = array( "display_modes_custom[rss]" => '1', ); - $this->drupalPost(NULL, $edit, t('Save')); + $this->drupalPostForm(NULL, $edit, t('Save')); // Change the format to 'RSS enclosure'. $this->drupalGet("admin/structure/types/manage/$type_name/display/rss"); $edit = array("fields[$field_name][type]" => 'file_rss_enclosure'); - $this->drupalPost(NULL, $edit, t('Save')); + $this->drupalPostForm(NULL, $edit, t('Save')); // Create a new node with a file field set. Promote to frontpage // needs to be set so this node will appear in the RSS feed. diff --git a/core/modules/file/lib/Drupal/file/Tests/FileFieldRevisionTest.php b/core/modules/file/lib/Drupal/file/Tests/FileFieldRevisionTest.php index 987fead..d54e596 100644 --- a/core/modules/file/lib/Drupal/file/Tests/FileFieldRevisionTest.php +++ b/core/modules/file/lib/Drupal/file/Tests/FileFieldRevisionTest.php @@ -71,7 +71,7 @@ function testRevisions() { // Save a new version of the node without any changes. // Check that the file is still the same as the previous revision. - $this->drupalPost('node/' . $nid . '/edit', array('revision' => '1'), t('Save and keep published')); + $this->drupalPostForm('node/' . $nid . '/edit', array('revision' => '1'), t('Save and keep published')); $node = node_load($nid, TRUE); $node_file_r3 = file_load($node->{$field_name}->target_id); $node_vid_r3 = $node->getRevisionId(); @@ -79,7 +79,7 @@ function testRevisions() { $this->assertFileIsPermanent($node_file_r3, 'New revision file is permanent.'); // Revert to the first revision and check that the original file is active. - $this->drupalPost('node/' . $nid . '/revisions/' . $node_vid_r1 . '/revert', array(), t('Revert')); + $this->drupalPostForm('node/' . $nid . '/revisions/' . $node_vid_r1 . '/revert', array(), t('Revert')); $node = node_load($nid, TRUE); $node_file_r4 = file_load($node->{$field_name}->target_id); $this->assertEqual($node_file_r1->id(), $node_file_r4->id(), 'Original revision file still in place after reverting to the original revision.'); @@ -87,7 +87,7 @@ function testRevisions() { // Delete the second revision and check that the file is kept (since it is // still being used by the third revision). - $this->drupalPost('node/' . $nid . '/revisions/' . $node_vid_r2 . '/delete', array(), t('Delete')); + $this->drupalPostForm('node/' . $nid . '/revisions/' . $node_vid_r2 . '/delete', array(), t('Delete')); $this->assertFileExists($node_file_r3, 'Second file is still available after deleting second revision, since it is being used by the third revision.'); $this->assertFileEntryExists($node_file_r3, 'Second file entry is still available after deleting second revision, since it is being used by the third revision.'); $this->assertFileIsPermanent($node_file_r3, 'Second file entry is still permanent after deleting second revision, since it is being used by the third revision.'); @@ -100,7 +100,7 @@ function testRevisions() { $this->drupalGet('user/' . $user->id() . '/edit'); // Delete the third revision and check that the file is not deleted yet. - $this->drupalPost('node/' . $nid . '/revisions/' . $node_vid_r3 . '/delete', array(), t('Delete')); + $this->drupalPostForm('node/' . $nid . '/revisions/' . $node_vid_r3 . '/delete', array(), t('Delete')); $this->assertFileExists($node_file_r3, 'Second file is still available after deleting third revision, since it is being used by the user.'); $this->assertFileEntryExists($node_file_r3, 'Second file entry is still available after deleting third revision, since it is being used by the user.'); $this->assertFileIsPermanent($node_file_r3, 'Second file entry is still permanent after deleting third revision, since it is being used by the user.'); @@ -129,7 +129,7 @@ function testRevisions() { $this->assertFileEntryNotExists($node_file_r3, 'Second file entry is now deleted after deleting third revision, since it is no longer being used by any other nodes.'); // Delete the entire node and check that the original file is deleted. - $this->drupalPost('node/' . $nid . '/delete', array(), t('Delete')); + $this->drupalPostForm('node/' . $nid . '/delete', array(), t('Delete')); // Call system_cron() to clean up the file. Make sure the timestamp // of the file is older than DRUPAL_MAXIMUM_TEMP_FILE_AGE. db_update('file_managed') diff --git a/core/modules/file/lib/Drupal/file/Tests/FileFieldTestBase.php b/core/modules/file/lib/Drupal/file/Tests/FileFieldTestBase.php index 866da45..b18ffdf 100644 --- a/core/modules/file/lib/Drupal/file/Tests/FileFieldTestBase.php +++ b/core/modules/file/lib/Drupal/file/Tests/FileFieldTestBase.php @@ -168,7 +168,7 @@ function uploadNodeFile($file, $field_name, $nid_or_type, $new_revision = TRUE, $name .= '[]'; } $edit[$name] = drupal_realpath($file->getFileUri()); - $this->drupalPost("node/$nid/edit", $edit, t('Save and keep published')); + $this->drupalPostForm("node/$nid/edit", $edit, t('Save and keep published')); return $nid; } @@ -183,8 +183,8 @@ function removeNodeFile($nid, $new_revision = TRUE) { 'revision' => (string) (int) $new_revision, ); - $this->drupalPost('node/' . $nid . '/edit', array(), t('Remove')); - $this->drupalPost(NULL, $edit, t('Save and keep published')); + $this->drupalPostForm('node/' . $nid . '/edit', array(), t('Remove')); + $this->drupalPostForm(NULL, $edit, t('Save and keep published')); } /** @@ -196,8 +196,8 @@ function replaceNodeFile($file, $field_name, $nid, $new_revision = TRUE) { 'revision' => (string) (int) $new_revision, ); - $this->drupalPost('node/' . $nid . '/edit', array(), t('Remove')); - $this->drupalPost(NULL, $edit, t('Save and keep published')); + $this->drupalPostForm('node/' . $nid . '/edit', array(), t('Remove')); + $this->drupalPostForm(NULL, $edit, t('Save and keep published')); } /** diff --git a/core/modules/file/lib/Drupal/file/Tests/FileFieldValidateTest.php b/core/modules/file/lib/Drupal/file/Tests/FileFieldValidateTest.php index ed9aca1..19a3e31 100644 --- a/core/modules/file/lib/Drupal/file/Tests/FileFieldValidateTest.php +++ b/core/modules/file/lib/Drupal/file/Tests/FileFieldValidateTest.php @@ -37,7 +37,7 @@ function testRequired() { // Try to post a new node without uploading a file. $edit = array("title" => $this->randomName()); - $this->drupalPost('node/add/' . $type_name, $edit, t('Save and publish')); + $this->drupalPostForm('node/add/' . $type_name, $edit, t('Save and publish')); $this->assertRaw(t('!title field is required.', array('!title' => $instance['label'])), 'Node save failed when required file field was empty.'); // Create a new node with the uploaded file. @@ -56,7 +56,7 @@ function testRequired() { // Try to post a new node without uploading a file in the multivalue field. $edit = array('title' => $this->randomName()); - $this->drupalPost('node/add/' . $type_name, $edit, t('Save and publish')); + $this->drupalPostForm('node/add/' . $type_name, $edit, t('Save and publish')); $this->assertRaw(t('!title field is required.', array('!title' => $instance['label'])), 'Node save failed when required multiple value file field was empty.'); // Create a new node with the uploaded file into the multivalue field. diff --git a/core/modules/file/lib/Drupal/file/Tests/FileFieldWidgetTest.php b/core/modules/file/lib/Drupal/file/Tests/FileFieldWidgetTest.php index 3c6aa76..297875c 100644 --- a/core/modules/file/lib/Drupal/file/Tests/FileFieldWidgetTest.php +++ b/core/modules/file/lib/Drupal/file/Tests/FileFieldWidgetTest.php @@ -42,7 +42,7 @@ function testSingleValuedWidget() { foreach (array('nojs', 'js') as $type) { // Create a new node with the uploaded file and ensure it got uploaded // successfully. - // @todo This only tests a 'nojs' submission, because drupalPostAJAX() + // @todo This only tests a 'nojs' submission, because drupalPostAjaxForm() // does not yet support file uploads. $nid = $this->uploadNodeFile($test_file, $field_name, $type_name); $node = node_load($nid, TRUE); @@ -61,11 +61,11 @@ function testSingleValuedWidget() { // "Click" the remove button (emulating either a nojs or js submission). switch ($type) { case 'nojs': - $this->drupalPost(NULL, array(), t('Remove')); + $this->drupalPostForm(NULL, array(), t('Remove')); break; case 'js': $button = $this->xpath('//input[@type="submit" and @value="' . t('Remove') . '"]'); - $this->drupalPostAJAX(NULL, array(), array((string) $button[0]['name'] => (string) $button[0]['value'])); + $this->drupalPostAjaxForm(NULL, array(), array((string) $button[0]['name'] => (string) $button[0]['value'])); break; } @@ -77,7 +77,7 @@ function testSingleValuedWidget() { $this->assertTrue(isset($label[0]), 'Label for upload found.'); // Save the node and ensure it does not have the file. - $this->drupalPost(NULL, array(), t('Save and keep published')); + $this->drupalPostForm(NULL, array(), t('Save and keep published')); $node = node_load($nid, TRUE); $this->assertTrue(empty($node->{$field_name}->target_id), 'File was successfully removed from the node.'); } @@ -89,7 +89,7 @@ function testSingleValuedWidget() { function testMultiValuedWidget() { $type_name = 'article'; // Use explicit names instead of random names for those fields, because of a - // bug in drupalPost() with multiple file uploads in one form, where the + // bug in drupalPostForm() with multiple file uploads in one form, where the // order of uploads depends on the order in which the upload elements are // added to the $form (which, in the current implementation of // FileStorage::listAll(), comes down to the alphabetical order on field @@ -107,16 +107,16 @@ function testMultiValuedWidget() { // until after the 3rd file, and after that, isn't displayed. Because // SimpleTest triggers the last button with a given name, so upload to the // second field first. - // @todo This is only testing a non-Ajax upload, because drupalPostAJAX() + // @todo This is only testing a non-Ajax upload, because drupalPostAjaxForm() // does not yet emulate jQuery's file upload. // $this->drupalGet("node/add/$type_name"); foreach (array($field_name2, $field_name) as $each_field_name) { for ($delta = 0; $delta < 3; $delta++) { $edit = array('files[' . $each_field_name . '_' . Language::LANGCODE_NOT_SPECIFIED . '_' . $delta . '][]' => drupal_realpath($test_file->getFileUri())); - // If the Upload button doesn't exist, drupalPost() will automatically + // If the Upload button doesn't exist, drupalPostForm() will automatically // fail with an assertion message. - $this->drupalPost(NULL, $edit, t('Upload')); + $this->drupalPostForm(NULL, $edit, t('Upload')); } } $this->assertNoFieldByXpath('//input[@type="submit"]', t('Upload'), 'After uploading 3 files for each field, the "Upload" button is no longer displayed.'); @@ -151,24 +151,24 @@ function testMultiValuedWidget() { $button_name = $current_field_name . '_' . Language::LANGCODE_NOT_SPECIFIED . '_' . $delta . '_remove_button'; switch ($type) { case 'nojs': - // drupalPost() takes a $submit parameter that is the value of the + // drupalPostForm() takes a $submit parameter that is the value of the // button whose click we want to emulate. Since we have multiple // buttons with the value "Remove", and want to control which one we // use, we change the value of the other ones to something else. // Since non-clicked buttons aren't included in the submitted POST - // data, and since drupalPost() will result in $this being updated + // data, and since drupalPostForm() will result in $this being updated // with a newly rebuilt form, this doesn't cause problems. foreach ($buttons as $button) { if ($button['name'] != $button_name) { $button['value'] = 'DUMMY'; } } - $this->drupalPost(NULL, array(), t('Remove')); + $this->drupalPostForm(NULL, array(), t('Remove')); break; case 'js': - // drupalPostAJAX() lets us target the button precisely, so we don't + // drupalPostAjaxForm() lets us target the button precisely, so we don't // require the workaround used above for nojs. - $this->drupalPostAJAX(NULL, array(), array($button_name => t('Remove'))); + $this->drupalPostAjaxForm(NULL, array(), array($button_name => t('Remove'))); break; } $num_expected_remove_buttons--; @@ -191,7 +191,7 @@ function testMultiValuedWidget() { $this->assertNoFieldByXPath('//input[@type="submit"]', t('Remove'), format_string('After removing all files, there is no "Remove" button displayed (JSMode=%type).', array('%type' => $type))); // Save the node and ensure it does not have any files. - $this->drupalPost(NULL, array('title' => $this->randomName()), t('Save and publish')); + $this->drupalPostForm(NULL, array('title' => $this->randomName()), t('Save and publish')); $matches = array(); preg_match('/node\/([0-9]+)/', $this->getUrl(), $matches); $nid = $matches[1]; @@ -213,7 +213,7 @@ function testPrivateFileSetting() { // Change the field setting to make its files private, and upload a file. $edit = array('field[settings][uri_scheme]' => 'private'); - $this->drupalPost("admin/structure/types/manage/$type_name/fields/$instance->id/field", $edit, t('Save field settings')); + $this->drupalPostForm("admin/structure/types/manage/$type_name/fields/$instance->id/field", $edit, t('Save field settings')); $nid = $this->uploadNodeFile($test_file, $field_name, $type_name); $node = node_load($nid, TRUE); $node_file = file_load($node->{$field_name}->target_id); @@ -255,10 +255,10 @@ function testPrivateFileComment() { 'fields[_add_new_field][field_name]' => $name = strtolower($this->randomName()), 'fields[_add_new_field][type]' => 'file', ); - $this->drupalPost('admin/structure/types/manage/article/comment/fields', $edit, t('Save')); + $this->drupalPostForm('admin/structure/types/manage/article/comment/fields', $edit, t('Save')); $edit = array('field[settings][uri_scheme]' => 'private'); - $this->drupalPost(NULL, $edit, t('Save field settings')); - $this->drupalPost(NULL, array(), t('Save settings')); + $this->drupalPostForm(NULL, $edit, t('Save field settings')); + $this->drupalPostForm(NULL, array(), t('Save settings')); // Manually clear cache on the tester side. field_info_cache_clear(); @@ -267,7 +267,7 @@ function testPrivateFileComment() { $edit = array( 'title' => $this->randomName(), ); - $this->drupalPost('node/add/article', $edit, t('Save and publish')); + $this->drupalPostForm('node/add/article', $edit, t('Save and publish')); $node = $this->drupalGetNodeByTitle($edit['title']); // Add a comment with a file. @@ -276,7 +276,7 @@ function testPrivateFileComment() { 'files[field_' . $name . '_' . Language::LANGCODE_NOT_SPECIFIED . '_' . 0 . ']' => drupal_realpath($text_file->getFileUri()), 'comment_body[' . Language::LANGCODE_NOT_SPECIFIED . '][0][value]' => $comment_body = $this->randomName(), ); - $this->drupalPost(NULL, $edit, t('Save')); + $this->drupalPostForm(NULL, $edit, t('Save')); // Get the comment ID. preg_match('/comment-([0-9]+)/', $this->getUrl(), $matches); @@ -301,7 +301,7 @@ function testPrivateFileComment() { // Unpublishes node. $this->drupalLogin($this->admin_user); - $this->drupalPost('node/' . $node->id() . '/edit', array(), t('Save and unpublish')); + $this->drupalPostForm('node/' . $node->id() . '/edit', array(), t('Save and unpublish')); // Ensures normal user can no longer download the file. $this->drupalLogin($user); @@ -331,11 +331,11 @@ function testWidgetValidation() { $edit[$name] = drupal_realpath($test_file_image->getFileUri()); switch ($type) { case 'nojs': - $this->drupalPost(NULL, $edit, t('Upload')); + $this->drupalPostForm(NULL, $edit, t('Upload')); break; case 'js': $button = $this->xpath('//input[@type="submit" and @value="' . t('Upload') . '"]'); - $this->drupalPostAJAX(NULL, $edit, array((string) $button[0]['name'] => (string) $button[0]['value'])); + $this->drupalPostAjaxForm(NULL, $edit, array((string) $button[0]['name'] => (string) $button[0]['value'])); break; } $error_message = t('Only files with the following extensions are allowed: %files-allowed.', array('%files-allowed' => 'txt')); @@ -345,11 +345,11 @@ function testWidgetValidation() { $edit[$name] = drupal_realpath($test_file_text->getFileUri()); switch ($type) { case 'nojs': - $this->drupalPost(NULL, $edit, t('Upload')); + $this->drupalPostForm(NULL, $edit, t('Upload')); break; case 'js': $button = $this->xpath('//input[@type="submit" and @value="' . t('Upload') . '"]'); - $this->drupalPostAJAX(NULL, $edit, array((string) $button[0]['name'] => (string) $button[0]['value'])); + $this->drupalPostAjaxForm(NULL, $edit, array((string) $button[0]['name'] => (string) $button[0]['value'])); break; } $this->assertNoRaw($error_message, t('Validation error removed when file with correct extension uploaded (JSMode=%type).', array('%type' => $type))); diff --git a/core/modules/file/lib/Drupal/file/Tests/FileListingTest.php b/core/modules/file/lib/Drupal/file/Tests/FileListingTest.php index 8321cf1..12177f2 100644 --- a/core/modules/file/lib/Drupal/file/Tests/FileListingTest.php +++ b/core/modules/file/lib/Drupal/file/Tests/FileListingTest.php @@ -81,7 +81,7 @@ function testFileListingPages() { $edit = array( 'files[file_' . Language::LANGCODE_NOT_SPECIFIED . '_' . 0 . ']' => drupal_realpath($file->getFileUri()), ); - $this->drupalPost(NULL, $edit, t('Save')); + $this->drupalPostForm(NULL, $edit, t('Save')); $node = entity_load('node', $node->id()); } diff --git a/core/modules/file/lib/Drupal/file/Tests/FileManagedFileElementTest.php b/core/modules/file/lib/Drupal/file/Tests/FileManagedFileElementTest.php index bf57606..94b34ee 100644 --- a/core/modules/file/lib/Drupal/file/Tests/FileManagedFileElementTest.php +++ b/core/modules/file/lib/Drupal/file/Tests/FileManagedFileElementTest.php @@ -41,19 +41,19 @@ function testManagedFile() { $file_field_name = $multiple ? 'files[' . $input_base_name . '][]' : 'files[' . $input_base_name . ']'; // Submit without a file. - $this->drupalPost($path, array(), t('Save')); + $this->drupalPostForm($path, array(), t('Save')); $this->assertRaw(t('The file ids are %fids.', array('%fids' => implode(',', array()))), 'Submitted without a file.'); // Submit a new file, without using the Upload button. $last_fid_prior = $this->getLastFileId(); $edit = array($file_field_name => drupal_realpath($test_file->getFileUri())); - $this->drupalPost($path, $edit, t('Save')); + $this->drupalPostForm($path, $edit, t('Save')); $last_fid = $this->getLastFileId(); $this->assertTrue($last_fid > $last_fid_prior, 'New file got saved.'); $this->assertRaw(t('The file ids are %fids.', array('%fids' => implode(',', array($last_fid)))), 'Submit handler has correct file info.'); // Submit no new input, but with a default file. - $this->drupalPost($path . '/' . $last_fid, array(), t('Save')); + $this->drupalPostForm($path . '/' . $last_fid, array(), t('Save')); $this->assertRaw(t('The file ids are %fids.', array('%fids' => implode(',', array($last_fid)))), 'Empty submission did not change an existing file.'); // Now, test the Upload and Remove buttons, with and without Ajax. @@ -63,14 +63,14 @@ function testManagedFile() { $this->drupalGet($path); $edit = array($file_field_name => drupal_realpath($test_file->getFileUri())); if ($ajax) { - $this->drupalPostAJAX(NULL, $edit, $input_base_name . '_upload_button'); + $this->drupalPostAjaxForm(NULL, $edit, $input_base_name . '_upload_button'); } else { - $this->drupalPost(NULL, $edit, t('Upload')); + $this->drupalPostForm(NULL, $edit, t('Upload')); } $last_fid = $this->getLastFileId(); $this->assertTrue($last_fid > $last_fid_prior, 'New file got uploaded.'); - $this->drupalPost(NULL, array(), t('Save')); + $this->drupalPostForm(NULL, array(), t('Save')); $this->assertRaw(t('The file ids are %fids.', array('%fids' => implode(',', array($last_fid)))), 'Submit handler has correct file info.'); // Remove, then Submit. @@ -82,22 +82,22 @@ function testManagedFile() { } $this->drupalGet($path . '/' . $last_fid); if ($ajax) { - $this->drupalPostAJAX(NULL, $remove_edit, $input_base_name . '_remove_button'); + $this->drupalPostAjaxForm(NULL, $remove_edit, $input_base_name . '_remove_button'); } else { - $this->drupalPost(NULL, $remove_edit, $remove_button_title); + $this->drupalPostForm(NULL, $remove_edit, $remove_button_title); } - $this->drupalPost(NULL, array(), t('Save')); + $this->drupalPostForm(NULL, array(), t('Save')); $this->assertRaw(t('The file ids are %fids.', array('%fids' => '')), 'Submission after file removal was successful.'); // Upload, then Remove, then Submit. $this->drupalGet($path); $edit = array($file_field_name => drupal_realpath($test_file->getFileUri())); if ($ajax) { - $this->drupalPostAJAX(NULL, $edit, $input_base_name . '_upload_button'); + $this->drupalPostAjaxForm(NULL, $edit, $input_base_name . '_upload_button'); } else { - $this->drupalPost(NULL, $edit, t('Upload')); + $this->drupalPostForm(NULL, $edit, t('Upload')); } $remove_edit = array(); if ($multiple) { @@ -105,13 +105,13 @@ function testManagedFile() { $remove_edit = array($selected_checkbox => '1'); } if ($ajax) { - $this->drupalPostAJAX(NULL, $remove_edit, $input_base_name . '_remove_button'); + $this->drupalPostAjaxForm(NULL, $remove_edit, $input_base_name . '_remove_button'); } else { - $this->drupalPost(NULL, $remove_edit, $remove_button_title); + $this->drupalPostForm(NULL, $remove_edit, $remove_button_title); } - $this->drupalPost(NULL, array(), t('Save')); + $this->drupalPostForm(NULL, array(), t('Save')); $this->assertRaw(t('The file ids are %fids.', array('%fids' => '')), 'Submission after file upload and removal was successful.'); } } @@ -126,24 +126,24 @@ function testManagedFile() { $this->drupalGet($path); // Add a single file to the upload field. - $this->drupalPost(NULL, $edit, t('Upload')); + $this->drupalPostForm(NULL, $edit, t('Upload')); $fid_list[] = $this->getLastFileId(); $this->assertFieldByXpath('//input[@name="nested[file][file_' . $fid_list[0] . '][selected]"]', NULL, 'First file successfully uploaded to multiple file element.'); // Add another file to the same upload field. - $this->drupalPost(NULL, $edit, t('Upload')); + $this->drupalPostForm(NULL, $edit, t('Upload')); $fid_list[] = $this->getLastFileId(); $this->assertFieldByXpath('//input[@name="nested[file][file_' . $fid_list[1] . '][selected]"]', NULL, 'Second file successfully uploaded to multiple file element.'); // Save the entire form. - $this->drupalPost(NULL, array(), t('Save')); + $this->drupalPostForm(NULL, array(), t('Save')); $this->assertRaw(t('The file ids are %fids.', array('%fids' => implode(',', $fid_list))), 'Two files saved into a single multiple file element.'); // Delete only the first file. $edit = array( 'nested[file][file_' . $fid_list[0] . '][selected]' => '1', ); - $this->drupalPost($path . '/' . implode(',', $fid_list), $edit, t('Remove selected')); + $this->drupalPostForm($path . '/' . implode(',', $fid_list), $edit, t('Remove selected')); // Check that the first file has been deleted but not the second. $this->assertNoFieldByXpath('//input[@name="nested[file][file_' . $fid_list[0] . '][selected]"]', NULL, 'An individual file can be deleted from a multiple file element.'); diff --git a/core/modules/file/lib/Drupal/file/Tests/SaveUploadTest.php b/core/modules/file/lib/Drupal/file/Tests/SaveUploadTest.php index f600ea4..15e007b 100644 --- a/core/modules/file/lib/Drupal/file/Tests/SaveUploadTest.php +++ b/core/modules/file/lib/Drupal/file/Tests/SaveUploadTest.php @@ -55,7 +55,7 @@ function setUp() { 'file_test_replace' => FILE_EXISTS_REPLACE, 'files[file_test_upload]' => drupal_realpath($this->image->getFileUri()), ); - $this->drupalPost('file-test/upload', $edit, t('Submit')); + $this->drupalPostForm('file-test/upload', $edit, t('Submit')); $this->assertResponse(200, 'Received a 200 response for posted test file.'); $this->assertRaw(t('You WIN!'), 'Found the success message.'); @@ -82,7 +82,7 @@ function testNormal() { // Upload a second file. $image2 = current($this->drupalGetTestFiles('image')); $edit = array('files[file_test_upload]' => drupal_realpath($image2->uri)); - $this->drupalPost('file-test/upload', $edit, t('Submit')); + $this->drupalPostForm('file-test/upload', $edit, t('Submit')); $this->assertResponse(200, 'Received a 200 response for posted test file.'); $this->assertRaw(t('You WIN!')); $max_fid_after = db_query('SELECT MAX(fid) AS fid FROM {file_managed}')->fetchField(); @@ -108,7 +108,7 @@ function testNormal() { 'files[file_test_upload]' => $image3_realpath, 'file_subdir' => $dir, ); - $this->drupalPost('file-test/upload', $edit, t('Submit')); + $this->drupalPostForm('file-test/upload', $edit, t('Submit')); $this->assertResponse(200, 'Received a 200 response for posted test file.'); $this->assertRaw(t('You WIN!')); $this->assertTrue(is_file('temporary://' . $dir . '/' . trim(drupal_basename($image3_realpath)))); @@ -129,7 +129,7 @@ function testHandleExtension() { 'extensions' => $extensions, ); - $this->drupalPost('file-test/upload', $edit, t('Submit')); + $this->drupalPostForm('file-test/upload', $edit, t('Submit')); $this->assertResponse(200, 'Received a 200 response for posted test file.'); $message = t('Only files with the following extensions are allowed:') . ' ' . $extensions . ''; $this->assertRaw($message, 'Cannot upload a disallowed extension'); @@ -149,7 +149,7 @@ function testHandleExtension() { 'extensions' => $extensions, ); - $this->drupalPost('file-test/upload', $edit, t('Submit')); + $this->drupalPostForm('file-test/upload', $edit, t('Submit')); $this->assertResponse(200, 'Received a 200 response for posted test file.'); $this->assertNoRaw(t('Only files with the following extensions are allowed:'), 'Can upload an allowed extension.'); $this->assertRaw(t('You WIN!'), 'Found the success message.'); @@ -166,7 +166,7 @@ function testHandleExtension() { 'files[file_test_upload]' => drupal_realpath($this->image->getFileUri()), 'allow_all_extensions' => TRUE, ); - $this->drupalPost('file-test/upload', $edit, t('Submit')); + $this->drupalPostForm('file-test/upload', $edit, t('Submit')); $this->assertResponse(200, 'Received a 200 response for posted test file.'); $this->assertNoRaw(t('Only files with the following extensions are allowed:'), 'Can upload any extension.'); $this->assertRaw(t('You WIN!'), 'Found the success message.'); @@ -189,7 +189,7 @@ function testHandleDangerousFile() { 'extensions' => 'php', ); - $this->drupalPost('file-test/upload', $edit, t('Submit')); + $this->drupalPostForm('file-test/upload', $edit, t('Submit')); $this->assertResponse(200, 'Received a 200 response for posted test file.'); $message = t('For security reasons, your upload has been renamed to') . ' ' . $this->phpfile->filename . '.txt' . ''; $this->assertRaw($message, 'Dangerous file was renamed.'); @@ -205,7 +205,7 @@ function testHandleDangerousFile() { // Reset the hook counters. file_test_reset(); - $this->drupalPost('file-test/upload', $edit, t('Submit')); + $this->drupalPostForm('file-test/upload', $edit, t('Submit')); $this->assertResponse(200, 'Received a 200 response for posted test file.'); $this->assertNoRaw(t('For security reasons, your upload has been renamed'), 'Found no security message.'); $this->assertRaw(t('File name is !filename', array('!filename' => $this->phpfile->filename)), 'Dangerous file was not renamed when insecure uploads is TRUE.'); @@ -239,7 +239,7 @@ function testHandleFileMunge() { $munged_filename = substr($munged_filename, 0, strrpos($munged_filename, '.')); $munged_filename .= '_.' . $this->image_extension; - $this->drupalPost('file-test/upload', $edit, t('Submit')); + $this->drupalPostForm('file-test/upload', $edit, t('Submit')); $this->assertResponse(200, 'Received a 200 response for posted test file.'); $this->assertRaw(t('For security reasons, your upload has been renamed'), 'Found security message.'); $this->assertRaw(t('File name is !filename', array('!filename' => $munged_filename)), 'File was successfully munged.'); @@ -257,7 +257,7 @@ function testHandleFileMunge() { 'allow_all_extensions' => TRUE, ); - $this->drupalPost('file-test/upload', $edit, t('Submit')); + $this->drupalPostForm('file-test/upload', $edit, t('Submit')); $this->assertResponse(200, 'Received a 200 response for posted test file.'); $this->assertNoRaw(t('For security reasons, your upload has been renamed'), 'Found no security message.'); $this->assertRaw(t('File name is !filename', array('!filename' => $this->image->getFilename())), 'File was not munged when allowing any extension.'); @@ -275,7 +275,7 @@ function testExistingRename() { 'file_test_replace' => FILE_EXISTS_RENAME, 'files[file_test_upload]' => drupal_realpath($this->image->getFileUri()) ); - $this->drupalPost('file-test/upload', $edit, t('Submit')); + $this->drupalPostForm('file-test/upload', $edit, t('Submit')); $this->assertResponse(200, 'Received a 200 response for posted test file.'); $this->assertRaw(t('You WIN!'), 'Found the success message.'); @@ -291,7 +291,7 @@ function testExistingReplace() { 'file_test_replace' => FILE_EXISTS_REPLACE, 'files[file_test_upload]' => drupal_realpath($this->image->getFileUri()) ); - $this->drupalPost('file-test/upload', $edit, t('Submit')); + $this->drupalPostForm('file-test/upload', $edit, t('Submit')); $this->assertResponse(200, 'Received a 200 response for posted test file.'); $this->assertRaw(t('You WIN!'), 'Found the success message.'); @@ -307,7 +307,7 @@ function testExistingError() { 'file_test_replace' => FILE_EXISTS_ERROR, 'files[file_test_upload]' => drupal_realpath($this->image->getFileUri()) ); - $this->drupalPost('file-test/upload', $edit, t('Submit')); + $this->drupalPostForm('file-test/upload', $edit, t('Submit')); $this->assertResponse(200, 'Received a 200 response for posted test file.'); $this->assertRaw(t('Epic upload FAIL!'), 'Found the failure message.'); @@ -319,7 +319,7 @@ function testExistingError() { * Test for no failures when not uploading a file. */ function testNoUpload() { - $this->drupalPost('file-test/upload', array(), t('Submit')); + $this->drupalPostForm('file-test/upload', array(), t('Submit')); $this->assertNoRaw(t('Epic upload FAIL!'), 'Failure message not found.'); } } diff --git a/core/modules/filter/lib/Drupal/filter/Tests/FilterAdminTest.php b/core/modules/filter/lib/Drupal/filter/Tests/FilterAdminTest.php index 0788fb5..54338b4 100644 --- a/core/modules/filter/lib/Drupal/filter/Tests/FilterAdminTest.php +++ b/core/modules/filter/lib/Drupal/filter/Tests/FilterAdminTest.php @@ -61,7 +61,7 @@ function testFormatAdmin() { 'format' => $format_id, 'name' => $name, ); - $this->drupalPost(NULL, $edit, t('Save configuration')); + $this->drupalPostForm(NULL, $edit, t('Save configuration')); // Verify default weight of the text format. $this->drupalGet('admin/config/content/formats'); @@ -71,7 +71,7 @@ function testFormatAdmin() { $edit = array( "formats[$format_id][weight]" => 5, ); - $this->drupalPost('admin/config/content/formats', $edit, t('Save changes')); + $this->drupalPostForm('admin/config/content/formats', $edit, t('Save changes')); $this->assertFieldByName("formats[$format_id][weight]", 5, 'Text format weight was saved.'); // Edit text format. @@ -87,7 +87,7 @@ function testFormatAdmin() { array('%href' => 'admin/config/content/formats/manage/' . $format_id) )); $this->drupalGet('admin/config/content/formats/manage/' . $format_id); - $this->drupalPost(NULL, array(), t('Save configuration')); + $this->drupalPostForm(NULL, array(), t('Save configuration')); // Verify that the custom weight of the text format has been retained. $this->drupalGet('admin/config/content/formats'); @@ -96,7 +96,7 @@ function testFormatAdmin() { // Disable text format. $this->assertLinkByHref('admin/config/content/formats/manage/' . $format_id . '/disable'); $this->drupalGet('admin/config/content/formats/manage/' . $format_id . '/disable'); - $this->drupalPost(NULL, array(), t('Disable')); + $this->drupalPostForm(NULL, array(), t('Disable')); // Verify that disabled text format no longer exists. $this->drupalGet('admin/config/content/formats/manage/' . $format_id); @@ -108,7 +108,7 @@ function testFormatAdmin() { 'format' => $format_id, 'name' => 'New format', ); - $this->drupalPost('admin/config/content/formats/add', $edit, t('Save configuration')); + $this->drupalPostForm('admin/config/content/formats/add', $edit, t('Save configuration')); $this->assertText('The machine-readable name is already in use. It must be unique.'); // Attempt to create a format of the same human readable name as the @@ -117,7 +117,7 @@ function testFormatAdmin() { 'format' => 'new_format', 'name' => $name, ); - $this->drupalPost('admin/config/content/formats/add', $edit, t('Save configuration')); + $this->drupalPostForm('admin/config/content/formats/add', $edit, t('Save configuration')); $this->assertRaw(t('Text format names must be unique. A format named %name already exists.', array( '%name' => $name, ))); @@ -150,7 +150,7 @@ function testFilterAdmin() { // Add an additional tag. $edit = array(); $edit['filters[filter_html][settings][allowed_html]'] = '