return [ 'unauthorized_user_cannot_switch' =>
['user_cannot_switch_1', 'user_cannot_switch_1', 'user_cannot_switch_1', 403
],
'authorized_user_can_switch' =>
['user_can_switch', 'user_cannot_switch_1', 'user_cannot_switch_1', 200
],
'authorized_user_cannot_switch_to_non_existent' =>
['user_can_switch', 'user_does_not_exist', 'user_can_switch', 403
],
'authorized_user_can_switch_to_himself' =>
['user_can_switch', 'user_can_switch', 'user_can_switch', 200
],
];
} protected function createAuthenticatedClient($username, array
$options =
[]) { $client =
$this->
createClient(['test_case' => 'StandardFormLogin', 'root_config' => 'switchuser.yml'
] +
$options);
$client->
followRedirects(true
);
$form =
$client->
request('GET', '/login'
)->
selectButton('login'
)->
form();
$form['_username'
] =
$username;
$form['_password'
] = 'test';
$client->
submit($form);
return $client;
}}