public function testLeadsGet() { $stub = $this->getMockBuilder('Intercom\\IntercomClient')->disableOriginalConstructor()->getMock(); $stub->method('get')->willReturn('foo'); $leads = new IntercomLeads($stub); $this->assertEquals('foo', $leads->getLead("bar")); }