Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F120838782
Move.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
Move.php
View Options
<?php
/**
* Test class to test rcmail_action_contacts_move
*
* @package Tests
*/
class
Actions_Contacts_Move
extends
ActionTestCase
{
/**
* Test moving of a single contact
*/
function
test_move_contact
()
{
$action
=
new
rcmail_action_contacts_move
;
$output
=
$this
->
initOutput
(
rcmail_action
::
MODE_AJAX
,
'contacts'
,
'move'
);
$this
->
assertInstanceOf
(
'rcmail_action'
,
$action
);
$this
->
assertTrue
(
$action
->
checks
());
self
::
initDB
(
'contacts'
);
$db
=
rcmail
::
get_instance
()->
get_dbh
();
$query
=
$db
->
query
(
'SELECT * FROM `collected_addresses` WHERE `email` = ?'
,
'test@collected.eu'
);
$contact
=
$db
->
fetch_assoc
(
$query
);
$cid
=
$contact
[
'address_id'
];
$_POST
=
[
'_cid'
=>
$cid
,
'_to'
=>
'0'
,
'_source'
=>
rcube_addressbook
::
TYPE_RECIPIENT
];
$this
->
runAndAssert
(
$action
,
OutputJsonMock
::
E_EXIT
);
$result
=
$output
->
getOutput
();
$this
->
assertSame
([
'Content-Type: application/json; charset=UTF-8'
],
$output
->
headers
);
$this
->
assertSame
(
'move'
,
$result
[
'action'
]);
$this
->
assertSame
(
0
,
$result
[
'env'
][
'pagecount'
]);
$this
->
assertTrue
(
strpos
(
$result
[
'exec'
],
'this.display_message("Successfully moved 1 contacts.","confirmation",0);'
)
!==
false
);
$this
->
assertTrue
(
strpos
(
$result
[
'exec'
],
'this.set_rowcount("No contacts found.");'
)
!==
false
);
$query
=
$db
->
query
(
'SELECT * FROM `contacts` WHERE `email` = ?'
,
'test@collected.eu'
);
$result
=
$db
->
fetch_assoc
(
$query
);
$this
->
assertTrue
(!
empty
(
$result
));
$query
=
$db
->
query
(
'SELECT * FROM `collected_addresses` WHERE `email` = ?'
,
'test@collected.eu'
);
$result
=
$db
->
fetch_assoc
(
$query
);
$this
->
assertTrue
(
empty
(
$result
));
}
/**
* Test moving a contact to a group
*/
function
test_move_contact_to_group
()
{
// Test error handling, test moving to a group, test moving multiple contacts
$this
->
markTestIncomplete
();
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Fri, Apr 24, 2:03 PM (1 w, 8 h ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
02/22/1e0a411dedbbe8002a74b049b4e6
Default Alt Text
Move.php (1 KB)
Attached To
Mode
R113 roundcubemail
Attached
Detach File
Event Timeline