Skip to content

Commit

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

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()

{

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

}


}

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

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()

{

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

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


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

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(getService());
$classroomResponse = createCourse();
$this->assertNotNull($classroomResponse, "Not get any value from service");
}


}

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

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()

{

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

}


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

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()
{

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

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

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()
{

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

}


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

class ClassroomPatchCourseTest extends \PHPUnit\Framework\TestCase
{
protected function getService()
public function testlistAllCourses()
{
$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);
$classroomResponse = patchCourse('531365683519');
$this->assertNotNull($classroomResponse, "Not get any value from service");

}


}

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

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()

{

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

}
Expand Down

0 comments on commit 2a75af0

Please sign in to comment.