small bug fixes

This commit is contained in:
John Bintz 2009-07-01 08:17:31 -04:00
parent 35b9bf71e8
commit c3387818ee
3 changed files with 8 additions and 1 deletions

View File

@ -263,6 +263,7 @@ class PluginWonderful {
$this->publisher_info = $this->_get_new_publisher_info_object();
if ($this->publisher_info->parse($result)) {
$this->adboxes_client->post_ads($this->publisher_info);
update_option('plugin-wonderful-last-update', time());
return $this->message_types['DOWNLOADED'];
} else {
$this->publisher_info = false;

View File

@ -349,6 +349,8 @@ class PluginWonderfulTest extends PHPUnit_Framework_TestCase {
function testDownloadProjectWonderfulData($did_download_data, $did_parse_data, $expected_result) {
$pw = $this->getMock('PluginWonderful', array('_retrieve_url', '_get_new_publisher_info_object'));
update_option('plugin-wonderful-last-update', 0);
$pw->expects($this->once())->method('_retrieve_url')->will($this->returnValue($did_download_data));
if ($did_download_data) {
$publisher_info = $this->getMock('PublisherInfo');
@ -363,6 +365,10 @@ class PluginWonderfulTest extends PHPUnit_Framework_TestCase {
}
$this->assertEquals($expected_result, $pw->_download_project_wonderful_data('123'));
if ($did_parse_data) {
$this->assertNotEquals(0, get_option('plugin-wonderful-last-update'));
}
}
function providerTestHandleActionRebuildDatabase() {

View File

@ -52,7 +52,7 @@ class ViewMainTest extends PHPUnit_Framework_TestCase {
function providerTestGetFirstAdboxID() {
return array(
array(false, null),
array(false, "12345"),
array(
(object)array('template_tag_id' => 'meow'),
"'meow'"