Skip to content

Commit

Permalink
Merge pull request #20 from RajeshGogo/revert-15-classroom-snippets
Browse files Browse the repository at this point in the history
Revert "Classroom Unit Test"
  • Loading branch information
sanjuktaghosh7 authored Jun 27, 2022
2 parents 2a75af0 + ee66992 commit 741cf62
Show file tree
Hide file tree
Showing 8 changed files with 110 additions and 15 deletions.
17 changes: 15 additions & 2 deletions classroom/snippets/test/ClassroomAddTeacherTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,25 @@

class ClassroomAddTeacherTest extends \PHPUnit\Framework\TestCase
{

protected function getService()
{
$client = new Google\Client();
$client->useApplicationDefaultCredentials();
$client->addScope("https://www.googleapis.com/auth/classroom.courses");
$service = new Google_Service_Classroom($client);
return $service;
}

public function testcreateCourseAlias()

{
$classroomResponse = addTeacher('531365794650','[email protected]');

$service = $this->getService();
$classroomResponse = addTeacher($service, '531365794650' ,'[email protected]');
$this->assertNotNull($classroomResponse, "Not get any value from service");

}


}

17 changes: 15 additions & 2 deletions classroom/snippets/test/ClassroomBatchAddStudentsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,23 @@

class ClassroomBatchAddStudentsTest extends \PHPUnit\Framework\TestCase
{
protected function getService()
{
$client = new Google\Client();
$client->useApplicationDefaultCredentials();
$client->addScope("https://www.googleapis.com/auth/classroom.courses");
$service = new Google_Service_Classroom($client);
return $service;
}

public function testcreateCourseAlias()

{
$classroomResponse = batchAddStudents('123456',['a', 'b']);
$this->assertNotNull($classroomResponse, "Not get any value from service");

$service = $this->getService();
$classroomResponse = batchAddStudents($service, '531365794650', ['a', 'b']);
$this->assertNotNull($classroomResponse, "Not get any value from service");

}


Expand Down
12 changes: 11 additions & 1 deletion classroom/snippets/test/ClassroomCreateCourseTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,21 @@

class ClassroomCreateCourseTest extends \PHPUnit\Framework\TestCase
{
protected function getService()
{
$client = new Google\Client();
$client->useApplicationDefaultCredentials();
$client->addScope("https://www.googleapis.com/auth/classroom.courses");
$service = new Google_Service_Classroom($client);
return $service;
}

public function testCreateCourse()
{
$classroomResponse = createCourse();
$classroomResponse = createCourse(getService());
$this->assertNotNull($classroomResponse, "Not get any value from service");
}


}

15 changes: 14 additions & 1 deletion classroom/snippets/test/ClassroomEnrollAsStudentTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,23 @@

class ClassroomEnrollAsStudentTest extends \PHPUnit\Framework\TestCase
{
protected function getService()
{
$client = new Google\Client();
$client->useApplicationDefaultCredentials();
$client->addScope("https://www.googleapis.com/auth/classroom.courses");
$service = new Google_Service_Classroom($client);
return $service;
}

public function testcreateCourseAlias()

{
$classroomResponse = enrollAsStudent( '123456','abcdef');

$service = $this->getService();
$classroomResponse = enrollAsStudent($service, '531365794650' ,'[email protected]');
$this->assertNotNull($classroomResponse, "Not get any value from service");

}


Expand Down
14 changes: 12 additions & 2 deletions classroom/snippets/test/ClassroomGetCourseTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,21 @@

class ClassroomGetCourseTest extends \PHPUnit\Framework\TestCase
{
protected function getService()
{
$client = new Google\Client();
$client->useApplicationDefaultCredentials();
$client->addScope("https://www.googleapis.com/auth/classroom.courses");
$service = new Google_Service_Classroom($client);
return $service;
}

public function testgetCourse()
public function testgetCourse()

{

$classroomResponse = getCourse('123456');
$service = $this->getService();
$classroomResponse = getCourse($service, '531365794650');
$this->assertNotNull($classroomResponse, "Not get any value from service");

}
Expand Down
16 changes: 14 additions & 2 deletions classroom/snippets/test/ClassroomListAllCoursesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,23 @@

class ClassroomListAllCoursesTest extends \PHPUnit\Framework\TestCase
{
protected function getService()
{
$client = new Google\Client();
$client->useApplicationDefaultCredentials();
$client->addScope("https://www.googleapis.com/auth/classroom.courses");
$service = new Google_Service_Classroom($client);
return $service;
}

public function testlistAllCourses()
public function testlistAllCourses()

{
$classroomResponse = listCourses();

$service = $this->getService();
$classroomResponse = listCourses($service);
$this->assertNotNull($classroomResponse, "Not get any value from service");

}


Expand Down
19 changes: 17 additions & 2 deletions classroom/snippets/test/ClassroomPatchCourseTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,25 @@

class ClassroomPatchCourseTest extends \PHPUnit\Framework\TestCase
{
public function testlistAllCourses()
protected function getService()
{
$classroomResponse = patchCourse('531365683519');
$client = new Google\Client();
$client->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");

}


}

15 changes: 12 additions & 3 deletions classroom/snippets/test/ClassroomUpdateCourseTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,21 @@

class ClassroomUpdateCourseTest extends \PHPUnit\Framework\TestCase
{

protected function getService()
{
$client = new Google\Client();
$client->useApplicationDefaultCredentials();
$client->addScope("https://www.googleapis.com/auth/classroom.courses");
$service = new Google_Service_Classroom($client);
return $service;
}

public function testcreateCourseAlias()

{
$classroomResponse = updateCourse( '531365794650');
{

$service = $this->getService();
$classroomResponse = updateCourse($service);
$this->assertNotNull($classroomResponse, "Not get any value from service");

}
Expand Down

0 comments on commit 741cf62

Please sign in to comment.