Source for file Services_Trackback_SpamCheck_DNSBL_Test.php
Documentation is available at Services_Trackback_SpamCheck_DNSBL_Test.php
// Includepath for local CVS development
// set_include_path('/cvs/pear/Services_Trackback'.PATH_SEPARATOR.get_include_path());
// Services_Trackback classes
require_once 'Services/Trackback.php';
require_once 'Services/Trackback/SpamCheck.php';
require_once 'Services/Trackback/SpamCheck/DNSBL.php';
require_once 'PHPUnit.php';
require_once dirname (__FILE__ ). '/trackback_data.php';
class Webservices_Trackback_SpamCheck_DNSBL_TestCase extends PHPUnit_TestCase
var $trackbacks = array ();
// {{{ Webservices_Trackback_SpamCheck_DNSBL_TestCase()
// constructor of the test suite
function Webservices_Trackback_SpamCheck_DNSBL_TestCase ($name) {
$this->PHPUnit_TestCase ($name);
foreach ($trackbackData as $id => $set) {
$this->assertTrue ($this->spamCheck == $realCheck);
function test_check_failure_nospam () {
$this->assertTrue (!$this->spamCheck->check ($this->trackbacks['nospam']));
function test_check_failure_undetected () {
$this->assertTrue (!$this->spamCheck->check ($this->trackbacks['undetected']));
function test_check_success_all () {
$this->assertTrue ($this->spamCheck->check ($this->trackbacks['all']));
function test_check_success_host () {
$this->assertTrue ($this->spamCheck->check ($this->trackbacks['host']));
function test_check_failure_title () {
$this->assertTrue (!$this->spamCheck->check ($this->trackbacks['title']));
function test_check_faulire_excerpt () {
$this->assertTrue (!$this->spamCheck->check ($this->trackbacks['excerpt']));
function test_check_failure_url () {
$this->assertTrue (!$this->spamCheck->check ($this->trackbacks['url']));
function test_check_failure_blog_name () {
$this->assertTrue (!$this->spamCheck->check ($this->trackbacks['blog_name']));
function test_getResults () {
$this->spamCheck->check ($this->trackbacks['all']);
$results = $this->spamCheck->getResults ();
$this->assertTrue ($results[0 ]);
$this->spamCheck->check ($this->trackbacks['all']);
$this->spamCheck->reset ();
$fakeCheck->_dnsbl ->blacklists = array ('bl.spamcop.net');
$this->assertTrue ($this->spamCheck == $fakeCheck);
$suite = new PHPUnit_TestSuite ("Webservices_Trackback_SpamCheck_DNSBL_TestCase");
$result = PHPUnit ::run ($suite);
echo $result->toString ();
Documentation generated on Mon, 11 Mar 2019 14:36:59 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.
|