small bug fixes
This commit is contained in:
parent
35b9bf71e8
commit
c3387818ee
@ -263,6 +263,7 @@ class PluginWonderful {
|
|||||||
$this->publisher_info = $this->_get_new_publisher_info_object();
|
$this->publisher_info = $this->_get_new_publisher_info_object();
|
||||||
if ($this->publisher_info->parse($result)) {
|
if ($this->publisher_info->parse($result)) {
|
||||||
$this->adboxes_client->post_ads($this->publisher_info);
|
$this->adboxes_client->post_ads($this->publisher_info);
|
||||||
|
update_option('plugin-wonderful-last-update', time());
|
||||||
return $this->message_types['DOWNLOADED'];
|
return $this->message_types['DOWNLOADED'];
|
||||||
} else {
|
} else {
|
||||||
$this->publisher_info = false;
|
$this->publisher_info = false;
|
||||||
|
@ -349,6 +349,8 @@ class PluginWonderfulTest extends PHPUnit_Framework_TestCase {
|
|||||||
function testDownloadProjectWonderfulData($did_download_data, $did_parse_data, $expected_result) {
|
function testDownloadProjectWonderfulData($did_download_data, $did_parse_data, $expected_result) {
|
||||||
$pw = $this->getMock('PluginWonderful', array('_retrieve_url', '_get_new_publisher_info_object'));
|
$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));
|
$pw->expects($this->once())->method('_retrieve_url')->will($this->returnValue($did_download_data));
|
||||||
if ($did_download_data) {
|
if ($did_download_data) {
|
||||||
$publisher_info = $this->getMock('PublisherInfo');
|
$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'));
|
$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() {
|
function providerTestHandleActionRebuildDatabase() {
|
||||||
|
@ -52,7 +52,7 @@ class ViewMainTest extends PHPUnit_Framework_TestCase {
|
|||||||
|
|
||||||
function providerTestGetFirstAdboxID() {
|
function providerTestGetFirstAdboxID() {
|
||||||
return array(
|
return array(
|
||||||
array(false, null),
|
array(false, "12345"),
|
||||||
array(
|
array(
|
||||||
(object)array('template_tag_id' => 'meow'),
|
(object)array('template_tag_id' => 'meow'),
|
||||||
"'meow'"
|
"'meow'"
|
||||||
|
Loading…
Reference in New Issue
Block a user