Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
D
drupal
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Custom Issue Tracker
Custom Issue Tracker
Labels
Merge Requests
293
Merge Requests
293
Requirements
Requirements
List
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Analytics
Analytics
Code Review
Insights
Issue
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
project
drupal
Commits
aeed3993
Commit
aeed3993
authored
Oct 23, 2015
by
alexpott
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue
#2502867
by Peacog, trwad, jhodgdon: Document all drupal(Post|Get)(*) methods $path parameter
parent
d1cfbeac
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
16 deletions
+33
-16
core/modules/simpletest/src/WebTestBase.php
core/modules/simpletest/src/WebTestBase.php
+33
-16
No files found.
core/modules/simpletest/src/WebTestBase.php
View file @
aeed3993
...
...
@@ -1546,10 +1546,10 @@ protected function drupalGet($path, array $options = array(), array $headers = a
}
/**
* Retrieves a Drupal path or an absolute path and JSON decode the result.
* Retrieves a Drupal path or an absolute path and JSON decode
s
the result.
*
* @param string $path
*
Path
to request AJAX from.
* @param
\Drupal\Core\Url|
string $path
*
Drupal path or URL
to request AJAX from.
* @param array $options
* Array of URL options.
* @param array $headers
...
...
@@ -1557,7 +1557,6 @@ protected function drupalGet($path, array $options = array(), array $headers = a
*
* @return array
* Decoded json.
* Requests a Drupal path in JSON format, and JSON decodes the response.
*/
protected
function
drupalGetJSON
(
$path
,
array
$options
=
array
(),
array
$headers
=
array
())
{
return
Json
::
decode
(
$this
->
drupalGetWithFormat
(
$path
,
'json'
,
$options
,
$headers
));
...
...
@@ -1566,8 +1565,8 @@ protected function drupalGetJSON($path, array $options = array(), array $headers
/**
* Retrieves a Drupal path or an absolute path for a given format.
*
* @param string $path
*
Path to request AJAX
from.
* @param
\Drupal\Core\Url|
string $path
*
Drupal path or URL to request given format
from.
* @param string $format
* The wanted request format.
* @param array $options
...
...
@@ -1584,7 +1583,17 @@ protected function drupalGetWithFormat($path, $format, array $options = [], arra
}
/**
* Requests a Drupal path in drupal_ajax format and JSON-decodes the response.
* Requests a path or URL in drupal_ajax format and JSON-decodes the response.
*
* @param \Drupal\Core\Url|string $path
* Drupal path or URL to request from.
* @param array $options
* Array of URL options.
* @param array $headers
* Array of headers.
*
* @return array
* Decoded JSON.
*/
protected
function
drupalGetAjax
(
$path
,
array
$options
=
array
(),
array
$headers
=
array
())
{
if
(
!
isset
(
$options
[
'query'
][
MainContentViewSubscriber
::
WRAPPER_FORMAT
]))
{
...
...
@@ -1594,7 +1603,17 @@ protected function drupalGetAjax($path, array $options = array(), array $headers
}
/**
* Requests a Drupal path as if it is a XMLHttpRequest.
* Requests a Drupal path or an absolute path as if it is a XMLHttpRequest.
*
* @param \Drupal\Core\Url|string $path
* Drupal path or URL to request from.
* @param array $options
* Array of URL options.
* @param array $headers
* Array of headers.
*
* @return string
* The retrieved content.
*/
protected
function
drupalGetXHR
(
$path
,
array
$options
=
array
(),
array
$headers
=
array
())
{
$headers
[]
=
'X-Requested-With: XMLHttpRequest'
;
...
...
@@ -1606,7 +1625,7 @@ protected function drupalGetXHR($path, array $options = array(), array $headers
*
* It will be done as usual POST request with SimpleBrowser.
*
* @param $path
* @param
\Drupal\Core\Url|string
$path
* Location of the post form. Either a Drupal path or an absolute path or
* NULL to post to the current page. For multi-stage forms you can set the
* path to NULL and have it post to the last received page. Example:
...
...
@@ -1796,7 +1815,7 @@ protected function drupalPostForm($path, $edit, $submit, array $options = array(
* update $this->content via drupalProcessAjaxResponse(). It also returns
* the array of AJAX commands received.
*
* @param $path
* @param
\Drupal\Core\Url|string
$path
* Location of the form containing the Ajax enabled element to test. Can be
* either a Drupal path or an absolute path or NULL to use the current page.
* @param $edit
...
...
@@ -2057,9 +2076,8 @@ protected function drupalProcessAjaxResponse($content, array $ajax_response, arr
/**
* Perform a POST HTTP request.
*
* @param string $path
* Drupal path where the request should be POSTed to. Will be transformed
* into an absolute path automatically.
* @param string|\Drupal\Core\Url $path
* Drupal path or absolute path where the request should be POSTed.
* @param string $accept
* The value for the "Accept" header. Usually either 'application/json' or
* 'application/vnd.drupal-ajax'.
...
...
@@ -2092,9 +2110,8 @@ protected function drupalPost($path, $accept, array $post, $options = array()) {
/**
* Performs a POST HTTP request with a specific format.
*
* @param string $path
* Drupal path where the request should be POSTed to. Will be transformed
* into an absolute path automatically.
* @param string|\Drupal\Core\Url $path
* Drupal path or absolute path where the request should be POSTed.
* @param string $format
* The request format.
* @param array $post
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment