MDL-44273 block_rss: Prevent PHP notices in tests + whitespace fix
authorEloy Lafuente (stronk7) <stronk7@moodle.org>
Tue, 4 Aug 2015 22:55:28 +0000 (00:55 +0200)
committerEloy Lafuente (stronk7) <stronk7@moodle.org>
Tue, 4 Aug 2015 22:55:28 +0000 (00:55 +0200)
blocks/rss_client/db/upgrade.php
blocks/rss_client/tests/cron_test.php

index 26fa4b5..afc2b80 100644 (file)
@@ -16,7 +16,7 @@
 
 /**
  * Database upgrades for the RSS block.
- * 
+ *
  * @package   block_rss_client
  * @copyright 2014 Davo Smith
  * @author    Neill Magill <neill.magill@nottingham.ac.uk>
index d6958ac..9069c28 100644 (file)
@@ -57,7 +57,8 @@ class block_rss_client_cron_testcase extends advanced_testcase {
 
         $block = new block_rss_client();
         ob_start();
-        $block->cron();
+        // Silence SimplePie php notices.
+        @$block->cron();
         $cronoutput = ob_get_clean();
         $this->assertContains('skipping until ' . userdate($record->skipuntil), $cronoutput);
         $this->assertContains('0 feeds refreshed (took ', $cronoutput);
@@ -112,7 +113,8 @@ class block_rss_client_cron_testcase extends advanced_testcase {
         // Run the cron.
         $block = new block_rss_client();
         ob_start();
-        $block->cron();
+        // Silence SimplePie php notices.
+        @$block->cron();
         $cronoutput = ob_get_clean();
         $skiptime1 = $record->skiptime * 2;
         $message1 = 'http://example.com/rss Error: could not load/find the RSS feed - skipping for ' . $skiptime1 . ' seconds.';
@@ -136,4 +138,4 @@ class block_rss_client_cron_testcase extends advanced_testcase {
         $this->assertAttributeEquals($skiptime3, 'skiptime', $newrecord3);
         $this->assertAttributeGreaterThanOrEqual($time + $skiptime3, 'skipuntil', $newrecord3);
     }
-}
\ No newline at end of file
+}