From c3387818eefcad6755353fdc8376fe92b9cdcac1 Mon Sep 17 00:00:00 2001 From: John Bintz Date: Wed, 1 Jul 2009 08:17:31 -0400 Subject: [PATCH] small bug fixes --- classes/PluginWonderful.php | 1 + test/PluginWonderfulTest.php | 6 ++++++ test/ViewMainTest.php | 2 +- 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/classes/PluginWonderful.php b/classes/PluginWonderful.php index cda0910..d680acb 100644 --- a/classes/PluginWonderful.php +++ b/classes/PluginWonderful.php @@ -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; diff --git a/test/PluginWonderfulTest.php b/test/PluginWonderfulTest.php index f87a29d..9e505f8 100644 --- a/test/PluginWonderfulTest.php +++ b/test/PluginWonderfulTest.php @@ -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() { diff --git a/test/ViewMainTest.php b/test/ViewMainTest.php index a56e371..9bf9411 100644 --- a/test/ViewMainTest.php +++ b/test/ViewMainTest.php @@ -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'"