Skip to content

Commit

Permalink
Merge pull request #118 from RajeshGogo/drive-v3-ut
Browse files Browse the repository at this point in the history
test: added testcase for drive-v3 snippets
  • Loading branch information
sqrrrl authored Jul 6, 2022
2 parents 04cab21 + 08cdc73 commit 9194128
Show file tree
Hide file tree
Showing 20 changed files with 509 additions and 0 deletions.
26 changes: 26 additions & 0 deletions drive/snippets/drive_v3/tests/DriveCreateDriveTest.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/DriveCreateDrive.php';
class DriveCreateDriveTest extends \PHPUnit\Framework\TestCase
{

public function testCreateDrive()
{
$drive = createDrive();
$this->assertNotNull($drive, 'ID not returned.');
}
}
26 changes: 26 additions & 0 deletions drive/snippets/drive_v3/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/DriveCreateFolder.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_v3/tests/DriveCreateShortcutTest.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/DriveCreateShortcut.php';
class DriveCreateShortcutTest extends \PHPUnit\Framework\TestCase
{

public function testCreateShortcut()
{
$drive = createShortcut();
$this->assertNotNull($drive, 'ID not returned.');
}
}
26 changes: 26 additions & 0 deletions drive/snippets/drive_v3/tests/DriveCreateTeamDriveTest.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/DriveCreateTeamDrive.php';
class DriveCreateTeamDriveTest extends \PHPUnit\Framework\TestCase
{

public function testCreateTeamDrive()
{
$drive = createTeamDrive();
$this->assertNotNull($drive, 'ID not returned.');
}
}
26 changes: 26 additions & 0 deletions drive/snippets/drive_v3/tests/DriveDownloadFileTest.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/DriveDownloadFile.php';
class DriveDownloadFileTest extends \PHPUnit\Framework\TestCase
{

public function testDownloadFile()
{
$drive = downloadFile("0BwwA4oUTeiV1UVNwOHItT0xfa2M");
$this->assertNotNull($drive, 'ID not returned.');
}
}
26 changes: 26 additions & 0 deletions drive/snippets/drive_v3/tests/DriveExportPdfTest.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/DriveExportPdf.php';
class DriveExportPdfTest extends \PHPUnit\Framework\TestCase
{

public function testExportPdf()
{
$drive = exportPdf();
$this->assertNotNull($drive, 'ID not returned.');
}
}
26 changes: 26 additions & 0 deletions drive/snippets/drive_v3/tests/DriveFetchAppDataFolderTest.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/DriveFetchAppDataFolder.php';
class DriveFetchAppDataFolderTest extends \PHPUnit\Framework\TestCase
{

public function testFetchAppDataFolder()
{
$drive = fetchAppDataFolder();
$this->assertNotNull($drive, 'ID not returned.');
}
}
26 changes: 26 additions & 0 deletions drive/snippets/drive_v3/tests/DriveFetchChangesTest.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/DriveFetchChanges.php';
class DriveFetchChangesTest extends \PHPUnit\Framework\TestCase
{

public function testFetchChanges()
{
$drive = fetchChanges("100");
$this->assertNotNull($drive, 'ID not returned.');
}
}
26 changes: 26 additions & 0 deletions drive/snippets/drive_v3/tests/DriveFetchStartPageTokenTest.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/DriveFetchStartPageToken.php';
class DriveFetchStartPageTokenTest extends \PHPUnit\Framework\TestCase
{

public function testFetchStartPageToken()
{
$drive = fetchStartPageToken();
$this->assertNotNull($drive, 'ID not returned.');
}
}
25 changes: 25 additions & 0 deletions drive/snippets/drive_v3/tests/DriveListAppDataTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?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/DriveListAppData.php';
class DriveListAppDataTest extends \PHPUnit\Framework\TestCase
{
public function testListAppData()
{
$drive = listAppData();
$this->assertNotNull($drive, 'ID not returned.');
}
}
25 changes: 25 additions & 0 deletions drive/snippets/drive_v3/tests/DriveMoveFileToFolderTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?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/DriveMoveFileToFolder.php';
class DriveMoveFileToFolderTest extends \PHPUnit\Framework\TestCase
{
public function testMoveFileToFolder()
{
$drive = moveFileToFolder('1sTWaJ_j7PkjzaBWtNc3IzovK5hQf21FbOw9yLeeLPNQ', '0BwwA4oUTeiV1TGRPeTVjaWRDY1E');
$this->assertNotNull($drive, 'ID not returned.');
}
}
25 changes: 25 additions & 0 deletions drive/snippets/drive_v3/tests/DriveRecoverDrivesTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?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/DriveRecoverDrives.php';
class DriveRecoverDrivesTest extends \PHPUnit\Framework\TestCase
{
public function testRecoverDrives()
{
$drive = recoverDrives('[email protected]');
$this->assertNotNull($drive, 'ID not returned.');
}
}
25 changes: 25 additions & 0 deletions drive/snippets/drive_v3/tests/DriveRecoverTeamDrive.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?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/DriveRecoverTeamDrives.php';
class DriveRecoverTeamDrive extends \PHPUnit\Framework\TestCase
{
public function testRecoverTeamDrives()
{
$drive = recoverTeamDrives('[email protected]');
$this->assertNotNull($drive, 'ID not returned.');
}
}
25 changes: 25 additions & 0 deletions drive/snippets/drive_v3/tests/DriveSearchFilesTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?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/DriveSearchFiles.php';
class DriveSearchFilesTest extends \PHPUnit\Framework\TestCase
{
public function testSearchFiles()
{
$drive = searchFiles();
$this->assertNotNull($drive, 'ID not returned.');
}
}
Loading

0 comments on commit 9194128

Please sign in to comment.