Proyectos de Subversion Moodle

Rev

Rev 11 | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 11 Rev 1441
Línea 21... Línea 21...
21
 *
21
 *
22
 * @package    tool_cohortroles
22
 * @package    tool_cohortroles
23
 * @copyright  2015 Damyon Wiese
23
 * @copyright  2015 Damyon Wiese
24
 * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
24
 * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
25
 */
25
 */
26
class api_test extends \advanced_testcase {
26
final class api_test extends \advanced_testcase {
27
    /** @var \stdClass $cohort */
27
    /** @var \stdClass $cohort */
28
    protected $cohort = null;
28
    protected $cohort = null;
Línea 29... Línea 29...
29
 
29
 
30
    /** @var \stdClass $userassignto */
30
    /** @var \stdClass $userassignto */
Línea 41... Línea 41...
41
 
41
 
42
    /**
42
    /**
43
     * Setup function- we will create a course and add an assign instance to it.
43
     * Setup function- we will create a course and add an assign instance to it.
44
     */
44
     */
-
 
45
    protected function setUp(): void {
45
    protected function setUp(): void {
46
        parent::setUp();
Línea 46... Línea 47...
46
        $this->resetAfterTest(true);
47
        $this->resetAfterTest(true);
47
 
48
 
48
        // Create some users.
49
        // Create some users.
Línea 69... Línea 70...
69
        $params = (object) array(
70
        $params = (object) array(
70
            'userid' => $this->userassignto->id,
71
            'userid' => $this->userassignto->id,
71
            'roleid' => -8,
72
            'roleid' => -8,
72
            'cohortid' => $this->cohort->id
73
            'cohortid' => $this->cohort->id
73
        );
74
        );
74
        $this->expectException(\core_competency\invalid_persistent_exception::class);
75
        $this->expectException(\core\invalid_persistent_exception::class);
75
        api::create_cohort_role_assignment($params);
76
        api::create_cohort_role_assignment($params);
76
    }
77
    }
Línea 77... Línea 78...
77
 
78
 
78
    public function test_create_cohort_role_assignment(): void {
79
    public function test_create_cohort_role_assignment(): void {