/** * @expectedException Google\Cloud\Exception\GoogleException */ public function testDetectProjectIdWithNoProjectIdAvailable() { $keyFilePath = __DIR__ . '/fixtures/json-key-fixture.json'; $keyFile = json_decode(file_get_contents($keyFilePath), true); unset($keyFile['project_id']); $trait = new ClientTraitStub(); $conf = $trait->runDetectProjectId(['keyFile' => $keyFile, 'httpHandler' => function ($request, $options = []) { return new Response(500); }]); }