forked from turnitin/moodle-plagiarism_turnitin
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
befd40c
commit c4ce6ce
Showing
13 changed files
with
98 additions
and
71 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
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 |
---|---|---|
|
@@ -36,7 +36,7 @@ | |
* | ||
* @package turnitin | ||
*/ | ||
final class turnitin_assignment_class_test extends advanced_testcase { | ||
final class turnitin_assignment_class_test extends \advanced_testcase { | ||
|
||
/** | ||
* Set Overwrite mtrace to avoid output during the tests. | ||
|
@@ -61,15 +61,15 @@ public function test_get_course_data(): void { | |
$this->resetAfterTest(); | ||
|
||
// Create a PP course. | ||
$course = new stdClass(); | ||
$course = new \stdClass(); | ||
This comment has been minimized.
Sorry, something went wrong.
timhunt
|
||
$course->courseid = 1; | ||
$course->turnitin_ctl = "Test Course"; | ||
$course->turnitin_cid = 10; | ||
|
||
// Insert the course to the plagiarism turnitin courses table. | ||
$DB->insert_record('plagiarism_turnitin_courses', $course); | ||
|
||
$response = turnitin_assignment::get_course_data(1, "site"); | ||
$response = \turnitin_assignment::get_course_data(1, "site"); | ||
|
||
$this->assertEquals($course->turnitin_ctl, $response->turnitin_ctl); | ||
$this->assertEquals($course->turnitin_cid, $response->turnitin_cid); | ||
|
@@ -88,7 +88,7 @@ public function test_create_tii_course(): void { | |
$this->resetAfterTest(); | ||
|
||
// Create a PP course. | ||
$course = new stdClass(); | ||
$course = new \stdClass(); | ||
$course->courseid = 1; | ||
$course->turnitin_ctl = "Test Course"; | ||
$course->turnitin_cid = 10; | ||
|
@@ -119,7 +119,7 @@ public function test_create_tii_course(): void { | |
|
||
$response = $mock->create_tii_course($course, 1); | ||
|
||
$expected = new stdClass(); | ||
$expected = new \stdClass(); | ||
$expected->id = $course->tii_rel_id; | ||
$expected->turnitin_cid = 1; | ||
$expected->turnitin_ctl = "This is a test course (Moodle PP)"; | ||
|
@@ -147,7 +147,7 @@ public function test_edit_tii_course(): void { | |
$this->resetAfterTest(); | ||
|
||
// Create a PP course. | ||
$course = new stdClass(); | ||
$course = new \stdClass(); | ||
$course->courseid = 1; | ||
$course->turnitin_ctl = "Test Course"; | ||
$course->turnitin_cid = 1; | ||
|
@@ -173,7 +173,7 @@ public function test_edit_tii_course(): void { | |
->getMock(); | ||
|
||
// Edit a PP course. | ||
$editcourse = new stdClass(); | ||
$editcourse = new \stdClass(); | ||
$editcourse->id = 1; | ||
$editcourse->turnitin_cid = 10; | ||
$editcourse->fullname = "This is an edited test course"; | ||
|
@@ -184,7 +184,7 @@ public function test_edit_tii_course(): void { | |
|
||
$responsecourse = $DB->get_record("plagiarism_turnitin_courses", ["id" => $course->id]); | ||
|
||
$expected = new stdClass(); | ||
$expected = new \stdClass(); | ||
$expected->id = $course->id; | ||
$expected->courseid = $course->courseid; | ||
$expected->turnitin_ctl = "This is an edited test course (Moodle PP)"; | ||
|
@@ -206,12 +206,12 @@ public function test_truncate_title(): void { | |
$title = "This is a very long title that we are going to use to test the truncate title method."; | ||
$limit = 50; | ||
|
||
$response = turnitin_assignment::truncate_title($title, $limit); | ||
$response = \turnitin_assignment::truncate_title($title, $limit); | ||
|
||
$this->assertEquals('This is a very long title that we a... (Moodle PP)', $response); | ||
|
||
// Try a title that is within our limit. | ||
$response = turnitin_assignment::truncate_title("This title should not be truncated.", $limit); | ||
$response = \turnitin_assignment::truncate_title("This title should not be truncated.", $limit); | ||
$this->assertEquals('This title should not be truncated. (Moodle PP)', $response); | ||
} | ||
|
||
|
@@ -225,7 +225,7 @@ public function test_create_tii_assignment(): void { | |
$this->resetAfterTest(); | ||
|
||
// Create a PP assignment. | ||
$assignment = new stdClass(); | ||
$assignment = new \stdClass(); | ||
$assignment->id = 1; | ||
|
||
// Stub a fake tii comms. | ||
|
@@ -264,7 +264,7 @@ public function test_edit_tii_assignment(): void { | |
$this->resetAfterTest(); | ||
|
||
// Create a PP assignment. | ||
$assignment = new stdClass(); | ||
$assignment = new \stdClass(); | ||
$assignment->id = 1; | ||
$assignment->title = "This is a test assignment."; | ||
|
||
|
@@ -312,7 +312,7 @@ public function test_edit_tii_assignment(): void { | |
$this->assertEquals(get_string('editassignmenterror', 'plagiarism_turnitin'), $response["error"]); | ||
|
||
// Test the error handling for the cron workflow. | ||
$error = new stdClass(); | ||
$error = new \stdClass(); | ||
$error->title = $assignment->title; | ||
$error->assignmentid = 1; | ||
|
||
|
@@ -335,7 +335,7 @@ public function test_get_peermark_assignments(): void { | |
$this->resetAfterTest(); | ||
|
||
// Create a PP course. | ||
$peermark = new stdClass(); | ||
$peermark = new \stdClass(); | ||
$peermark->parent_tii_assign_id = 1; | ||
$peermark->title = "This is a test Peermark assignment."; | ||
$peermark->tiiassignid = 1; | ||
|
@@ -347,7 +347,7 @@ public function test_get_peermark_assignments(): void { | |
// Insert the peermark to the plagiarism turnitin courses table. | ||
$DB->insert_record('plagiarism_turnitin_peermark', $peermark); | ||
|
||
$assignment = new turnitin_assignment(0, 1); | ||
$assignment = new \turnitin_assignment(0, 1); | ||
|
||
// We should have a peermark object. | ||
$response = $assignment->get_peermark_assignments(1, $peermark->parent_tii_assign_id); | ||
|
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
Oops, something went wrong.
How can this pass on Moodle 401? the grade calculator was only added in Moodle 4.2.