seregazhuk\PinterestBot\Api\Providers\User::profile PHP Метод

profile() публичный Метод

You can also change user avatar by passing 'profile_image'.
public profile ( array $userInfo = [] ) : boolean | array
$userInfo array If empty returns current user profile.
Результат boolean | array
    public function profile($userInfo = [])
    {
        if (empty($userInfo)) {
            return $this->execGetRequest([], UrlBuilder::RESOURCE_GET_USER_SETTINGS);
        }
        if (isset($userInfo['profile_image'])) {
            $userInfo['profile_image_url'] = $this->upload($userInfo['profile_image']);
        }
        return $this->execPostRequest($userInfo, UrlBuilder::RESOURCE_UPDATE_USER_SETTINGS);
    }

Usage Example

Пример #1
0
 /** @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));
 }
All Usage Examples Of seregazhuk\PinterestBot\Api\Providers\User::profile