public function RequestParamConditionTest::provideSummary in Condition Query 8
Provides data for static::testSummary().
Return value
array Array of data for each test case.
File
- tests/
src/ Kernel/ RequestParamConditionTest.php, line 164
Class
- RequestParamConditionTest
- Tests that the Request Param Condition is working properly.
Namespace
Drupal\Tests\condition_query\KernelCode
public function provideSummary() : array {
return [
'One parameter with a value' => [
'config' => [
'request_param' => "test=yes",
],
'expected' => 'Return true on the following query parameters: test=yes',
],
'One parameter with a value, negated' => [
'config' => [
'request_param' => "test=yes",
'negate' => TRUE,
],
'expected' => 'Do not return true on the following query parameters: test=yes',
],
'Two parameters, each with a value' => [
'config' => [
'request_param' => "test=yes\r\nfoo=no",
],
'expected' => 'Return true on the following query parameters: test=yes, foo=no',
],
'Three parameters, one without a value' => [
'config' => [
'request_param' => "test=yes\r\nfoo=no\r\nempty",
],
'expected' => 'Return true on the following query parameters: test=yes, foo=no, empty',
],
'Three parameters, one without a value, negated' => [
'config' => [
'request_param' => "test=yes\r\nfoo=no\r\nempty",
'negate' => TRUE,
],
'expected' => 'Do not return true on the following query parameters: test=yes, foo=no, empty',
],
];
}