MediaWiki  1.30.0
MWHttpRequestTestCase Class Reference
Inheritance diagram for MWHttpRequestTestCase:
Collaboration diagram for MWHttpRequestTestCase:

Public Member Functions

 setUp ()
 
 tearDown ()
 
 testBasicAuthentication ()
 
 testgetFinalUrl ()
 
 testGetResponseHeaders ()
 
 testGetStatus ()
 
 testIsRedirect ()
 
 testSetCallback ()
 
 testSetCookie ()
 
 testSetCookieJar ()
 
 testSetData ()
 
 testSetHeader ()
 
 testSetUserAgent ()
 

Protected Member Functions

 assertHasCookie ( $expectedName, $expectedValue, CookieJar $cookieJar)
 Asserts that the cookie jar has the given cookie with the given value. More...
 
 assertNotHasCookie ( $name, CookieJar $cookieJar)
 Asserts that the cookie jar does not have the given cookie. More...
 
 assertResponseFieldValue ( $key, $expectedValue, MWHttpRequest $response)
 Verifies that the request was successful, returned valid JSON and the given field of that JSON data is as expected. More...
 

Protected Attributes

 $oldHttpEngine
 

Static Protected Attributes

static $httpEngine
 

Detailed Description

Definition at line 5 of file MWHttpRequestTestCase.php.

Member Function Documentation

◆ assertHasCookie()

MWHttpRequestTestCase::assertHasCookie (   $expectedName,
  $expectedValue,
CookieJar  $cookieJar 
)
protected

Asserts that the cookie jar has the given cookie with the given value.

Parameters
string$expectedNameCookie name
string$expectedValueCookie value
CookieJar$cookieJar

Definition at line 226 of file MWHttpRequestTestCase.php.

Referenced by testSetCookieJar().

◆ assertNotHasCookie()

MWHttpRequestTestCase::assertNotHasCookie (   $name,
CookieJar  $cookieJar 
)
protected

Asserts that the cookie jar does not have the given cookie.

Parameters
string$nameCookie name
CookieJar$cookieJar

Definition at line 240 of file MWHttpRequestTestCase.php.

References $name.

Referenced by testSetCookieJar().

◆ assertResponseFieldValue()

MWHttpRequestTestCase::assertResponseFieldValue (   $key,
  $expectedValue,
MWHttpRequest  $response 
)
protected

Verifies that the request was successful, returned valid JSON and the given field of that JSON data is as expected.

Parameters
string | string[]$keyPath to the data in the response object
mixed$expectedValue
MWHttpRequest$response

Definition at line 207 of file MWHttpRequestTestCase.php.

References $response, array(), as, and true.

Referenced by testBasicAuthentication(), testgetFinalUrl(), testSetCookie(), testSetCookieJar(), testSetData(), testSetHeader(), and testSetUserAgent().

◆ setUp()

MWHttpRequestTestCase::setUp ( )

Definition at line 9 of file MWHttpRequestTestCase.php.

References $e, Http\$httpEngine, $request, class, and MWHttpRequest\factory().

◆ tearDown()

MWHttpRequestTestCase::tearDown ( )

Definition at line 27 of file MWHttpRequestTestCase.php.

References Http\$httpEngine, and $oldHttpEngine.

◆ testBasicAuthentication()

MWHttpRequestTestCase::testBasicAuthentication ( )

◆ testgetFinalUrl()

MWHttpRequestTestCase::testgetFinalUrl ( )

◆ testGetResponseHeaders()

MWHttpRequestTestCase::testGetResponseHeaders ( )

Definition at line 121 of file MWHttpRequestTestCase.php.

References $request, and MWHttpRequest\factory().

◆ testGetStatus()

MWHttpRequestTestCase::testGetStatus ( )

Definition at line 138 of file MWHttpRequestTestCase.php.

References $request, and MWHttpRequest\factory().

◆ testIsRedirect()

MWHttpRequestTestCase::testIsRedirect ( )

Definition at line 34 of file MWHttpRequestTestCase.php.

References $request, and MWHttpRequest\factory().

◆ testSetCallback()

MWHttpRequestTestCase::testSetCallback ( )

Definition at line 161 of file MWHttpRequestTestCase.php.

References $request, MWHttpRequest\factory(), and use.

◆ testSetCookie()

MWHttpRequestTestCase::testSetCookie ( )

◆ testSetCookieJar()

MWHttpRequestTestCase::testSetCookieJar ( )

◆ testSetData()

MWHttpRequestTestCase::testSetData ( )

◆ testSetHeader()

MWHttpRequestTestCase::testSetHeader ( )

◆ testSetUserAgent()

MWHttpRequestTestCase::testSetUserAgent ( )

Member Data Documentation

◆ $httpEngine

MWHttpRequestTestCase::$httpEngine
staticprotected

Definition at line 6 of file MWHttpRequestTestCase.php.

◆ $oldHttpEngine

MWHttpRequestTestCase::$oldHttpEngine
protected

Definition at line 7 of file MWHttpRequestTestCase.php.

Referenced by tearDown().


The documentation for this class was generated from the following file: