From c403e5e82c183b6ed5afd4a1e903346fec768bf5 Mon Sep 17 00:00:00 2001 From: John Pedrie Date: Thu, 23 Jul 2020 10:52:12 -0400 Subject: [PATCH 1/3] test: fix batch tests --- tests/Google/Http/BatchTest.php | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/tests/Google/Http/BatchTest.php b/tests/Google/Http/BatchTest.php index 8445a21ea..588197060 100644 --- a/tests/Google/Http/BatchTest.php +++ b/tests/Google/Http/BatchTest.php @@ -45,10 +45,9 @@ public function testBatchRequestWithAuth() public function testBatchRequest() { $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'); @@ -62,10 +61,9 @@ public function testBatchRequest() public function testBatchRequestWithBooksApi() { $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 +79,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 +89,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'); @@ -104,10 +102,10 @@ public function testBatchRequestWithPostBody() public function testInvalidBatchRequest() { $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'); From f5d6ce708cf89073376a02d7c6345ac86a62b613 Mon Sep 17 00:00:00 2001 From: John Pedrie Date: Thu, 23 Jul 2020 13:30:20 -0400 Subject: [PATCH 2/3] trigger tests From 4eadb91b78fdd8782280013b0e35fdff35f09aa2 Mon Sep 17 00:00:00 2001 From: John Pedrie Date: Thu, 23 Jul 2020 13:53:16 -0400 Subject: [PATCH 3/3] authenticate tests --- tests/Google/Http/BatchTest.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/Google/Http/BatchTest.php b/tests/Google/Http/BatchTest.php index 588197060..ed3f25f63 100644 --- a/tests/Google/Http/BatchTest.php +++ b/tests/Google/Http/BatchTest.php @@ -44,6 +44,7 @@ public function testBatchRequestWithAuth() public function testBatchRequest() { + $this->checkKey(); $client = $this->getClient(); $plus = new Google_Service_Plus($client); $batch = $plus->createBatch(); @@ -60,6 +61,7 @@ public function testBatchRequest() public function testBatchRequestWithBooksApi() { + $this->checkKey(); $client = $this->getClient(); $plus = new Google_Service_Plus($client); $batch = $plus->createBatch(); @@ -101,6 +103,7 @@ public function testBatchRequestWithPostBody() public function testInvalidBatchRequest() { + $this->checkKey(); $client = $this->getClient(); $plus = new Google_Service_Plus($client);