/** * @expectedException \MyBuilder\Library\WhenIWork\Exception\WhenIWorkApiException */ public function test_setup_and_exception_from_guzzle_client() { $this->guzzleClientShouldSetupToken(); $this->guzzleClient->shouldReceive('get')->with(WhenIWorkApi::WHEN_I_WORK_ENDPOINT . '/users', array('headers' => array('W-Token' => self::TOKEN)))->once()->andThrow(new BadResponseException('', new Request('GET', 'foo'))); $this->whenIWorkApi->usersListingUsers(); }
public function test_it_delegate_find_all_to_api() { $this->whenIWorkApi->shouldReceive('usersListingUsers')->once(); $this->serializer->shouldReceive('deserialize')->once(); $this->userRepository->findAll(); }