From 20f87bfa6653684cd88915fb510a0a4c4ad458bc Mon Sep 17 00:00:00 2001 From: anuraggoogler Date: Thu, 16 Jun 2022 11:53:26 +0000 Subject: [PATCH] Classroom unit test cases --- .../snippets/test/ClassroomAddTeacherTest.php | 44 +++++++++++++++++++ .../test/ClassroomBatchAddStudentsTest.php | 44 +++++++++++++++++++ .../test/ClassroomCreateCourseTest.php | 40 +++++++++++++++++ .../ClassroomCreateCoursesAliasesTest.php | 44 +++++++++++++++++++ .../test/ClassroomEnrollAsStudentTest.php | 44 +++++++++++++++++++ .../snippets/test/ClassroomGetCourseTest.php | 44 +++++++++++++++++++ .../test/ClassroomListAllCoursesTest.php | 44 +++++++++++++++++++ .../test/ClassroomListCourseAliasesTest.php | 44 +++++++++++++++++++ .../test/ClassroomPatchCourseTest.php | 44 +++++++++++++++++++ .../test/ClassroomUpdateCourseTest.php | 44 +++++++++++++++++++ 10 files changed, 436 insertions(+) create mode 100644 classroom/snippets/test/ClassroomAddTeacherTest.php create mode 100644 classroom/snippets/test/ClassroomBatchAddStudentsTest.php create mode 100644 classroom/snippets/test/ClassroomCreateCourseTest.php create mode 100644 classroom/snippets/test/ClassroomCreateCoursesAliasesTest.php create mode 100644 classroom/snippets/test/ClassroomEnrollAsStudentTest.php create mode 100644 classroom/snippets/test/ClassroomGetCourseTest.php create mode 100644 classroom/snippets/test/ClassroomListAllCoursesTest.php create mode 100644 classroom/snippets/test/ClassroomListCourseAliasesTest.php create mode 100644 classroom/snippets/test/ClassroomPatchCourseTest.php create mode 100644 classroom/snippets/test/ClassroomUpdateCourseTest.php diff --git a/classroom/snippets/test/ClassroomAddTeacherTest.php b/classroom/snippets/test/ClassroomAddTeacherTest.php new file mode 100644 index 0000000..04bf6f4 --- /dev/null +++ b/classroom/snippets/test/ClassroomAddTeacherTest.php @@ -0,0 +1,44 @@ +useApplicationDefaultCredentials(); + $client->addScope("https://www.googleapis.com/auth/classroom.courses"); + $service = new Google_Service_Classroom($client); + return $service; + } + + public function testcreateCourseAlias() + + { + + $service = $this->getService(); + $classroomResponse = addTeacher($service, '531365794650' ,'gduser2@workspacesamples.dev'); + $this->assertNotNull($classroomResponse, "Not get any value from service"); + + } + + + } + diff --git a/classroom/snippets/test/ClassroomBatchAddStudentsTest.php b/classroom/snippets/test/ClassroomBatchAddStudentsTest.php new file mode 100644 index 0000000..04f5228 --- /dev/null +++ b/classroom/snippets/test/ClassroomBatchAddStudentsTest.php @@ -0,0 +1,44 @@ +useApplicationDefaultCredentials(); + $client->addScope("https://www.googleapis.com/auth/classroom.courses"); + $service = new Google_Service_Classroom($client); + return $service; + } + + public function testcreateCourseAlias() + + { + + $service = $this->getService(); + $classroomResponse = batchAddStudents($service, '531365794650', ['a', 'b']); + $this->assertNotNull($classroomResponse, "Not get any value from service"); + + } + + + } + diff --git a/classroom/snippets/test/ClassroomCreateCourseTest.php b/classroom/snippets/test/ClassroomCreateCourseTest.php new file mode 100644 index 0000000..c44ab12 --- /dev/null +++ b/classroom/snippets/test/ClassroomCreateCourseTest.php @@ -0,0 +1,40 @@ +useApplicationDefaultCredentials(); + $client->addScope("https://www.googleapis.com/auth/classroom.courses"); + $service = new Google_Service_Classroom($client); + return $service; + } + + public function testCreateCourse() + { + $classroomResponse = createCourse(getService()); + $this->assertNotNull($classroomResponse, "Not get any value from service"); + } + + + } + diff --git a/classroom/snippets/test/ClassroomCreateCoursesAliasesTest.php b/classroom/snippets/test/ClassroomCreateCoursesAliasesTest.php new file mode 100644 index 0000000..bbdc0a6 --- /dev/null +++ b/classroom/snippets/test/ClassroomCreateCoursesAliasesTest.php @@ -0,0 +1,44 @@ +useApplicationDefaultCredentials(); + $client->addScope("https://www.googleapis.com/auth/classroom.courses"); + $service = new Google_Service_Classroom($client); + return $service; + } + + public function testcreateCourseAlias() + + { + + $service = $this->getService(); + $classroomResponse = createCourseAlias($service, '531365794650', 'p:bio10p4'); + $this->assertNotNull($classroomResponse, "Not get any value from service"); + + } + + + } + diff --git a/classroom/snippets/test/ClassroomEnrollAsStudentTest.php b/classroom/snippets/test/ClassroomEnrollAsStudentTest.php new file mode 100644 index 0000000..23213cb --- /dev/null +++ b/classroom/snippets/test/ClassroomEnrollAsStudentTest.php @@ -0,0 +1,44 @@ +useApplicationDefaultCredentials(); + $client->addScope("https://www.googleapis.com/auth/classroom.courses"); + $service = new Google_Service_Classroom($client); + return $service; + } + + public function testcreateCourseAlias() + + { + + $service = $this->getService(); + $classroomResponse = enrollAsStudent($service, '531365794650' ,'gduser1@workspacesamples.dev'); + $this->assertNotNull($classroomResponse, "Not get any value from service"); + + } + + + } + diff --git a/classroom/snippets/test/ClassroomGetCourseTest.php b/classroom/snippets/test/ClassroomGetCourseTest.php new file mode 100644 index 0000000..15f2a6d --- /dev/null +++ b/classroom/snippets/test/ClassroomGetCourseTest.php @@ -0,0 +1,44 @@ +useApplicationDefaultCredentials(); + $client->addScope("https://www.googleapis.com/auth/classroom.courses"); + $service = new Google_Service_Classroom($client); + return $service; + } + + public function testgetCourse() + + { + + $service = $this->getService(); + $classroomResponse = getCourse($service, '531365794650'); + $this->assertNotNull($classroomResponse, "Not get any value from service"); + + } + + + } + diff --git a/classroom/snippets/test/ClassroomListAllCoursesTest.php b/classroom/snippets/test/ClassroomListAllCoursesTest.php new file mode 100644 index 0000000..e2e3752 --- /dev/null +++ b/classroom/snippets/test/ClassroomListAllCoursesTest.php @@ -0,0 +1,44 @@ +useApplicationDefaultCredentials(); + $client->addScope("https://www.googleapis.com/auth/classroom.courses"); + $service = new Google_Service_Classroom($client); + return $service; + } + + public function testlistAllCourses() + + { + + $service = $this->getService(); + $classroomResponse = listCourses($service); + $this->assertNotNull($classroomResponse, "Not get any value from service"); + + } + + + } + diff --git a/classroom/snippets/test/ClassroomListCourseAliasesTest.php b/classroom/snippets/test/ClassroomListCourseAliasesTest.php new file mode 100644 index 0000000..b61c79d --- /dev/null +++ b/classroom/snippets/test/ClassroomListCourseAliasesTest.php @@ -0,0 +1,44 @@ +useApplicationDefaultCredentials(); + $client->addScope("https://www.googleapis.com/auth/classroom.courses"); + $service = new Google_Service_Classroom($client); + return $service; + } + + public function testcreateCourseAlias() + + { + + $service = $this->getService(); + $classroomResponse = listCourseAliases($service); + $this->assertNotNull($classroomResponse, "Not get any value from service"); + + } + + + } + diff --git a/classroom/snippets/test/ClassroomPatchCourseTest.php b/classroom/snippets/test/ClassroomPatchCourseTest.php new file mode 100644 index 0000000..7a7887d --- /dev/null +++ b/classroom/snippets/test/ClassroomPatchCourseTest.php @@ -0,0 +1,44 @@ +useApplicationDefaultCredentials(); + $client->addScope("https://www.googleapis.com/auth/classroom.courses"); + $service = new Google_Service_Classroom($client); + return $service; + } + + public function testlistAllCourses() + + { + + $service = $this->getService(); + $classroomResponse = patchCourse($service); + $this->assertNotNull($classroomResponse, "Not get any value from service"); + + } + + + } + diff --git a/classroom/snippets/test/ClassroomUpdateCourseTest.php b/classroom/snippets/test/ClassroomUpdateCourseTest.php new file mode 100644 index 0000000..a1ff993 --- /dev/null +++ b/classroom/snippets/test/ClassroomUpdateCourseTest.php @@ -0,0 +1,44 @@ +useApplicationDefaultCredentials(); + $client->addScope("https://www.googleapis.com/auth/classroom.courses"); + $service = new Google_Service_Classroom($client); + return $service; + } + + public function testcreateCourseAlias() + + { + + $service = $this->getService(); + $classroomResponse = updateCourse($service); + $this->assertNotNull($classroomResponse, "Not get any value from service"); + + } + + + } +