protected function WebTestBase::drupalPostWithFormat in Zircon Profile 8.0
Same name and namespace in other branches
- 8 core/modules/simpletest/src/WebTestBase.php \Drupal\simpletest\WebTestBase::drupalPostWithFormat()
Performs a POST HTTP request with a specific format.
Parameters
string|\Drupal\Core\Url $path: Drupal path or absolute path where the request should be POSTed.
string $format: The request format.
array $post: The POST data. When making a 'application/vnd.drupal-ajax' request, the Ajax page state data should be included. Use getAjaxPageStatePostData() for that.
array $options: (optional) Options to be forwarded to the url generator. The 'absolute' option will automatically be enabled.
Return value
string The content returned from the call to curl_exec().
See also
WebTestBase::drupalPost
WebTestBase::getAjaxPageStatePostData()
9 calls to WebTestBase::drupalPostWithFormat()
- ConfigTranslationUiTest::renderContextualLinks in core/
modules/ config_translation/ src/ Tests/ ConfigTranslationUiTest.php - Get server-rendered contextual links for the given contextual link ids.
- ContextualDynamicContextTest::renderContextualLinks in core/
modules/ contextual/ src/ Tests/ ContextualDynamicContextTest.php - Get server-rendered contextual links for the given contextual link ids.
- DisplayBlockTest::testBlockContextualLinks in core/
modules/ block/ src/ Tests/ Views/ DisplayBlockTest.php - Tests the contextual links on a Views block.
- DisplayTest::testPageContextualLinks in core/
modules/ views_ui/ src/ Tests/ DisplayTest.php - Tests contextual links on Views page displays.
- EditorSecurityTest::testSwitchingSecurity in core/
modules/ editor/ src/ Tests/ EditorSecurityTest.php - Tests administrator security: is the user safe when switching text formats?
File
- core/
modules/ simpletest/ src/ WebTestBase.php, line 2132 - Contains \Drupal\simpletest\WebTestBase.
Class
- WebTestBase
- Test case for typical Drupal tests.
Namespace
Drupal\simpletestCode
protected function drupalPostWithFormat($path, $format, array $post, $options = []) {
$options['query']['_format'] = $format;
return $this
->drupalPost($path, '', $post, $options);
}