Skip to content

Commit

Permalink
test: added testcase for drive-v2 snippets
Browse files Browse the repository at this point in the history
  • Loading branch information
sanjuktaghosh7 committed Jun 29, 2022
1 parent 741cf62 commit 22def45
Show file tree
Hide file tree
Showing 16 changed files with 416 additions and 0 deletions.
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/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-v2/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-v2/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("1lRyjms4EQNgJyS_zAhhG5QzsiqNhfZtX");
$this->assertNotNull($drive, 'ID not returned.');
}
}
26 changes: 26 additions & 0 deletions drive/snippets/drive-v2/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("1mTHXTQaHMbo8gYnTIF6Mih1kPLtFEJXf");
$this->assertNotNull($drive, 'Content not returned.');
}
}
26 changes: 26 additions & 0 deletions drive/snippets/drive-v2/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-v2/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-v2/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 DriveFetchStartPageToken extends \PHPUnit\Framework\TestCase
{

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

public function testListAppData()
{
$drive = listAppData();
$this->assertNotEquals(0, count($drive));
}
}
26 changes: 26 additions & 0 deletions drive/snippets/drive-v2/tests/DriveMoveFileToFolderTest.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/DriveMoveFileToFolder.php';
class DriveMoveFileToFolderTest extends \PHPUnit\Framework\TestCase
{

public function testMoveFileToFolder()
{
$drive = moveFileToFolder("1sTWaJ_j7PkjzaBWtNc3IzovK5hQf21FbOw9yLeeLPNQ", "0BwwA4oUTeiV1TGRPeTVjaWRDY1E");
$this->assertNotEquals(0, count($drive));
}
}
26 changes: 26 additions & 0 deletions drive/snippets/drive-v2/tests/DriveSearchFilesTest.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/DriveSearchFiles.php';
class DriveSearchFilesTest extends \PHPUnit\Framework\TestCase
{

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

public function testShareFile()
{
$drive = shareFile("145JJfzbyoAp7uvSjPwJ8ll0CNdpOiErA","[email protected]","gmail.com");
$this->assertNotNull($drive, 'ID not returned.');
}
}
26 changes: 26 additions & 0 deletions drive/snippets/drive-v2/tests/DriveTouchFileTest.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/DriveTouchFile.php';
class DriveTouchFileTest extends \PHPUnit\Framework\TestCase
{

public function testTouchFile()
{
$drive = touchFile("1sTWaJ_j7PkjzaBWtNc3IzovK5hQf21FbOw9yLeeLPNQ","2022-7-8");
$this->assertNotNull($drive, 'ID not returned.');
}
}
26 changes: 26 additions & 0 deletions drive/snippets/drive-v2/tests/DriveUploadAppdataTest.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/DriveUploadAppdata.php';
class DriveUploadAppdataTest extends \PHPUnit\Framework\TestCase
{

public function testUploadAppData()
{
$id = uploadAppData();
$this->assertNotNull($id, '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/DriveUploadBasic.php';
class DriveUploadBasicTest extends \PHPUnit\Framework\TestCase
{

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

0 comments on commit 22def45

Please sign in to comment.