Skip to content
Closed
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
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' ,'gduser2@workspacesamples.dev');
$classroomResponse = addTeacher('531365794650','gduser2@workspacesamples.dev');
$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' ,'gduser1@workspacesamples.dev');
$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
26 changes: 26 additions & 0 deletions drive/snippets/drive-v2/tests/DriveCreateFolderTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?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/drive_create_folder.php';
class DriveCreateFolderTest extends \PHPUnit\Framework\TestCase
{

public function testCreateFolder()
{
$drive = createFolder();
$this->assertNotNull($drive, 'ID not returned.');
}
}
26 changes: 26 additions & 0 deletions drive/snippets/drive-v2/tests/DriveUploadBasicTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?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/ drive_upload_basic.php';
class DriveUploadBasicTest extends \PHPUnit\Framework\TestCase
{

public function testUploadBasic()
{
$drive = uploadBasic();
$this->assertNotNull($drive, 'ID not returned.');
}
}