Skip to content

Commit 62f57e7

Browse files
authored
chore: update examples for latest apiary (#2087)
1 parent e9ef4c2 commit 62f57e7

File tree

6 files changed

+22
-13
lines changed

6 files changed

+22
-13
lines changed

examples/batch.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -59,22 +59,22 @@
5959
keys will be reflected in the returned array.
6060
************************************************/
6161

62-
// NOTE: Some services use `$service->createBatch();` instead of
63-
// `new Google\Http\Batch($client);`
64-
$batch = new Google\Http\Batch($client);
62+
// NOTE: Some services use `new Google\Http\Batch($client);` instead
63+
$batch = $service->createBatch();
6564

65+
$query = 'Henry David Thoreau';
6666
$optParams = array('filter' => 'free-ebooks');
67-
$optParams['q'] = 'Henry David Thoreau';
68-
$req1 = $service->volumes->listVolumes($optParams);
67+
$req1 = $service->volumes->listVolumes($query, $optParams);
6968
$batch->add($req1, "thoreau");
70-
$optParams['q'] = 'George Bernard Shaw';
71-
$req2 = $service->volumes->listVolumes($optParams);
69+
$query = 'George Bernard Shaw';
70+
$req2 = $service->volumes->listVolumes($query, $optParams);
7271
$batch->add($req2, "shaw");
7372

7473
/************************************************
7574
Executing the batch will send all requests off
7675
at once.
7776
************************************************/
77+
7878
$results = $batch->execute();
7979
?>
8080

examples/service-account.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,11 @@
5959
We're just going to make the same call as in the
6060
simple query as an example.
6161
************************************************/
62+
$query = 'Henry David Thoreau';
6263
$optParams = array(
63-
'q' => 'Henry David Thoreau',
6464
'filter' => 'free-ebooks',
6565
);
66-
$results = $service->volumes->listVolumes($optParams);
66+
$results = $service->volumes->listVolumes($query, $optParams);
6767
?>
6868

6969
<h3>Results Of Call:</h3>

examples/simple-query.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,21 +47,21 @@
4747
(the query), and an array of named optional
4848
parameters.
4949
************************************************/
50+
$query = 'Henry David Thoreau';
5051
$optParams = array(
51-
'q' => 'Henry David Thoreau',
5252
'filter' => 'free-ebooks',
5353
);
54-
$results = $service->volumes->listVolumes($optParams);
54+
$results = $service->volumes->listVolumes($query, $optParams);
5555

5656
/************************************************
5757
This is an example of deferring a call.
5858
***********************************************/
5959
$client->setDefer(true);
60+
$query = 'Henry David Thoreau';
6061
$optParams = array(
61-
'q' => 'Henry David Thoreau',
6262
'filter' => 'free-ebooks',
6363
);
64-
$request = $service->volumes->listVolumes($optParams);
64+
$request = $service->volumes->listVolumes($query, $optParams);
6565
$resultsDeferred = $client->execute($request);
6666

6767
/************************************************

tests/examples/largeFileDownloadTest.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@
2020

2121
class examples_largeFileDownloadTest extends BaseTest
2222
{
23+
/**
24+
* @runInSeparateProcess
25+
*/
2326
public function testSimpleFileDownloadNoToken()
2427
{
2528
$this->checkServiceAccountCredentials();

tests/examples/largeFileUploadTest.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@
2121

2222
class examples_largeFileUploadTest extends BaseTest
2323
{
24+
/**
25+
* @runInSeparateProcess
26+
*/
2427
public function testLargeFileUpload()
2528
{
2629
$this->checkServiceAccountCredentials();

tests/examples/simpleFileUploadTest.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@
2121

2222
class examples_simpleFileUploadTest extends BaseTest
2323
{
24+
/**
25+
* @runInSeparateProcess
26+
*/
2427
public function testSimpleFileUploadNoToken()
2528
{
2629
$this->checkServiceAccountCredentials();

0 commit comments

Comments
 (0)