/** * @expectedException Google\Cloud\Exception\GoogleException */ public function testDetectProjectIdOnGceButOhNoThereStillIsntAProjectId() { $projectId = null; $m = $this->prophesize(Metadata::class); $m->getProjectId()->willReturn($projectId)->shouldBeCalled(); $trait = new ClientTraitStubOnGce($m); $res = $trait->runDetectProjectId([]); }