Skip to content

Commit

Permalink
Update unit tests to include later versions of Moodle and PHP (#829)
Browse files Browse the repository at this point in the history
* prep for new release and adding 3.11 support

* adding moodle4.0

* @Covers for core tests

* @Covers for remaining tests

Co-authored-by: David Pesce <david.pesce@exputo.com>
  • Loading branch information
davidpesce and exputo authored Oct 19, 2022
1 parent f8c5a08 commit 1850df7
Show file tree
Hide file tree
Showing 93 changed files with 134 additions and 69 deletions.
39 changes: 35 additions & 4 deletions .github/workflows/moodle-plugin-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,31 @@ jobs:
strategy:
fail-fast: false
matrix:
php: ['7.4']
moodle-branch: ['MOODLE_39_STABLE']
database: [pgsql, mariadb]
include:
- php: '7.4'
moodle-branch: 'MOODLE_39_STABLE'
database: 'pgsql'
- php: '7.4'
moodle-branch: 'MOODLE_39_STABLE'
database: 'mariadb'
- php: '7.4'
moodle-branch: 'MOODLE_311_STABLE'
database: 'pgsql'
- php: '7.4'
moodle-branch: 'MOODLE_311_STABLE'
database: 'mariadb'
- php: '8.0'
moodle-branch: 'MOODLE_311_STABLE'
database: 'pgsql'
- php: '8.0'
moodle-branch: 'MOODLE_311_STABLE'
database: 'mariadb'
- php: '8.0'
moodle-branch: 'MOODLE_400_STABLE'
database: 'pgsql'
- php: '8.0'
moodle-branch: 'MOODLE_400_STABLE'
database: 'mariadb'

steps:
- name: Check out repository code
Expand Down Expand Up @@ -63,10 +85,19 @@ jobs:
cd plugin
composer install
- name: Install moodle-plugin-ci
- name: Install additional supported plugins (Moodle 3.9-3.11)
if: ${{ matrix.moodle-branch == 'MOODLE_39_STABLE' || matrix.moodle-branch == 'MOODLE_310_STABLE' || matrix.moodle-branch == 'MOODLE_311_STABLE' }}
run: |
moodle-plugin-ci add-plugin --branch MOODLE_34_STABLE catalyst/moodle-mod_facetoface
moodle-plugin-ci add-plugin --branch v3.0-stable blindsidenetworks/moodle-mod_bigbluebuttonbn
- name: Install additional supported plugins (Moodle 4.0)
if: ${{ matrix.moodle-branch == 'MOODLE_400_STABLE' }}
run: |
moodle-plugin-ci add-plugin --branch MOODLE_400_STABLE catalyst/moodle-mod_facetoface
- name: Install the plugin.
run: |
moodle-plugin-ci install --plugin ./plugin --db-host=127.0.0.1
env:
DB: ${{ matrix.database }}
Expand Down
2 changes: 1 addition & 1 deletion classes/log/store.php
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ protected function get_event_id($event) {
* Insert events in bulk to the database. Overrides helper_writer.
* @param array $events raw event data
*/
protected function insert_event_entries(array $events) {
protected function insert_event_entries($events) {
global $DB;

// If in background mode, just save them in the database.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ protected function get_test_dir() {
/**
* Appease auto-detecting of test cases. xapi_test_case has default test cases.
*
* @covers ::course_completed
* @return void
*/
public function test_init() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ protected function get_transformer_config() {
/**
* Appease auto-detecting of test cases. xapi_test_case has default test cases.
*
* @covers ::course_completed
* @return void
*/
public function test_init() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ protected function get_test_dir() {
/**
* Appease auto-detecting of test cases. xapi_test_case has default test cases.
*
* @covers ::course_module_completion_updated
* @return void
*/
public function test_init() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ protected function get_test_dir() {
/**
* Appease auto-detecting of test cases. xapi_test_case has default test cases.
*
* @covers ::course_viewed
* @return void
*/
public function test_init() {
Expand Down
1 change: 0 additions & 1 deletion tests/core/unknown_event/data.json

This file was deleted.

4 changes: 0 additions & 4 deletions tests/core/unknown_event/event.json

This file was deleted.

1 change: 0 additions & 1 deletion tests/core/unknown_event/statements.json

This file was deleted.

53 changes: 0 additions & 53 deletions tests/core/unknown_event/unknown_event_test.php

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ protected function get_test_dir() {
/**
* Appease auto-detecting of test cases. xapi_test_case has default test cases.
*
* @covers ::user_created
* @return void
*/
public function test_init() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ protected function get_transformer_config() {
/**
* Appease auto-detecting of test cases. xapi_test_case has default test cases.
*
* @covers ::user_created
* @return void
*/
public function test_init() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ protected function get_test_dir() {
/**
* Appease auto-detecting of test cases. xapi_test_case has default test cases.
*
* @covers ::user_enrolment_created
* @return void
*/
public function test_init() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ protected function get_test_dir() {
/**
* Appease auto-detecting of test cases. xapi_test_case has default test cases.
*
* @covers ::user_loggedin
* @return void
*/
public function test_init() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ protected function get_test_dir() {
/**
* Appease auto-detecting of test cases. xapi_test_case has default test cases.
*
* @covers ::user_loggedout
* @return void
*/
public function test_init() {
Expand Down
4 changes: 4 additions & 0 deletions tests/failed_report_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ protected function get_validated_form() {
/**
* Creating minimum a single course view event to xapi logstore.
* Submit form and validate form data.
*
* @covers \form\tool_logstore_xapi_reportfilter_form
*/
public function test_single_element() {
global $DB;
Expand All @@ -90,6 +92,8 @@ public function test_single_element() {
* Creating multiple course view events to xapi logstore.
* Record number depends on $multipletestnumber.
* Submit form and validate form data.
*
* @covers \form\tool_logstore_xapi_reportfilter_form
*/
public function test_multiple_elements() {
global $DB;
Expand Down
4 changes: 4 additions & 0 deletions tests/history_report_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ protected function get_validated_form() {
/**
* Creating minimum a single course view event to xapi logstore.
* Submit form and validate form data.
*
* @covers \form\tool_logstore_xapi_reportfilter_form
*/
public function test_single_element() {
global $DB;
Expand All @@ -88,6 +90,8 @@ public function test_single_element() {
* Creating multiple course view events to xapi logstore.
* Record number depends on $multipletestnumber.
* Submit form and validate form data.
*
* @covers \form\tool_logstore_xapi_reportfilter_form
*/
public function test_multiple_elements() {
global $DB;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ protected function get_test_dir() {
/**
* Appease auto-detecting of test cases. xapi_test_case has default test cases.
*
* @covers ::assignment_graded
* @return void
*/
public function test_init() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ protected function get_test_dir() {
/**
* Appease auto-detecting of test cases. xapi_test_case has default test cases.
*
* @covers ::assignment_graded
* @return void
*/
public function test_init() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ protected function get_test_dir() {
/**
* Appease auto-detecting of test cases. xapi_test_case has default test cases.
*
* @covers ::assignment_submitted
* @return void
*/
public function test_init() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ protected function get_test_dir() {
/**
* Appease auto-detecting of test cases. xapi_test_case has default test cases.
*
* @covers ::activity_management_viewed
* @return void
*/
public function test_init() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ protected function get_test_dir() {
/**
* Appease auto-detecting of test cases. xapi_test_case has default test cases.
*
* @covers ::live_session
* @return void
*/
public function test_init() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ protected function get_test_dir() {
/**
* Appease auto-detecting of test cases. xapi_test_case has default test cases.
*
* @covers ::meeting_created
* @return void
*/
public function test_init() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ protected function get_test_dir() {
/**
* Appease auto-detecting of test cases. xapi_test_case has default test cases.
*
* @covers ::meeting_ended
* @return void
*/
public function test_init() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ protected function get_test_dir() {
/**
* Appease auto-detecting of test cases. xapi_test_case has default test cases.
*
* @covers ::meeting_joined
* @return void
*/
public function test_init() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ protected function get_test_dir() {
/**
* Appease auto-detecting of test cases. xapi_test_case has default test cases.
*
* @covers ::meeting_left
* @return void
*/
public function test_init() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ protected function get_test_dir() {
/**
* Appease auto-detecting of test cases. xapi_test_case has default test cases.
*
* @covers ::recording_deleted
* @return void
*/
public function test_init() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ protected function get_test_dir() {
/**
* Appease auto-detecting of test cases. xapi_test_case has default test cases.
*
* @covers ::recording_edited
* @return void
*/
public function test_init() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ protected function get_test_dir() {
/**
* Appease auto-detecting of test cases. xapi_test_case has default test cases.
*
* @covers ::recording_imported
* @return void
*/
public function test_init() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ protected function get_test_dir() {
/**
* Appease auto-detecting of test cases. xapi_test_case has default test cases.
*
* @covers ::recording_protected
* @return void
*/
public function test_init() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ protected function get_test_dir() {
/**
* Appease auto-detecting of test cases. xapi_test_case has default test cases.
*
* @covers ::recording_published
* @return void
*/
public function test_init() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ protected function get_test_dir() {
/**
* Appease auto-detecting of test cases. xapi_test_case has default test cases.
*
* @covers ::recording_unprotected
* @return void
*/
public function test_init() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ protected function get_test_dir() {
/**
* Appease auto-detecting of test cases. xapi_test_case has default test cases.
*
* @covers ::recording_unpublished
* @return void
*/
public function test_init() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ protected function get_test_dir() {
/**
* Appease auto-detecting of test cases. xapi_test_case has default test cases.
*
* @covers ::recording_viewed
* @return void
*/
public function test_init() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ protected function get_test_dir() {
/**
* Appease auto-detecting of test cases. xapi_test_case has default test cases.
*
* @covers ::chapter_viewed
* @return void
*/
public function test_init() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ protected function get_test_dir() {
/**
* Appease auto-detecting of test cases. xapi_test_case has default test cases.
*
* @covers ::chapter_viewed
* @return void
*/
public function test_init() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ protected function get_test_dir() {
/**
* Appease auto-detecting of test cases. xapi_test_case has default test cases.
*
* @covers ::course_module_viewed
* @return void
*/
public function test_init() {
Expand Down
Loading

0 comments on commit 1850df7

Please sign in to comment.