mirror of
https://github.com/roundcube/roundcubemail.git
synced 2026-03-25 09:16:56 +01:00
* Fix "method_argument_space" * Fix "control_structure_continuation_position" * Fix "new_with_parentheses" * Fix "blank_line_before_statement" * Fix "visibility_required" * Fix some "array_indentation" * Fix some "array_indentation" - unify all "rcube::raise_error" calls * rm useless eslint ignores and add rules counts * sort eslint ignores * fix eslint ignores grammar * Revert "Fix "blank_line_before_statement"" * fix CS 3.46.0
39 lines
961 B
PHP
39 lines
961 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
|
|
}
|
|
}
|