Page MenuHomePhorge

PrefsSave.php
No OneTemporary

Authored By
Unknown
Size
1 KB
Referenced Files
None
Subscribers
None

PrefsSave.php

<?php
/**
* Test class to test rcmail_action_settings_prefs_save
*
* @package Tests
*/
class Actions_Settings_PrefsSave extends ActionTestCase
{
/**
* Test run() method
*/
function test_run()
{
$action = new rcmail_action_settings_prefs_save;
$output = $this->initOutput(rcmail_action::MODE_HTTP, 'settings', 'save-prefs');
$this->assertInstanceOf('rcmail_action', $action);
$this->assertTrue($action->checks());
// TODO: Test all sections
$_POST['_section'] = 'general';
$action->run();
$this->assertSame('edit-prefs', rcmail::get_instance()->action);
$this->assertSame('successfullysaved', $output->getProperty('message'));
}
/**
* Test prefs_input() method
*/
function test_prefs_input()
{
$action = new rcmail_action_settings_prefs_save;
$_POST = ['_test' => 'test'];
rcmail::get_instance()->config->set('test', null);
$this->assertSame(null, $action->prefs_input('unset', '/test/'));
$this->assertSame('test', $action->prefs_input('test', '/^test/'));
$this->assertSame(null, $action->prefs_input('test', '/^a/'));
}
}

File Metadata

Mime Type
text/x-php
Expires
Fri, Apr 24, 1:42 PM (1 d, 12 h ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
18778047
Default Alt Text
PrefsSave.php (1 KB)

Event Timeline