-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MDLUM-8024 - MDL 3.11 - Partager nos plugins
- Loading branch information
Showing
5 changed files
with
24 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,5 +23,3 @@ | |
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later | ||
*/ | ||
|
||
defined('MOODLE_INTERNAL') || die(); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,8 +22,7 @@ | |
* @author Issam Taboubi <[email protected]> | ||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later | ||
*/ | ||
use tool_cohortsync\cohortmembersync; | ||
|
||
namespace tool_cohortsync; | ||
|
||
defined('MOODLE_INTERNAL') || die(); | ||
|
||
|
@@ -39,7 +38,7 @@ | |
* @author Issam Taboubi <[email protected]> | ||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later | ||
*/ | ||
class tool_cohortmembersync_testcase extends advanced_testcase { | ||
class cohortmembersync_test extends \advanced_testcase { | ||
|
||
/** @var progress_trace trace */ | ||
protected $trace = null; | ||
|
@@ -88,8 +87,8 @@ public function setUp(): void { | |
$this->cat1 = $this->getDataGenerator()->create_category(array('name' => 'CAT1')); | ||
$this->cat2 = $this->getDataGenerator()->create_category(array('name' => 'CAT2')); | ||
|
||
$this->contextcat1 = context_coursecat::instance($this->cat1->id); | ||
$this->contextcat2 = context_coursecat::instance($this->cat2->id); | ||
$this->contextcat1 = \context_coursecat::instance($this->cat1->id); | ||
$this->contextcat2 = \context_coursecat::instance($this->cat2->id); | ||
|
||
$this->cohort1 = $this->getDataGenerator()->create_cohort(array( | ||
'name' => 'Cohort1', | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,8 +22,7 @@ | |
* @author Issam Taboubi <[email protected]> | ||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later | ||
*/ | ||
use tool_cohortsync\cohortsync; | ||
|
||
namespace tool_cohortsync; | ||
|
||
defined('MOODLE_INTERNAL') || die(); | ||
|
||
|
@@ -39,7 +38,7 @@ | |
* @author Issam Taboubi <[email protected]> | ||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later | ||
*/ | ||
class tool_cohortsync_testcase extends advanced_testcase { | ||
class cohortsync_test extends \advanced_testcase { | ||
|
||
/** @var progress_trace trace */ | ||
protected $trace = null; | ||
|
@@ -99,8 +98,8 @@ public function test_cohortsync_with_column_category_as_name() { | |
$this->assertEquals('cohortid2', $cohort2->idnumber); | ||
$this->assertEquals('cohortid3', $cohort3->idnumber); | ||
|
||
$contextcat1 = context_coursecat::instance($cat1->id); | ||
$contextcat2 = context_coursecat::instance($cat2->id); | ||
$contextcat1 = \context_coursecat::instance($cat1->id); | ||
$contextcat2 = \context_coursecat::instance($cat2->id); | ||
|
||
$this->assertEquals($contextcat1->id, $cohort1->contextid); | ||
$this->assertEquals($contextcat2->id, $cohort2->contextid); | ||
|
@@ -138,8 +137,8 @@ public function test_cohortsync_with_column_category_as_id() { | |
$this->assertEquals('cohortid2', $cohort2->idnumber); | ||
$this->assertEquals('cohortid3', $cohort3->idnumber); | ||
|
||
$contextcat1 = context_coursecat::instance($cat1->id); | ||
$contextcat2 = context_coursecat::instance($cat2->id); | ||
$contextcat1 = \context_coursecat::instance($cat1->id); | ||
$contextcat2 = \context_coursecat::instance($cat2->id); | ||
|
||
$this->assertEquals($contextcat1->id, $cohort1->contextid); | ||
$this->assertEquals($contextcat2->id, $cohort2->contextid); | ||
|
@@ -176,8 +175,8 @@ public function test_cohortsync_with_column_category_as_idnumber() { | |
$this->assertEquals('cohortid2', $cohort2->idnumber); | ||
$this->assertEquals('cohortid3', $cohort3->idnumber); | ||
|
||
$contextcat1 = context_coursecat::instance($cat1->id); | ||
$contextcat2 = context_coursecat::instance($cat2->id); | ||
$contextcat1 = \context_coursecat::instance($cat1->id); | ||
$contextcat2 = \context_coursecat::instance($cat2->id); | ||
|
||
$this->assertEquals($contextcat1->id, $cohort1->contextid); | ||
$this->assertEquals($contextcat2->id, $cohort2->contextid); | ||
|
@@ -193,8 +192,8 @@ public function test_cohortsync_with_column_contextid() { | |
$cat1 = $this->getDataGenerator()->create_category(array('name' => 'CAT1')); | ||
$cat2 = $this->getDataGenerator()->create_category(array('name' => 'CAT2')); | ||
|
||
$contextcat1 = context_coursecat::instance($cat1->id); | ||
$contextcat2 = context_coursecat::instance($cat2->id); | ||
$contextcat1 = \context_coursecat::instance($cat1->id); | ||
$contextcat2 = \context_coursecat::instance($cat2->id); | ||
|
||
$cohorts = array(); | ||
$cohorts[] = array('cohort name 1', 'cohortid1', 'first description', 1, $contextcat1->id); | ||
|
@@ -252,8 +251,8 @@ public function test_cohortsync_with_column_category_id() { | |
$this->assertEquals('cohortid2', $cohort2->idnumber); | ||
$this->assertEquals('cohortid3', $cohort3->idnumber); | ||
|
||
$contextcat1 = context_coursecat::instance($cat1->id); | ||
$contextcat2 = context_coursecat::instance($cat2->id); | ||
$contextcat1 = \context_coursecat::instance($cat1->id); | ||
$contextcat2 = \context_coursecat::instance($cat2->id); | ||
|
||
$this->assertEquals($contextcat1->id, $cohort1->contextid); | ||
$this->assertEquals($contextcat2->id, $cohort2->contextid); | ||
|
@@ -290,8 +289,8 @@ public function test_cohortsync_with_column_category_idnumber() { | |
$this->assertEquals('cohortid2', $cohort2->idnumber); | ||
$this->assertEquals('cohortid3', $cohort3->idnumber); | ||
|
||
$contextcat1 = context_coursecat::instance($cat1->id); | ||
$contextcat2 = context_coursecat::instance($cat2->id); | ||
$contextcat1 = \context_coursecat::instance($cat1->id); | ||
$contextcat2 = \context_coursecat::instance($cat2->id); | ||
|
||
$this->assertEquals($contextcat1->id, $cohort1->contextid); | ||
$this->assertEquals($contextcat2->id, $cohort2->contextid); | ||
|
@@ -328,8 +327,8 @@ public function test_cohortsync_with_column_category_path() { | |
$this->assertEquals('cohortid2', $cohort2->idnumber); | ||
$this->assertEquals('cohortid3', $cohort3->idnumber); | ||
|
||
$contextcat1 = context_coursecat::instance($cat1->id); | ||
$contextcat2 = context_coursecat::instance($cat2->id); | ||
$contextcat1 = \context_coursecat::instance($cat1->id); | ||
$contextcat2 = \context_coursecat::instance($cat2->id); | ||
|
||
$this->assertEquals($contextcat1->id, $cohort1->contextid); | ||
$this->assertEquals($contextcat2->id, $cohort2->contextid); | ||
|
@@ -343,7 +342,7 @@ public function test_cohortsync_with_defaultcontext() { | |
global $DB; | ||
|
||
$defaultcat = $this->getDataGenerator()->create_category(array('name' => 'DEFAULTCAT')); | ||
$contextdefault = context_coursecat::instance($defaultcat->id); | ||
$contextdefault = \context_coursecat::instance($defaultcat->id); | ||
|
||
$cohorts = array(); | ||
$cohorts[] = array('cohort name 1', 'cohortid1', 'first description', 1); | ||
|
@@ -385,7 +384,7 @@ public function test_cohortsync_no_defaultcontext() { | |
|
||
$this->assertEquals('cohortid1', $cohort1->idnumber); | ||
|
||
$contextsystem = context_system::instance(); | ||
$contextsystem = \context_system::instance(); | ||
$this->assertEquals($contextsystem->id, $cohort1->contextid); | ||
} | ||
|
||
|
@@ -488,7 +487,7 @@ public function test_cohortsync_warnings_when_notfoundcategory() { | |
$cohort1 = $DB->get_record('cohort', array('idnumber' => 'cohortid1')); | ||
|
||
$this->assertEquals('cohortid1', $cohort1->idnumber); | ||
$contextsystem = context_system::instance(); | ||
$contextsystem = \context_system::instance(); | ||
$this->assertEquals($contextsystem->id, $cohort1->contextid); | ||
} | ||
|
||
|