Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

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: 9 additions & 8 deletions tests/Google/Http/BatchTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,11 @@ public function testBatchRequestWithAuth()

public function testBatchRequest()
{
$this->checkKey();
$client = $this->getClient();
$batch = new Google_Http_Batch($client);
$plus = new Google_Service_Plus($client);
$batch = $plus->createBatch();

$client->setUseBatch(true);
$batch->add($plus->people->get('+LarryPage'), 'key1');
$batch->add($plus->people->get('+LarryPage'), 'key2');
$batch->add($plus->people->get('+LarryPage'), 'key3');
Expand All @@ -61,11 +61,11 @@ public function testBatchRequest()

public function testBatchRequestWithBooksApi()
{
$this->checkKey();
$client = $this->getClient();
$batch = new Google_Http_Batch($client);
$plus = new Google_Service_Plus($client);
$batch = $plus->createBatch();

$client->setUseBatch(true);
$batch->add($plus->people->get('+LarryPage'), 'key1');
$batch->add($plus->people->get('+LarryPage'), 'key2');
$batch->add($plus->people->get('+LarryPage'), 'key3');
Expand All @@ -81,16 +81,16 @@ public function testBatchRequestWithPostBody()
$this->checkToken();

$client = $this->getClient();
$batch = new Google_Http_Batch($client);
$shortener = new Google_Service_Urlshortener($client);
$batch = $shortener->createBatch();

$url1 = new Google_Service_Urlshortener_Url;
$url2 = new Google_Service_Urlshortener_Url;
$url3 = new Google_Service_Urlshortener_Url;
$url1->setLongUrl('http://brentertainment.com');
$url2->setLongUrl('http://morehazards.com');
$url3->setLongUrl('http://github.com/bshaffer');

$client->setUseBatch(true);
$batch->add($shortener->url->insert($url1), 'key1');
$batch->add($shortener->url->insert($url2), 'key2');
$batch->add($shortener->url->insert($url3), 'key3');
Expand All @@ -103,11 +103,12 @@ public function testBatchRequestWithPostBody()

public function testInvalidBatchRequest()
{
$this->checkKey();
$client = $this->getClient();
$batch = new Google_Http_Batch($client);
$plus = new Google_Service_Plus($client);

$client->setUseBatch(true);
$batch = $plus->createBatch();

$batch->add($plus->people->get('123456789987654321'), 'key1');
$batch->add($plus->people->get('+LarryPage'), 'key2');

Expand Down