class RequestParametersTest in reCAPTCHA 6.2
Same name and namespace in other branches
- 7.2 recaptcha-php/tests/ReCaptcha/RequestParametersTest.php \ReCaptcha\RequestParametersTest
Hierarchy
- class \ReCaptcha\RequestParametersTest extends \ReCaptcha\PHPUnit_Framework_TestCase
Expanded class hierarchy of RequestParametersTest
File
- recaptcha-php/
tests/ ReCaptcha/ RequestParametersTest.php, line 29
Namespace
ReCaptchaView source
class RequestParametersTest extends \PHPUnit_Framework_TestCase {
public function provideValidData() {
return array(
array(
'SECRET',
'RESPONSE',
'REMOTEIP',
'VERSION',
array(
'secret' => 'SECRET',
'response' => 'RESPONSE',
'remoteip' => 'REMOTEIP',
'version' => 'VERSION',
),
'secret=SECRET&response=RESPONSE&remoteip=REMOTEIP&version=VERSION',
),
array(
'SECRET',
'RESPONSE',
null,
null,
array(
'secret' => 'SECRET',
'response' => 'RESPONSE',
),
'secret=SECRET&response=RESPONSE',
),
);
}
/**
* @dataProvider provideValidData
*/
public function testToArray($secret, $response, $remoteIp, $version, $expectedArray, $expectedQuery) {
$params = new RequestParameters($secret, $response, $remoteIp, $version);
$this
->assertEquals($params
->toArray(), $expectedArray);
}
/**
* @dataProvider provideValidData
*/
public function testToQueryString($secret, $response, $remoteIp, $version, $expectedArray, $expectedQuery) {
$params = new RequestParameters($secret, $response, $remoteIp, $version);
$this
->assertEquals($params
->toQueryString(), $expectedQuery);
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
RequestParametersTest:: |
public | function | ||
RequestParametersTest:: |
public | function | @dataProvider provideValidData | |
RequestParametersTest:: |
public | function | @dataProvider provideValidData |