Skip to content

Commit

Permalink
Merge branch 'MDL-77337-master' of https://github.com/meirzamoodle/mo…
Browse files Browse the repository at this point in the history
  • Loading branch information
paulholden authored and sarjona committed Mar 17, 2023
2 parents ac0f2dd + a6894fc commit 49e8e72
Show file tree
Hide file tree
Showing 9 changed files with 117 additions and 0 deletions.
3 changes: 3 additions & 0 deletions analytics/classes/action.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@ abstract class action {
*/
protected $text = null;

/** @var string Store the action type. */
protected string $type = '';

/**
* Returns the action name.
*
Expand Down
3 changes: 3 additions & 0 deletions analytics/classes/course.php
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,9 @@ class course implements \core_analytics\analysable {
*/
protected $ntotallogs = null;

/** @var int Store current Unix timestamp. */
protected int $now = 0;

/**
* Course manager constructor.
*
Expand Down
3 changes: 3 additions & 0 deletions analytics/classes/user.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ class user implements \core_analytics\analysable {
*/
protected $usercontext = null;

/** @var int Store current Unix timestamp. */
protected int $now = 0;

/**
* Constructor.
*
Expand Down
27 changes: 27 additions & 0 deletions analytics/tests/course_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,33 @@
*/
class course_test extends \advanced_testcase {

/** @var \stdClass Course record. */
protected $course;

/** @var \stdClass Student 1 user record. */
protected $stu1;

/** @var \stdClass Student 2 user record. */
protected $stu2;

/** @var \stdClass Student both user record. */
protected $both;

/** @var \stdClass Editing teacher user record. */
protected $editingteacher;

/** @var \stdClass Teacher user record. */
protected $teacher;

/** @var int Student role ID record. */
protected $studentroleid;

/** @var int Editing teacher role ID record. */
protected $editingteacherroleid;

/** @var int Teacher role ID record. */
protected $teacherroleid;

public function setUp(): void {
global $DB;

Expand Down
3 changes: 3 additions & 0 deletions analytics/tests/dataset_manager_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@
*/
class dataset_manager_test extends \advanced_testcase {

/** @var array Store dataset top rows. */
protected array $sharedtoprows = [];

/**
* setUp
*
Expand Down
6 changes: 6 additions & 0 deletions analytics/tests/model_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,12 @@
*/
class model_test extends \advanced_testcase {

/** @var model Store Model. */
protected $model;

/** @var \stdClass Store model object. */
protected $modelobj;

public function setUp(): void {

$this->setAdminUser();
Expand Down
24 changes: 24 additions & 0 deletions analytics/tests/prediction_actions_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,30 @@
*/
class prediction_actions_test extends \advanced_testcase {

/** @var model Store Model. */
protected $model;

/** @var \stdClass Store model object. */
protected $modelobj;

/** @var \stdClass Course 1 record. */
protected $course1;

/** @var \stdClass Course 2 record. */
protected $course2;

/** @var \context_course Store Model. */
protected $context;

/** @var \stdClass Teacher 1 user record. */
protected $teacher1;

/** @var \stdClass Teacher 2 user record. */
protected $teacher2;

/** @var \stdClass Teacher 3 user record. */
protected $teacher3;

/**
* Common startup tasks
*/
Expand Down
42 changes: 42 additions & 0 deletions analytics/tests/privacy/provider_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,48 @@
*/
class provider_test extends \core_privacy\tests\provider_testcase {

/** @var \core_analytics\model Store Model 1. */
protected $model1;

/** @var \core_analytics\model Store Model 2. */
protected $model2;

/** @var \stdClass $modelobj1 Store Model 1 object. */
protected $modelobj1;

/** @var \stdClass $modelobj2 Store Model 2 object. */
protected $modelobj2;

/** @var \stdClass $u1 User 1 record. */
protected $u1;

/** @var \stdClass $u2 User 2 record. */
protected $u2;

/** @var \stdClass $u3 User 3 record. */
protected $u3;

/** @var \stdClass $u4 User 4 record. */
protected $u4;

/** @var \stdClass $u5 User 5 record. */
protected $u5;

/** @var \stdClass $u6 User 6 record. */
protected $u6;

/** @var \stdClass $u7 User 7 record. */
protected $u7;

/** @var \stdClass $u8 User 8 record. */
protected $u8;

/** @var \stdClass $c1 Course 1 record. */
protected $c1;

/** @var \stdClass $c2 Course 2 record. */
protected $c2;

public function setUp(): void {

$this->resetAfterTest(true);
Expand Down
6 changes: 6 additions & 0 deletions analytics/tests/time_splittings_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,12 @@
*/
class time_splittings_test extends \advanced_testcase {

/** @var \stdClass course record. */
protected $course;

/** @var course Moodle course analysable. */
protected $analysable;

/**
* setUp
*
Expand Down

0 comments on commit 49e8e72

Please sign in to comment.