Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F120835061
IdentitySave.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Authored By
Unknown
Size
1 KB
Referenced Files
None
Subscribers
None
IdentitySave.php
View Options
<?php
/**
* Test class to test rcmail_action_settings_identity_save
*
* @package Tests
*/
class
Actions_Settings_IdentitySave
extends
ActionTestCase
{
/**
* Test run() method
*/
function
test_identity_edit
()
{
$action
=
new
rcmail_action_settings_identity_save
;
$output
=
$this
->
initOutput
(
rcmail_action
::
MODE_HTTP
,
'settings'
,
'save-identity'
);
$this
->
assertInstanceOf
(
'rcmail_action'
,
$action
);
$this
->
assertTrue
(
$action
->
checks
());
self
::
initDB
(
'identities'
);
$db
=
rcmail
::
get_instance
()->
get_dbh
();
$query
=
$db
->
query
(
'SELECT * FROM `identities` WHERE `standard` = 1 LIMIT 1'
);
$identity
=
$db
->
fetch_assoc
(
$query
);
// Test successful identity update
$_POST
=
[
'_iid'
=>
$identity
[
'identity_id'
],
'_name'
=>
'new-name'
,
'_email'
=>
'new@example.com'
,
'_standard'
=>
'1'
,
'_signature'
=>
'test'
,
];
$action
->
run
();
$this
->
assertSame
(
'edit-identity'
,
rcmail
::
get_instance
()->
action
);
$this
->
assertSame
(
'successfullysaved'
,
$output
->
getProperty
(
'message'
));
$query
=
$db
->
query
(
'SELECT * FROM `identities` WHERE `identity_id` = ?'
,
$identity
[
'identity_id'
]);
$identity
=
$db
->
fetch_assoc
(
$query
);
$this
->
assertSame
(
'new-name'
,
$identity
[
'name'
]);
$this
->
assertSame
(
'new@example.com'
,
$identity
[
'email'
]);
$this
->
assertSame
(
'test'
,
$identity
[
'signature'
]);
$this
->
assertSame
(
1
,
(
int
)
$identity
[
'standard'
]);
}
/**
* Test run() method for a new identity
*/
function
test_new_identity
()
{
$this
->
markTestIncomplete
();
}
/**
* Test run() method errors handling
*/
function
test_run_errors
()
{
$this
->
markTestIncomplete
();
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Fri, Apr 24, 1:12 PM (6 d, 4 h ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
18840773
Default Alt Text
IdentitySave.php (1 KB)
Attached To
Mode
R113 roundcubemail
Attached
Detach File
Event Timeline