/** @test */ public function editProfile() { $response = $this->createSuccessApiResponse(); $error = $this->createErrorApiResponse(); $this->mock->shouldReceive('exec')->once()->andReturn($response); $this->mock->shouldReceive('exec')->once()->andReturn($error); $params = ['name' => 'name']; $this->assertTrue($this->provider->profile($params)); $this->assertFalse($this->provider->profile($params)); }
/** @test */ public function it_should_upload_image_when_editing_profile_with_local_image() { $attributes = ['name' => 'John Doe', 'profile_image' => 'my_profile_image.jpg']; $this->request->shouldReceive('upload')->withArgs([$attributes['profile_image'], UrlBuilder::IMAGE_UPLOAD])->andReturn(json_encode(['success' => true, 'image_url' => 'http://example.com/example.jpg'])); $this->apiShouldReturnSuccess()->assertTrue($this->provider->profile($attributes)); }