Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F117757893
Contacts.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
Contacts.php
View Options
<?php
/**
* Test class to test rcube_contacts class
*
* @package Tests
*/
class
Framework_Contacts
extends
PHPUnit\Framework\TestCase
{
/**
* Class constructor
*/
function
test_class
()
{
$object
=
new
rcube_contacts
(
null
,
null
);
$this
->
assertInstanceOf
(
'rcube_contacts'
,
$object
,
"Class constructor"
);
}
/**
* Test validate() method
*/
function
test_validate
()
{
$contacts
=
new
rcube_contacts
(
null
,
null
);
$data
=
[];
$this
->
assertSame
(
false
,
$contacts
->
validate
(
$data
));
$this
->
assertSame
([
'type'
=>
3
,
'message'
=>
'nonamewarning'
],
$contacts
->
get_error
());
$data
=
[
'name'
=>
'test'
];
$this
->
assertSame
(
true
,
$contacts
->
validate
(
$data
));
$data
=
[
'email'
=>
'@example.org'
];
$this
->
assertSame
(
false
,
$contacts
->
validate
(
$data
));
$this
->
assertSame
([
'type'
=>
3
,
'message'
=>
'Invalid email address: @example.org'
],
$contacts
->
get_error
());
$data
=
[
'email'
=>
'test@test.com'
];
$this
->
assertSame
(
true
,
$contacts
->
validate
(
$data
));
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Apr 4 2026, 9:29 AM (4 w, 2 d ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
ad/e6/40816639ff19a41c39dde5c62329
Default Alt Text
Contacts.php (1 KB)
Attached To
Mode
R113 roundcubemail
Attached
Detach File
Event Timeline