diff --git a/tests/Google/Http/BatchTest.php b/tests/Google/Http/BatchTest.php index 8445a21ea..ed3f25f63 100644 --- a/tests/Google/Http/BatchTest.php +++ b/tests/Google/Http/BatchTest.php @@ -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'); @@ -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'); @@ -81,8 +81,9 @@ 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; @@ -90,7 +91,6 @@ public function testBatchRequestWithPostBody() $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'); @@ -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');