| 1 |
<?php
|
| 2 |
// $Id: undisposable.test,v 1.1 2008/05/27 21:36:03 mustafau Exp $
|
| 3 |
|
| 4 |
/**
|
| 5 |
* @file
|
| 6 |
*/
|
| 7 |
|
| 8 |
/**
|
| 9 |
* UndisposableTestCase class.
|
| 10 |
*/
|
| 11 |
class UndisposableTestCase extends DrupalWebTestCase {
|
| 12 |
/**
|
| 13 |
* Implementation of getInfo().
|
| 14 |
*/
|
| 15 |
function getInfo() {
|
| 16 |
return array(
|
| 17 |
'name' => t('Disposable e-mail protection test case'),
|
| 18 |
'description' => t('Tests whether Disposable e-mail protection is working or not.'),
|
| 19 |
'group' => t('Disposable e-mail protection'),
|
| 20 |
);
|
| 21 |
}
|
| 22 |
|
| 23 |
function testUndisposable() {
|
| 24 |
// Valid e-mail address.
|
| 25 |
$respond = _undisposable('isDisposableEmail', 'drupal@drupal.org');
|
| 26 |
$this->assertFalse($respond['email']['isdisposable'], 'drupal@drupal.org is not a disposable e-mail address.');
|
| 27 |
|
| 28 |
// Disposable e-mail address.
|
| 29 |
$respond = _undisposable('isDisposableEmail', 'drupal@10minutemail.com');
|
| 30 |
$this->assertNotEqual($respond['stat'], 'ok', 'drupal@10minutemail.com is a disposable e-mail address.');
|
| 31 |
}
|
| 32 |
}
|