diff --git a/backup/util/loggers/tests/logger_test.php b/backup/util/loggers/tests/logger_test.php index 70a65f9b8b3..f81d7a40dc8 100644 --- a/backup/util/loggers/tests/logger_test.php +++ b/backup/util/loggers/tests/logger_test.php @@ -95,7 +95,8 @@ class backup_logger_testcase extends basic_testcase { $lo3 = new mock_base_logger3(backup::LOG_ERROR); $lo1->set_next($lo2); $lo2->set_next($lo3); - $this->assertFalse($lo1->process('test', backup::LOG_ERROR)); + $msg = 13; + $this->assertFalse($lo1->process($msg, backup::LOG_ERROR)); // Test checksum correct $lo1 = new mock_base_logger1(backup::LOG_ERROR); diff --git a/badges/index.php b/badges/index.php index a1102232aa8..250ebee7802 100644 --- a/badges/index.php +++ b/badges/index.php @@ -160,7 +160,7 @@ if ($type == BADGE_TYPE_SITE) { } echo $OUTPUT->box('', 'notifyproblem hide', 'check_connection'); -$totalcount = count(badges_get_badges($type, $courseid, '', '' , '', '')); +$totalcount = count(badges_get_badges($type, $courseid, '', '' , 0, 0)); $records = badges_get_badges($type, $courseid, $sortby, $sorthow, $page, BADGE_PERPAGE); if ($totalcount) { diff --git a/badges/view.php b/badges/view.php index ed1aa7df98a..b1f3495ae04 100644 --- a/badges/view.php +++ b/badges/view.php @@ -83,7 +83,7 @@ $output = $PAGE->get_renderer('core', 'badges'); echo $output->header(); echo $OUTPUT->heading($title); -$totalcount = count(badges_get_badges($type, $courseid, '', '', '', '', $USER->id)); +$totalcount = count(badges_get_badges($type, $courseid, '', '', 0, 0, $USER->id)); $records = badges_get_badges($type, $courseid, $sortby, $sorthow, $page, BADGE_PERPAGE, $USER->id); if ($totalcount) { diff --git a/blocks/glossary_random/block_glossary_random.php b/blocks/glossary_random/block_glossary_random.php index bf9f6a7dcea..4ef7515ea77 100644 --- a/blocks/glossary_random/block_glossary_random.php +++ b/blocks/glossary_random/block_glossary_random.php @@ -86,7 +86,7 @@ class block_glossary_random extends block_base { switch ($this->config->type) { case BGR_RANDOMLY: - $i = rand(1,$numberofentries); + $i = ($numberofentries > 1) ? rand(1, $numberofentries) : 1; $limitfrom = $i-1; break; diff --git a/lib/tests/setuplib_test.php b/lib/tests/setuplib_test.php index 10d2cee69e4..aba4ec75ae3 100644 --- a/lib/tests/setuplib_test.php +++ b/lib/tests/setuplib_test.php @@ -174,7 +174,7 @@ class core_setuplib_testcase extends advanced_testcase { global $CFG; // Start with a file instead of a directory. - $base = $CFG->tempdir . DIRECTORY_SEPARATOR . md5(microtime() + rand()); + $base = $CFG->tempdir . DIRECTORY_SEPARATOR . md5(microtime(true) + rand()); touch($base); // First the false test.