Skip to content

Commit 24de4da

Browse files
authored
Merge pull request #108 from RajeshGogo/classroom_UT
Classroom UTs
2 parents cde744e + ae1ff4a commit 24de4da

10 files changed

+436
-0
lines changed
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
<?php
2+
/**
3+
* Copyright 2022 Google Inc.
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License");
6+
* you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*
17+
*/
18+
19+
require 'src/classroom_addTeacher.php';
20+
21+
class ClassroomAddTeacherTest extends \PHPUnit\Framework\TestCase
22+
{
23+
protected function getService()
24+
{
25+
$client = new Google\Client();
26+
$client->useApplicationDefaultCredentials();
27+
$client->addScope("https://www.googleapis.com/auth/classroom.courses");
28+
$service = new Google_Service_Classroom($client);
29+
return $service;
30+
}
31+
32+
public function testcreateCourseAlias()
33+
34+
{
35+
36+
$service = $this->getService();
37+
$classroomResponse = addTeacher($service, '531365794650' ,'gduser2@workspacesamples.dev');
38+
$this->assertNotNull($classroomResponse, "Not get any value from service");
39+
40+
}
41+
42+
43+
}
44+
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
<?php
2+
/**
3+
* Copyright 2022 Google Inc.
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License");
6+
* you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*
17+
*/
18+
19+
require 'src/classroom_batchAddStudents.php';
20+
21+
class ClassroomBatchAddStudentsTest extends \PHPUnit\Framework\TestCase
22+
{
23+
protected function getService()
24+
{
25+
$client = new Google\Client();
26+
$client->useApplicationDefaultCredentials();
27+
$client->addScope("https://www.googleapis.com/auth/classroom.courses");
28+
$service = new Google_Service_Classroom($client);
29+
return $service;
30+
}
31+
32+
public function testcreateCourseAlias()
33+
34+
{
35+
36+
$service = $this->getService();
37+
$classroomResponse = batchAddStudents($service, '531365794650', ['a', 'b']);
38+
$this->assertNotNull($classroomResponse, "Not get any value from service");
39+
40+
}
41+
42+
43+
}
44+
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
<?php
2+
/**
3+
* Copyright 2022 Google Inc.
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License");
6+
* you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*
17+
*/
18+
19+
require 'src/classroom_createCourse.php';
20+
21+
class ClassroomCreateCourseTest extends \PHPUnit\Framework\TestCase
22+
{
23+
protected function getService()
24+
{
25+
$client = new Google\Client();
26+
$client->useApplicationDefaultCredentials();
27+
$client->addScope("https://www.googleapis.com/auth/classroom.courses");
28+
$service = new Google_Service_Classroom($client);
29+
return $service;
30+
}
31+
32+
public function testCreateCourse()
33+
{
34+
$classroomResponse = createCourse(getService());
35+
$this->assertNotNull($classroomResponse, "Not get any value from service");
36+
}
37+
38+
39+
}
40+
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
<?php
2+
/**
3+
* Copyright 2022 Google Inc.
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License");
6+
* you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*
17+
*/
18+
19+
require 'src/classroom_createCourseAlias.php';
20+
21+
class ClassroomCreateCoursesAliasesTest extends \PHPUnit\Framework\TestCase
22+
{
23+
protected function getService()
24+
{
25+
$client = new Google\Client();
26+
$client->useApplicationDefaultCredentials();
27+
$client->addScope("https://www.googleapis.com/auth/classroom.courses");
28+
$service = new Google_Service_Classroom($client);
29+
return $service;
30+
}
31+
32+
public function testcreateCourseAlias()
33+
34+
{
35+
36+
$service = $this->getService();
37+
$classroomResponse = createCourseAlias($service, '531365794650', 'p:bio10p4');
38+
$this->assertNotNull($classroomResponse, "Not get any value from service");
39+
40+
}
41+
42+
43+
}
44+
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
<?php
2+
/**
3+
* Copyright 2022 Google Inc.
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License");
6+
* you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*
17+
*/
18+
19+
require 'src/classroom_enrollAsStudent.php';
20+
21+
class ClassroomEnrollAsStudentTest extends \PHPUnit\Framework\TestCase
22+
{
23+
protected function getService()
24+
{
25+
$client = new Google\Client();
26+
$client->useApplicationDefaultCredentials();
27+
$client->addScope("https://www.googleapis.com/auth/classroom.courses");
28+
$service = new Google_Service_Classroom($client);
29+
return $service;
30+
}
31+
32+
public function testcreateCourseAlias()
33+
34+
{
35+
36+
$service = $this->getService();
37+
$classroomResponse = enrollAsStudent($service, '531365794650' ,'gduser1@workspacesamples.dev');
38+
$this->assertNotNull($classroomResponse, "Not get any value from service");
39+
40+
}
41+
42+
43+
}
44+
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
<?php
2+
/**
3+
* Copyright 2022 Google Inc.
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License");
6+
* you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*
17+
*/
18+
19+
require 'src/classroom_getCourse.php';
20+
21+
class ClassroomGetCourseTest extends \PHPUnit\Framework\TestCase
22+
{
23+
protected function getService()
24+
{
25+
$client = new Google\Client();
26+
$client->useApplicationDefaultCredentials();
27+
$client->addScope("https://www.googleapis.com/auth/classroom.courses");
28+
$service = new Google_Service_Classroom($client);
29+
return $service;
30+
}
31+
32+
public function testgetCourse()
33+
34+
{
35+
36+
$service = $this->getService();
37+
$classroomResponse = getCourse($service, '531365794650');
38+
$this->assertNotNull($classroomResponse, "Not get any value from service");
39+
40+
}
41+
42+
43+
}
44+
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
<?php
2+
/**
3+
* Copyright 2022 Google Inc.
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License");
6+
* you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*
17+
*/
18+
19+
require 'src/classroom_listCourses.php';
20+
21+
class ClassroomListAllCoursesTest extends \PHPUnit\Framework\TestCase
22+
{
23+
protected function getService()
24+
{
25+
$client = new Google\Client();
26+
$client->useApplicationDefaultCredentials();
27+
$client->addScope("https://www.googleapis.com/auth/classroom.courses");
28+
$service = new Google_Service_Classroom($client);
29+
return $service;
30+
}
31+
32+
public function testlistAllCourses()
33+
34+
{
35+
36+
$service = $this->getService();
37+
$classroomResponse = listCourses($service);
38+
$this->assertNotNull($classroomResponse, "Not get any value from service");
39+
40+
}
41+
42+
43+
}
44+
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
<?php
2+
/**
3+
* Copyright 2022 Google Inc.
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License");
6+
* you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*
17+
*/
18+
19+
require 'src/classroom_listCourseAliases.php';
20+
21+
class ClassroomListCourseAliasesTest extends \PHPUnit\Framework\TestCase
22+
{
23+
protected function getService()
24+
{
25+
$client = new Google\Client();
26+
$client->useApplicationDefaultCredentials();
27+
$client->addScope("https://www.googleapis.com/auth/classroom.courses");
28+
$service = new Google_Service_Classroom($client);
29+
return $service;
30+
}
31+
32+
public function testcreateCourseAlias()
33+
34+
{
35+
36+
$service = $this->getService();
37+
$classroomResponse = listCourseAliases($service);
38+
$this->assertNotNull($classroomResponse, "Not get any value from service");
39+
40+
}
41+
42+
43+
}
44+

0 commit comments

Comments
 (0)