diff --git a/tests/events_test.php b/tests/events_test.php index 6563d06..6428a4c 100644 --- a/tests/events_test.php +++ b/tests/events_test.php @@ -22,18 +22,18 @@ defined('MOODLE_INTERNAL') || die(); /** * Tests performed on outage class. * - * @package auth_outage - * @author Daniel Thee Roperto - * @copyright Catalyst IT - * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later - * @covers \auth_outage\event\outage_created - * @covers \auth_outage\event\outage_updated - * @covers \auth_outage\event\outage_deleted + * @package auth_outage + * @author Daniel Thee Roperto + * @copyright Catalyst IT + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + * @covers \auth_outage\event\outage_created + * @covers \auth_outage\event\outage_updated + * @covers \auth_outage\event\outage_deleted */ class events_test extends advanced_testcase { public function test_save() { global $DB; - $this->setAdminUser(); + self::setAdminUser(); $this->resetAfterTest(false); // Save new outage. @@ -54,7 +54,7 @@ class events_test extends advanced_testcase { 'id', IGNORE_MISSING ); - self::assertNotFalse($event); + self::assertTrue(is_object($event)); // Another test will use it. return [$id, $event->id]; @@ -67,7 +67,7 @@ class events_test extends advanced_testcase { public function test_update($ids) { global $DB; - $this->setAdminUser(); + self::setAdminUser(); $this->resetAfterTest(false); list($idoutage, $idevent) = $ids; @@ -83,7 +83,7 @@ class events_test extends advanced_testcase { 'id', IGNORE_MISSING ); - self::assertNotFalse($event); + self::assertTrue(is_object($event)); self::assertSame($idevent, $event->id); return $ids; @@ -96,7 +96,7 @@ class events_test extends advanced_testcase { public function test_delete($ids) { global $DB; - $this->setAdminUser(); + self::setAdminUser(); $this->resetAfterTest(true); list($idoutage, $idevent) = $ids; diff --git a/tests/infopagecontroller_test.php b/tests/infopagecontroller_test.php index 50d4805..32918fb 100644 --- a/tests/infopagecontroller_test.php +++ b/tests/infopagecontroller_test.php @@ -16,7 +16,6 @@ use auth_outage\infopage_controller; use auth_outage\models\outage; -use auth_outage\outagelib; defined('MOODLE_INTERNAL') || die(); @@ -53,7 +52,6 @@ class infopagecontroller_test extends advanced_testcase { $this->resetAfterTest(true); $PAGE->set_context(context_system::instance()); - $renderer = outagelib::get_renderer(); $now = time(); $outage = new outage([ 'id' => 1,