Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F2484964
Qrcode.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
Qrcode.php
View Options
<?php
/**
* Test class to test rcmail_action_contacts_qrcode
*
* @package Tests
*/
class
Actions_Contacts_Qrcode
extends
ActionTestCase
{
/**
* Test run() method
*/
function
test_run
()
{
$action
=
new
rcmail_action_contacts_qrcode
;
$output
=
$this
->
initOutput
(
rcmail_action
::
MODE_HTTP
,
'contacts'
,
'qrcode'
);
$this
->
assertInstanceOf
(
'rcmail_action'
,
$action
);
$this
->
assertTrue
(
$action
->
checks
());
$this
->
runAndAssert
(
$action
,
OutputJsonMock
::
E_EXIT
);
$result
=
$output
->
getOutput
();
$this
->
assertSame
([
'HTTP/1.0 404 Contact not found'
],
$output
->
headers
);
$this
->
assertSame
(
''
,
$result
);
if
(!
function_exists
(
'imagecreate'
))
{
$this
->
markTestSkipped
();
}
$db
=
rcmail
::
get_instance
()->
get_dbh
();
$query
=
$db
->
query
(
'SELECT `contact_id` FROM `contacts` WHERE `user_id` = 1 LIMIT 1'
);
$contact
=
$db
->
fetch_assoc
(
$query
);
$_GET
=
[
'_cid'
=>
$contact
[
'contact_id'
],
'_source'
=>
'0'
];
$this
->
runAndAssert
(
$action
,
OutputJsonMock
::
E_EXIT
);
$result
=
$output
->
getOutput
();
$this
->
assertSame
(
'Content-Type: image/png'
,
$output
->
headers
[
0
]);
$this
->
assertRegExp
(
'/^
\x
89
\x
50
\x
4E
\x
47/'
,
$result
);
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Thu, Nov 20, 5:01 PM (18 h, 19 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
387210
Default Alt Text
Qrcode.php (1 KB)
Attached To
Mode
R3 roundcubemail
Attached
Detach File
Event Timeline
Log In to Comment