From bedf3a0a396c0db72f5358417ebfa696d266c7f6 Mon Sep 17 00:00:00 2001 From: David Monllao Date: Tue, 24 Mar 2015 11:59:05 +0800 Subject: [PATCH] MDL-49470 mod_lesson: Adding text space + unit test refinement --- mod/lesson/classes/event/page_moved.php | 4 ++-- mod/lesson/tests/events_test.php | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/mod/lesson/classes/event/page_moved.php b/mod/lesson/classes/event/page_moved.php index 482bef7c13f..91ce667111b 100644 --- a/mod/lesson/classes/event/page_moved.php +++ b/mod/lesson/classes/event/page_moved.php @@ -80,7 +80,7 @@ class page_moved extends \core\event\base { return "The user with id '$this->userid' has moved a ".$this->other['pagetype']." page with the ". "id '$this->objectid' to the slot after the page with the id '".$this->other['prevpageid']. "' and before the page with the id '".$this->other['nextpageid']. - "'in the lesson activity with course module id '$this->contextinstanceid'."; + "' in the lesson activity with course module id '$this->contextinstanceid'."; } /** @@ -105,4 +105,4 @@ class page_moved extends \core\event\base { throw new \coding_exception('The \'nextpageid\' value must be set in other.'); } } -} \ No newline at end of file +} diff --git a/mod/lesson/tests/events_test.php b/mod/lesson/tests/events_test.php index 1aae6006b6f..82d3a31adb4 100644 --- a/mod/lesson/tests/events_test.php +++ b/mod/lesson/tests/events_test.php @@ -93,7 +93,7 @@ class mod_lesson_events_testcase extends advanced_testcase { $page3 = $this->lesson->load_page($pagerecord3->id); // Trigger and capture the event. $sink = $this->redirectEvents(); - $page3->move($pagerecord1->id, $pagerecord1->id); + $page3->move($pagerecord2->id, $pagerecord1->id); // Get our event event. $events = $sink->get_events(); $event = reset($events); @@ -101,6 +101,8 @@ class mod_lesson_events_testcase extends advanced_testcase { // Check that the event data is valid. $this->assertInstanceOf('\mod_lesson\event\page_moved', $event); $this->assertEquals($page3->id, $event->objectid); + $this->assertEquals($pagerecord2->id, $event->other['nextpageid']); + $this->assertEquals($pagerecord1->id, $event->other['prevpageid']); $this->assertEventContextNotUsed($event); $this->assertDebuggingNotCalled(); }