mirror of
https://github.com/roundcube/roundcubemail.git
synced 2026-03-14 03:56:48 +01:00
* align_single_space_minimal for assign * assign operators grouping is not supported by PHP CS Fixer * binary_operator_spaces = single_space * fix anonymous function on single line * align comments manually
39 lines
960 B
PHP
39 lines
960 B
PHP
<?php
|
|
|
|
/**
|
|
* Test class to test rcmail_action_utils_save_pref
|
|
*/
|
|
class Actions_Utils_SavePref extends ActionTestCase
|
|
{
|
|
/**
|
|
* Test for run()
|
|
*/
|
|
public function test_run()
|
|
{
|
|
$action = new rcmail_action_utils_save_pref();
|
|
$output = $this->initOutput(rcmail_action::MODE_AJAX, 'utils', 'save_pref');
|
|
|
|
$this->assertInstanceOf('rcmail_action', $action);
|
|
$this->assertTrue($action->checks());
|
|
|
|
$rcmail = rcmail::get_instance();
|
|
$rcmail->user->save_prefs(['list_cols' => []]);
|
|
|
|
$_POST = [
|
|
'_name' => 'list_cols',
|
|
'_value' => ['date'],
|
|
];
|
|
|
|
$this->runAndAssert($action, OutputHtmlMock::E_EXIT);
|
|
|
|
$result = $output->getOutput();
|
|
|
|
$user = new rcube_user($rcmail->user->ID);
|
|
$prefs = $user->get_prefs();
|
|
|
|
$this->assertSame(['date'], $prefs['list_cols']);
|
|
|
|
// TODO: Test writing to session, test whitelist
|
|
}
|
|
}
|