class DisqusAPITest in Drupal Most Popular 7
Hierarchy
- class \DisqusAPITest extends \PHPUnit_Framework_TestCase
Expanded class hierarchy of DisqusAPITest
File
- modules/
mostpopular_disqus/ disqusapi/ tests/ disqusapi.php, line 10
View source
class DisqusAPITest extends PHPUnit_Framework_TestCase {
private $secret = 'a';
function test_setKey() {
$api = new DisqusAPI('a');
$this
->assertEquals($api->key, 'a');
$api
->setKey('b');
$this
->assertEquals($api->key, 'b');
}
function test_setFormat() {
$api = new DisqusAPI();
$this
->assertEquals($api->format, 'json');
$api
->setFormat('jsonp');
$this
->assertEquals($api->format, 'jsonp');
}
function test_setVersion() {
$api = new DisqusAPI();
$this
->assertEquals($api->version, '3.0');
$api
->setVersion('3.1');
$this
->assertEquals($api->version, '3.1');
}
/**
* @expectedException DisqusInterfaceNotDefined
*/
function test_invalid_function() {
$api = new DisqusAPI();
$api->users
->foo(array(
'foo' => 'bar',
));
}
/**
* @expectedException DisqusAPIError
*/
function test_users_listActivity() {
$api = new DisqusAPI($this->secret);
$api->users
->listActivity(array(
'foo' => 'bar',
));
}
/**
* @expectedException Exception
*/
function test_posts_create_missing_message() {
$api = new DisqusAPI($this->secret);
$api->posts
->create(array(
'foo' => 'bar',
));
}
/**
* @expectedException DisqusAPIError
*/
function test_posts_create() {
$api = new DisqusAPI($this->secret);
$api->posts
->create(array(
'message' => 'bar',
));
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
DisqusAPITest:: |
private | property | ||
DisqusAPITest:: |
function | @expectedException DisqusInterfaceNotDefined | ||
DisqusAPITest:: |
function | @expectedException DisqusAPIError | ||
DisqusAPITest:: |
function | @expectedException Exception | ||
DisqusAPITest:: |
function | |||
DisqusAPITest:: |
function | |||
DisqusAPITest:: |
function | |||
DisqusAPITest:: |
function | @expectedException DisqusAPIError |