Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F10704223
ResponseDelete.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
ResponseDelete.php
View Options
<?php
/**
* Test class to test rcmail_action_settings_response_delete
*
* @package Tests
*/
class
Actions_Settings_ResponseDelete
extends
ActionTestCase
{
/**
* Test deleting a response
*/
function
test_delete_response
()
{
$action
=
new
rcmail_action_settings_response_delete
;
$output
=
$this
->
initOutput
(
rcmail_action
::
MODE_AJAX
,
'settings'
,
'delete-response'
);
$this
->
assertInstanceOf
(
'rcmail_action'
,
$action
);
$this
->
assertTrue
(
$action
->
checks
());
$responses
=
[
[
'name'
=>
'test'
,
'text'
=>
'****'
,
'format'
=>
'text'
,
'key'
=>
'1234'
,
]
];
$rcmail
=
rcmail
::
get_instance
();
$rcmail
->
user
->
save_prefs
([
'compose_responses'
=>
$responses
]);
$_POST
=
[
'_key'
=>
'1234'
];
$this
->
runAndAssert
(
$action
,
OutputJsonMock
::
E_EXIT
);
$result
=
$output
->
getOutput
();
$this
->
assertSame
([
'Content-Type: application/json; charset=UTF-8'
],
$output
->
headers
);
$this
->
assertSame
(
'delete-response'
,
$result
[
'action'
]);
$this
->
assertTrue
(
strpos
(
$result
[
'exec'
],
'this.display_message("Successfully deleted.","confirmation");'
)
!==
false
);
$this
->
assertTrue
(
strpos
(
$result
[
'exec'
],
'this.remove_response("1234")'
)
!==
false
);
$this
->
assertSame
([],
$rcmail
->
get_compose_responses
());
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Mon, Sep 7, 12:44 PM (17 h, 54 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1334081
Default Alt Text
ResponseDelete.php (1 KB)
Attached To
Mode
R3 roundcubemail
Attached
Detach File
Event Timeline
Log In to Comment