Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 44 additions & 0 deletions classroom/snippets/test/ClassroomAddTeacherTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<?php
/**
* Copyright 2022 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/

require 'src/classroom_addTeacher.php';

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' ,'gduser2@workspacesamples.dev');
$this->assertNotNull($classroomResponse, "Not get any value from service");

}


}

44 changes: 44 additions & 0 deletions classroom/snippets/test/ClassroomBatchAddStudentsTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<?php
/**
* Copyright 2022 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/

require 'src/classroom_batchAddStudents.php';

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");

}


}

40 changes: 40 additions & 0 deletions classroom/snippets/test/ClassroomCreateCourseTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<?php
/**
* Copyright 2022 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/

require 'src/classroom_createCourse.php';

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


}

44 changes: 44 additions & 0 deletions classroom/snippets/test/ClassroomCreateCoursesAliasesTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<?php
/**
* Copyright 2022 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/

require 'src/classroom_createCourseAlias.php';

class ClassroomCreateCoursesAliasesTest 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 = createCourseAlias($service, '531365794650', 'p:bio10p4');
$this->assertNotNull($classroomResponse, "Not get any value from service");

}


}

44 changes: 44 additions & 0 deletions classroom/snippets/test/ClassroomEnrollAsStudentTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<?php
/**
* Copyright 2022 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/

require 'src/classroom_enrollAsStudent.php';

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' ,'gduser1@workspacesamples.dev');
$this->assertNotNull($classroomResponse, "Not get any value from service");

}


}

44 changes: 44 additions & 0 deletions classroom/snippets/test/ClassroomGetCourseTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<?php
/**
* Copyright 2022 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/

require 'src/classroom_getCourse.php';

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

{

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

}


}

44 changes: 44 additions & 0 deletions classroom/snippets/test/ClassroomListAllCoursesTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<?php
/**
* Copyright 2022 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/

require 'src/classroom_listCourses.php';

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

{

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

}


}

44 changes: 44 additions & 0 deletions classroom/snippets/test/ClassroomListCourseAliasesTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<?php
/**
* Copyright 2022 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/

require 'src/classroom_listCourseAliases.php';

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

}


}

Loading