diff --git a/lib/emitter/docs/examples/AssignmentGraded.json b/lib/emitter/docs/examples/AssignmentGraded.json index 1a82e093245a4c821a8db4c7a02842aece25d730..cc00d0fb86f0678dc9a12a30fe1ab40182743dcd 100644 --- a/lib/emitter/docs/examples/AssignmentGraded.json +++ b/lib/emitter/docs/examples/AssignmentGraded.json @@ -84,7 +84,7 @@ "verb": { "id": "http:\/\/adlnet.gov\/expapi\/verbs\/scored", "display": { - "en": "recieved grade for" + "en": "received grade for" } }, "result": { diff --git a/lib/emitter/src/Events/AssignmentGraded.php b/lib/emitter/src/Events/AssignmentGraded.php index 37afef1a8dd01d0e2ab002c7ed357ef3d5aa7e1d..7f62545a5f76b58df5ae38c6bed2b0730cf22cac 100644 --- a/lib/emitter/src/Events/AssignmentGraded.php +++ b/lib/emitter/src/Events/AssignmentGraded.php @@ -1,8 +1,8 @@ <?php namespace XREmitter\Events; class AssignmentGraded extends Event { - protected static $verb_display = [ - 'en' => 'recieved grade for' + protected static $verbDisplay = [ + 'en' => 'received grade for' ]; /** diff --git a/lib/emitter/src/Events/AssignmentSubmitted.php b/lib/emitter/src/Events/AssignmentSubmitted.php index bca3fbae9b4ef533a34a8d8e81c96b048b45887d..3c3bff7e5f4cc67a71fb0f2999160fdaed47bf3f 100644 --- a/lib/emitter/src/Events/AssignmentSubmitted.php +++ b/lib/emitter/src/Events/AssignmentSubmitted.php @@ -1,7 +1,7 @@ <?php namespace XREmitter\Events; class AssignmentSubmitted extends Event { - protected static $verb_display = [ + protected static $verbDisplay = [ 'en' => 'completed' ]; diff --git a/lib/emitter/src/Events/AttemptCompleted.php b/lib/emitter/src/Events/AttemptCompleted.php index ad7e4cfbf1dc00aebb07cf6e5d55720b17f5c515..4fc9efb9539d3fc46dfd5ce96ce42c781068ab9d 100644 --- a/lib/emitter/src/Events/AttemptCompleted.php +++ b/lib/emitter/src/Events/AttemptCompleted.php @@ -1,7 +1,7 @@ <?php namespace XREmitter\Events; class AttemptCompleted extends Event { - protected static $verb_display = [ + protected static $verbDisplay = [ 'en' => 'completed' ]; diff --git a/lib/emitter/src/Events/AttemptStarted.php b/lib/emitter/src/Events/AttemptStarted.php index 9a326599311fd1ab7726e5ff8eb33aef29712bd6..6c1d5ca23d82bf8ee9448137d2b6f365401a2daf 100644 --- a/lib/emitter/src/Events/AttemptStarted.php +++ b/lib/emitter/src/Events/AttemptStarted.php @@ -1,7 +1,7 @@ <?php namespace XREmitter\Events; class AttemptStarted extends Event { - protected static $verb_display = [ + protected static $verbDisplay = [ 'en' => 'started' ]; diff --git a/lib/emitter/src/Events/Attended.php b/lib/emitter/src/Events/Attended.php index 99beff8ee8f8592f1503efaaf57e54add5a6da22..1b524c1b4edc5db51c9c56dfe96884fb5b795e05 100755 --- a/lib/emitter/src/Events/Attended.php +++ b/lib/emitter/src/Events/Attended.php @@ -1,7 +1,7 @@ <?php namespace XREmitter\Events; class Attended extends Event { - protected static $verb_display = [ + protected static $verbDisplay = [ 'en' => 'attended' ]; diff --git a/lib/emitter/src/Events/CourseCompleted.php b/lib/emitter/src/Events/CourseCompleted.php index 8abc0b829246a1f6c8dc0f44e380791b83ba66fe..456a7a7bf7a8240699fb9716682306fac873670e 100644 --- a/lib/emitter/src/Events/CourseCompleted.php +++ b/lib/emitter/src/Events/CourseCompleted.php @@ -19,7 +19,7 @@ class CourseCompleted extends Event * Sets the language equivalent for completed. * @var array */ - protected static $verb_display = [ + protected static $verbDisplay = [ 'en' => 'completed' ]; /** diff --git a/lib/emitter/src/Events/EnrolmentCreated.php b/lib/emitter/src/Events/EnrolmentCreated.php index 1f2213fc0bf2d16bfdd62af957730ad7485ba1eb..5382deaee653cfeb50ae831aaa8ff37a969e5d99 100644 --- a/lib/emitter/src/Events/EnrolmentCreated.php +++ b/lib/emitter/src/Events/EnrolmentCreated.php @@ -1,7 +1,7 @@ <?php namespace XREmitter\Events; class EnrolmentCreated extends Event { - protected static $verb_display = [ + protected static $verbDisplay = [ 'en' => 'enrolled onto' ]; diff --git a/lib/emitter/src/Events/Event.php b/lib/emitter/src/Events/Event.php index 9b323cf0a10a4351150bca95a6e7f40a0be280f8..f3c78acb367026baeffd8fcd84b200c6b69f8a7d 100644 --- a/lib/emitter/src/Events/Event.php +++ b/lib/emitter/src/Events/Event.php @@ -2,7 +2,7 @@ use \stdClass as PhpObj; abstract class Event extends PhpObj { - protected static $verb_display; + protected static $verbDisplay; /** * Reads data for an event. @@ -130,8 +130,8 @@ abstract class Event extends PhpObj { protected function readVerbDisplay($opts) { $lang = $opts['context_lang']; - $lang = isset(static::$verb_display[$lang]) ? $lang : array_keys(static::$verb_display)[0]; - return [$lang => static::$verb_display[$lang]]; + $lang = isset(static::$verbDisplay[$lang]) ? $lang : array_keys(static::$verbDisplay)[0]; + return [$lang => static::$verbDisplay[$lang]]; } } diff --git a/lib/emitter/src/Events/EventEnrol.php b/lib/emitter/src/Events/EventEnrol.php index ab0230ff6c423894a53752d482aa5a45c067ddda..949f2d5b142372e0664e7d7b6b7a5f57c7cf60b4 100755 --- a/lib/emitter/src/Events/EventEnrol.php +++ b/lib/emitter/src/Events/EventEnrol.php @@ -1,7 +1,7 @@ <?php namespace XREmitter\Events; class EventEnrol extends Event { - protected static $verb_display = [ + protected static $verbDisplay = [ 'en' => 'registered for' ]; diff --git a/lib/emitter/src/Events/EventUnenrol.php b/lib/emitter/src/Events/EventUnenrol.php index 9a00e46120a6c7d31ea47969e966aafe701b111b..a4e63935da49ac9e94717e556025926c252d6b4d 100755 --- a/lib/emitter/src/Events/EventUnenrol.php +++ b/lib/emitter/src/Events/EventUnenrol.php @@ -1,7 +1,7 @@ <?php namespace XREmitter\Events; class EventUnenrol extends EventEnrol { - protected static $verb_display = [ + protected static $verbDisplay = [ 'en' => 'unregistered from' ]; diff --git a/lib/emitter/src/Events/QuestionAnswered.php b/lib/emitter/src/Events/QuestionAnswered.php index f757fa87266e1a5cc0364c0c05f7e754941a7ea7..cffed7ae5eef417937746c9ec57bef1804605618 100644 --- a/lib/emitter/src/Events/QuestionAnswered.php +++ b/lib/emitter/src/Events/QuestionAnswered.php @@ -1,7 +1,7 @@ <?php namespace XREmitter\Events; class QuestionAnswered extends Event { - protected static $verb_display = [ + protected static $verbDisplay = [ 'en' => 'answered' ]; diff --git a/lib/emitter/src/Events/ScormEvent.php b/lib/emitter/src/Events/ScormEvent.php index 0f59da326fcf3a21c1d60d55b17d5884d1283d81..2181f755cb84cb2d3ebfde6705098aa3ae7e3ae6 100644 --- a/lib/emitter/src/Events/ScormEvent.php +++ b/lib/emitter/src/Events/ScormEvent.php @@ -40,7 +40,7 @@ class ScormEvent extends Event { $verb = 'completed'; } - static::$verb_display = ['en' => $verb]; + static::$verbDisplay = ['en' => $verb]; $lang = [ 'id' => $verbUrl, diff --git a/lib/emitter/src/Events/ScormLaunched.php b/lib/emitter/src/Events/ScormLaunched.php index dc2e4526ca2478601a825e2d3ba96a6f4c1332fb..a43d584a8bd0dbbd09354e1d9cfa5b1aaf971d4f 100644 --- a/lib/emitter/src/Events/ScormLaunched.php +++ b/lib/emitter/src/Events/ScormLaunched.php @@ -1,7 +1,7 @@ <?php namespace XREmitter\Events; class ScormLaunched extends Event { - protected static $verb_display = [ + protected static $verbDisplay = [ 'en' => 'launched' ]; diff --git a/lib/emitter/src/Events/ScormScoreRawSubmitted.php b/lib/emitter/src/Events/ScormScoreRawSubmitted.php index 7285a78a7d8aded3628b8f84361d646b3533a22e..e32142de2461070ee44c1be86db0f77c6bd2e4e1 100644 --- a/lib/emitter/src/Events/ScormScoreRawSubmitted.php +++ b/lib/emitter/src/Events/ScormScoreRawSubmitted.php @@ -1,7 +1,7 @@ <?php namespace XREmitter\Events; class ScormScoreRawSubmitted extends ScormEvent { - protected static $verb_display; + protected static $verbDisplay; /** * Reads data for an event. diff --git a/lib/emitter/src/Events/ScormStatusSubmitted.php b/lib/emitter/src/Events/ScormStatusSubmitted.php index 9ecab95ee00831fd103c2cef603894bf703f7d0a..9837023c69aa2463e76a5b54333ce977eda5a983 100644 --- a/lib/emitter/src/Events/ScormStatusSubmitted.php +++ b/lib/emitter/src/Events/ScormStatusSubmitted.php @@ -1,7 +1,7 @@ <?php namespace XREmitter\Events; class ScormStatusSubmitted extends ScormEvent { - protected static $verb_display = [ + protected static $verbDisplay = [ 'en' => 'completed' ]; diff --git a/lib/emitter/src/Events/UserLoggedin.php b/lib/emitter/src/Events/UserLoggedin.php index 70f8e87a0b283027397ff4fa0a8b882d0941a8b7..e6bf20daf1d421c4e50f62e217aaffba7ff9422c 100644 --- a/lib/emitter/src/Events/UserLoggedin.php +++ b/lib/emitter/src/Events/UserLoggedin.php @@ -1,7 +1,7 @@ <?php namespace XREmitter\Events; class UserLoggedin extends Event { - protected static $verb_display = [ + protected static $verbDisplay = [ 'en' => 'logged in to' ]; diff --git a/lib/emitter/src/Events/UserLoggedout.php b/lib/emitter/src/Events/UserLoggedout.php index c6616950d1789f710d13b63448ea1f7bc3b1a796..33f6aaf76a41c77b738684956007a8e88a70656e 100644 --- a/lib/emitter/src/Events/UserLoggedout.php +++ b/lib/emitter/src/Events/UserLoggedout.php @@ -1,7 +1,7 @@ <?php namespace XREmitter\Events; class UserLoggedout extends Event { - protected static $verb_display = [ + protected static $verbDisplay = [ 'en' => 'logged out of' ]; diff --git a/lib/emitter/src/Events/UserRegistered.php b/lib/emitter/src/Events/UserRegistered.php index f756484f1213ef52cdaf0aeb2043dcb6c37037ad..0b43d260873b5b0b5893b156f153b06c7e32c55e 100644 --- a/lib/emitter/src/Events/UserRegistered.php +++ b/lib/emitter/src/Events/UserRegistered.php @@ -1,7 +1,7 @@ <?php namespace XREmitter\Events; class UserRegistered extends Event { - protected static $verb_display = [ + protected static $verbDisplay = [ 'en' => 'registered to' ]; diff --git a/lib/emitter/src/Events/Viewed.php b/lib/emitter/src/Events/Viewed.php index be1976f4096e99c84a52f677a3c8c61db2e83132..9e218d44bb53620c7b1d8428b6595b36e8d170c1 100644 --- a/lib/emitter/src/Events/Viewed.php +++ b/lib/emitter/src/Events/Viewed.php @@ -1,7 +1,7 @@ <?php namespace XREmitter\Events; abstract class Viewed extends Event { - protected static $verb_display = [ + protected static $verbDisplay = [ 'en' => 'viewed' ]; diff --git a/lib/emitter/tests/AssignmentGradedTest.php b/lib/emitter/tests/AssignmentGradedTest.php index 78881606692ec49743c85dca55dc36b456859eeb..2456c152b653801eee606f69f90135b16c2b78da 100644 --- a/lib/emitter/tests/AssignmentGradedTest.php +++ b/lib/emitter/tests/AssignmentGradedTest.php @@ -40,7 +40,7 @@ class AssignmentGradedTest extends EventTest { $output['context']['extensions']['http://lrs.learninglocker.net/define/extensions/info'] ); $this->assertValidXapiStatement($output); - $this->assertVerb('http://adlnet.gov/expapi/verbs/scored', 'recieved grade for', $output['verb']); + $this->assertVerb('http://adlnet.gov/expapi/verbs/scored', 'received grade for', $output['verb']); $this->assertObject('module', $input, $output['object']); $this->assertObject('course', $input, $output['context']['contextActivities']['parent'][0]); $this->assertEquals($input['grade_score_raw'], $output['result']['score']['raw']); diff --git a/lib/emitter/tests/EventTest.php b/lib/emitter/tests/EventTest.php index dffb7c8cb39c553ce490942e33f6f4100a462b7f..ba74959f171855d995a6c94b6142a9bcd0c35801 100644 --- a/lib/emitter/tests/EventTest.php +++ b/lib/emitter/tests/EventTest.php @@ -170,8 +170,8 @@ abstract class EventTest extends PhpUnitTestCase { $this->assertEquals($input[$type.'_description'], $output['definition']['description'][$input['context_lang']]); } - protected function assertVerb($verb_id, $verb_name, $output) { - $this->assertEquals($verb_id, $output['id']); + protected function assertVerb($verbId, $verb_name, $output) { + $this->assertEquals($verbId, $output['id']); $this->assertEquals($verb_name, $output['display']['en']); } @@ -199,9 +199,9 @@ abstract class EventTest extends PhpUnitTestCase { } protected function createExampleFile($output) { - $class_array = explode('\\', get_class($this)); - $event_name = str_replace('Test', '', array_pop($class_array)); - $example_file = __DIR__.'/../docs/examples/'.$event_name.'.json'; - file_put_contents($example_file, json_encode($output, JSON_PRETTY_PRINT)); + $classArray = explode('\\', get_class($this)); + $eventName = str_replace('Test', '', array_pop($classArray)); + $exampleFile = __DIR__.'/../docs/examples/'.$eventName.'.json'; + file_put_contents($exampleFile, json_encode($output, JSON_PRETTY_PRINT)); } } diff --git a/lib/expander/docs/examples/FeedbackSubitted.json b/lib/expander/docs/examples/FeedbackSubitted.json index dced4766b22a47de72e2b841efd5020572bb345b..6944c74ee1e88afbd85bcee2475b6c3ca16497a4 100644 --- a/lib/expander/docs/examples/FeedbackSubitted.json +++ b/lib/expander/docs/examples/FeedbackSubitted.json @@ -116,6 +116,6 @@ "type": "object" } }, - "timemodified": 1497207558 + "timemodified": 1497208516 } } \ No newline at end of file diff --git a/lib/expander/src/Events/AssignmentGraded.php b/lib/expander/src/Events/AssignmentGraded.php index c1c8d0ff1d6435ee515580754c1b2ba04be84c96..5ad816cb0c8205e401ce598c5f4a6a024b3bb326 100644 --- a/lib/expander/src/Events/AssignmentGraded.php +++ b/lib/expander/src/Events/AssignmentGraded.php @@ -9,12 +9,12 @@ class AssignmentGraded extends Event { */ public function read(array $opts) { $grade = $this->repo->readObject($opts['objectid'], $opts['objecttable']); - $grade_comment = $this->repo->readGradeComment($grade->id, $grade->assignment)->commenttext; - $grade_items = $this->repo->readGradeItems($grade->assignment, 'assign'); + $gradeComment = $this->repo->readGradeComment($grade->id, $grade->assignment)->commenttext; + $gradeItems = $this->repo->readGradeItems($grade->assignment, 'assign'); return array_merge(parent::read($opts), [ 'grade' => $grade, - 'grade_comment' => $grade_comment, - 'grade_items' => $grade_items, + 'grade_comment' => $gradeComment, + 'grade_items' => $gradeItems, 'graded_user' => $this->repo->readUser($grade->userid), 'module' => $this->repo->readModule($grade->assignment, 'assign'), ]); diff --git a/lib/expander/src/Events/AttemptEvent.php b/lib/expander/src/Events/AttemptEvent.php index 62085512f5cb30eead9e3485e269b39cff677100..9946d487947c7dc7d413d2f568467f01418fd0aa 100644 --- a/lib/expander/src/Events/AttemptEvent.php +++ b/lib/expander/src/Events/AttemptEvent.php @@ -9,14 +9,14 @@ class AttemptEvent extends Event { */ public function read(array $opts) { $attempt = $this->repo->readAttempt($opts['objectid']); - $grade_items = $this->repo->readGradeItems($attempt->quiz, 'quiz'); + $gradeItems = $this->repo->readGradeItems($attempt->quiz, 'quiz'); $attempt->questions = $this->repo->readQuestionAttempts($attempt->id); $questions = $this->repo->readQuestions($attempt->quiz); return array_merge(parent::read($opts), [ 'attempt' => $attempt, 'module' => $this->repo->readModule($attempt->quiz, 'quiz'), - 'grade_items' => $grade_items, + 'grade_items' => $gradeItems, 'questions' => $questions ]); } diff --git a/lib/expander/src/Events/ScormLaunched.php b/lib/expander/src/Events/ScormLaunched.php index 0d0f92875cc2adb572b7d688bb1d8acdb387a2d9..67580935d02178d5d700261524d4a954ac6bab7e 100644 --- a/lib/expander/src/Events/ScormLaunched.php +++ b/lib/expander/src/Events/ScormLaunched.php @@ -8,10 +8,10 @@ class ScormLaunched extends Event { * @override Event */ public function read(array $opts) { - $scorm_scoes = $this->repo->readObject($opts['objectid'], $opts['objecttable']); + $scormScoes = $this->repo->readObject($opts['objectid'], $opts['objecttable']); return array_merge(parent::read($opts), [ - 'module' => $this->repo->readModule($scorm_scoes->scorm, 'scorm'), - 'scorm_scoes' => $scorm_scoes + 'module' => $this->repo->readModule($scormScoes->scorm, 'scorm'), + 'scorm_scoes' => $scormScoes ]); } } \ No newline at end of file diff --git a/lib/expander/tests/EventTest.php b/lib/expander/tests/EventTest.php index a8737c6beba4f487d41a40c5610445b254ddf938..c4753e5eb17789d19754cea1755e27c42494f5bb 100644 --- a/lib/expander/tests/EventTest.php +++ b/lib/expander/tests/EventTest.php @@ -92,9 +92,9 @@ class EventTest extends PhpUnitTestCase { } protected function createExampleFile($output) { - $class_array = explode('\\', get_class($this)); - $event_name = str_replace('Test', '', array_pop($class_array)); - $example_file = __DIR__.'/../docs/examples/'.$event_name.'.json'; - file_put_contents($example_file, json_encode($output, JSON_PRETTY_PRINT)); + $classArray = explode('\\', get_class($this)); + $eventName = str_replace('Test', '', array_pop($classArray)); + $exampleFile = __DIR__.'/../docs/examples/'.$eventName.'.json'; + file_put_contents($exampleFile, json_encode($output, JSON_PRETTY_PRINT)); } } diff --git a/lib/translator/src/Controller.php b/lib/translator/src/Controller.php index e6b672fa969e1534e81d55bb1465e9ad15ad96a6..66dc250ee5102ceffeda6e951500f8f43f229ff9 100644 --- a/lib/translator/src/Controller.php +++ b/lib/translator/src/Controller.php @@ -62,10 +62,10 @@ class Controller extends PhpObj { foreach ($events as $index => $opts) { $route = isset($opts['event']['eventname']) ? $opts['event']['eventname'] : ''; if (isset(static::$routes[$route])) { - $route_events = is_array(static::$routes[$route]) ? static::$routes[$route] : [static::$routes[$route]]; - foreach ($route_events as $route_event) { + $routeEvents = is_array(static::$routes[$route]) ? static::$routes[$route] : [static::$routes[$route]]; + foreach ($routeEvents as $routeEvent) { try { - $event = '\MXTranslator\Events\\'.$route_event; + $event = '\MXTranslator\Events\\'.$routeEvent; foreach ((new $event())->read($opts) as $index => $result) { array_push($results, $result); } diff --git a/lib/translator/tests/AttemptStartedTest.php b/lib/translator/tests/AttemptStartedTest.php index 4250de710f15c7163e14a58f660a8b66d5dc4216..7ad689f8439faaf65c11409c8fcc94ac095cf5a1 100644 --- a/lib/translator/tests/AttemptStartedTest.php +++ b/lib/translator/tests/AttemptStartedTest.php @@ -36,11 +36,11 @@ class AttemptStartedTest extends ModuleViewedTest { } protected function assertAttempt($input, $output) { - $ext_key = 'http://lrs.learninglocker.net/define/extensions/moodle_attempt'; + $extKey = 'http://lrs.learninglocker.net/define/extensions/moodle_attempt'; $this->assertEquals($input->url, $output['attempt_url']); $this->assertEquals($input->name, $output['attempt_name']); $this->assertEquals(static::$xapiType.$input->type, $output['attempt_type']); $this->assertEquals($input, $output['attempt_ext']); - $this->assertEquals($ext_key, $output['attempt_ext_key']); + $this->assertEquals($extKey, $output['attempt_ext_key']); } } diff --git a/lib/translator/tests/CourseCompletedTest.php b/lib/translator/tests/CourseCompletedTest.php index 70f306759776c82d3a9ca15aba833a0e10da0eca..ecf667a8f1fbb064351ea86216439e3e63ef3e4b 100644 --- a/lib/translator/tests/CourseCompletedTest.php +++ b/lib/translator/tests/CourseCompletedTest.php @@ -32,12 +32,12 @@ class CourseCompletedTest extends EventTest { /** * Constructs the event with the given event name - * @param $event_name + * @param $eventName * @return array */ - private function constructEvent($event_name) { + private function constructEvent($eventName) { return [ - 'eventname' => $event_name, + 'eventname' => $eventName, 'timecreated' => 1433946701, ]; } diff --git a/lib/translator/tests/DiscussionViewedTest.php b/lib/translator/tests/DiscussionViewedTest.php index 2b6149364172b1c9b566d65ebdb82231fa65f945..661c89200a2477857a51371a7143efc641161d8f 100644 --- a/lib/translator/tests/DiscussionViewedTest.php +++ b/lib/translator/tests/DiscussionViewedTest.php @@ -34,12 +34,12 @@ class DiscussionViewedTest extends ModuleViewedTest { } private function assertDiscussion($input, $output, $type) { - $ext_key = 'http://lrs.learninglocker.net/define/extensions/moodle_discussion'; + $extKey = 'http://lrs.learninglocker.net/define/extensions/moodle_discussion'; $this->assertEquals($input->url, $output[$type.'_url']); $this->assertEquals($input->name, $output[$type.'_name']); $this->assertEquals('A Moodle discussion.', $output[$type.'_description']); $this->assertEquals(static::$xapiType.$input->type, $output[$type.'_type']); $this->assertEquals($input, $output[$type.'_ext']); - $this->assertEquals($ext_key, $output[$type.'_ext_key']); + $this->assertEquals($extKey, $output[$type.'_ext_key']); } } diff --git a/lib/translator/tests/EventTest.php b/lib/translator/tests/EventTest.php index 49ce6b50366e8b7aec8c4404a0ee9a807912ccb4..55ae99215a222d95ed38ed329c5ea17e9589eb10 100644 --- a/lib/translator/tests/EventTest.php +++ b/lib/translator/tests/EventTest.php @@ -56,9 +56,9 @@ abstract class EventTest extends PhpUnitTestCase { ]; } - private function constructEvent($event_name) { + private function constructEvent($eventName) { return [ - 'eventname' => $event_name, + 'eventname' => $eventName, 'timecreated' => 1433946701, ]; } @@ -116,18 +116,18 @@ abstract class EventTest extends PhpUnitTestCase { } protected function assertCourse($input, $output, $type) { - $ext_key = 'http://lrs.learninglocker.net/define/extensions/moodle_course'; + $extKey = 'http://lrs.learninglocker.net/define/extensions/moodle_course'; $this->assertEquals($input->lang, $output['context_lang']); $this->assertEquals($input->url, $output[$type.'_url']); $this->assertEquals($input->fullname, $output[$type.'_name']); $this->assertEquals(strip_tags($input->summary), $output[$type.'_description']); $this->assertEquals(static::$xapiType.$input->type, $output[$type.'_type']); $this->assertEquals($input, $output[$type.'_ext']); - $this->assertEquals($ext_key, $output[$type.'_ext_key']); + $this->assertEquals($extKey, $output[$type.'_ext_key']); } protected function assertApp($input, $output, $type) { - $ext_key = 'http://lrs.learninglocker.net/define/extensions/moodle_course'; + $extKey = 'http://lrs.learninglocker.net/define/extensions/moodle_course'; $app_type = 'http://id.tincanapi.com/activitytype/site'; $this->assertEquals($input->lang, $output['context_lang']); $this->assertEquals($input->url, $output[$type.'_url']); @@ -135,7 +135,7 @@ abstract class EventTest extends PhpUnitTestCase { $this->assertEquals(strip_tags($input->summary), $output[$type.'_description']); $this->assertEquals($app_type, $output[$type.'_type']); $this->assertEquals($input, $output[$type.'_ext']); - $this->assertEquals($ext_key, $output[$type.'_ext_key']); + $this->assertEquals($extKey, $output[$type.'_ext_key']); } protected function assertSource($input, $output, $type) { @@ -148,10 +148,10 @@ abstract class EventTest extends PhpUnitTestCase { } private function assertEvent($input, $output) { - $ext_key = 'http://lrs.learninglocker.net/define/extensions/moodle_logstore_standard_log'; + $extKey = 'http://lrs.learninglocker.net/define/extensions/moodle_logstore_standard_log'; $this->assertEquals('Moodle', $output['context_platform']); $this->assertEquals($input, $output['context_ext']); - $this->assertEquals($ext_key, $output['context_ext_key']); + $this->assertEquals($extKey, $output['context_ext_key']); $this->assertEquals(date('c', $input['timecreated']), $output['time']); } @@ -163,9 +163,9 @@ abstract class EventTest extends PhpUnitTestCase { } protected function createExampleFile($output) { - $class_array = explode('\\', get_class($this)); - $event_name = str_replace('Test', '', array_pop($class_array)); - $example_file = __DIR__.'/../docs/examples/'.$event_name.'.json'; - file_put_contents($example_file, json_encode($output, JSON_PRETTY_PRINT)); + $classArray = explode('\\', get_class($this)); + $eventName = str_replace('Test', '', array_pop($classArray)); + $exampleFile = __DIR__.'/../docs/examples/'.$eventName.'.json'; + file_put_contents($exampleFile, json_encode($output, JSON_PRETTY_PRINT)); } } diff --git a/lib/translator/tests/FeedbackSubmittedTest.php b/lib/translator/tests/FeedbackSubmittedTest.php index 651e16f8b1990335bdb6e73d7eb896c04f8b8492..e81b05fca11d98926df2b9a7e5c1b2a103f3dc7a 100644 --- a/lib/translator/tests/FeedbackSubmittedTest.php +++ b/lib/translator/tests/FeedbackSubmittedTest.php @@ -68,12 +68,12 @@ class FeedbackSubmittedTest extends ModuleViewedTest { } protected function assertAttempt($input, $output) { - $ext_key = 'http://lrs.learninglocker.net/define/extensions/moodle_feedback_attempt'; + $extKey = 'http://lrs.learninglocker.net/define/extensions/moodle_feedback_attempt'; $this->assertEquals($input->url, $output['attempt_url']); $this->assertEquals($input->name, $output['attempt_name']); $this->assertEquals(static::$xapiType.$input->type, $output['attempt_type']); $this->assertEquals($input, $output['attempt_ext']); - $this->assertEquals($ext_key, $output['attempt_ext_key']); + $this->assertEquals($extKey, $output['attempt_ext_key']); } } diff --git a/lib/translator/tests/ModuleViewedTest.php b/lib/translator/tests/ModuleViewedTest.php index 59d5e540f6b77c4ad156cc9a28415863f830febc..1f1ec61211413980bcf718ce2751a0e875703857 100644 --- a/lib/translator/tests/ModuleViewedTest.php +++ b/lib/translator/tests/ModuleViewedTest.php @@ -33,12 +33,12 @@ class ModuleViewedTest extends CourseViewedTest { } private function assertModule($input, $output, $type) { - $ext_key = 'http://lrs.learninglocker.net/define/extensions/moodle_module'; + $extKey = 'http://lrs.learninglocker.net/define/extensions/moodle_module'; $this->assertEquals($input->url, $output[$type.'_url']); $this->assertEquals($input->name, $output[$type.'_name']); $this->assertEquals($input->intro, $output[$type.'_description']); $this->assertEquals(static::$xapiType.$input->type, $output[$type.'_type']); $this->assertEquals($input, $output[$type.'_ext']); - $this->assertEquals($ext_key, $output[$type.'_ext_key']); + $this->assertEquals($extKey, $output[$type.'_ext_key']); } }