seregazhuk\PinterestBot\Api\Providers\Pinners::block PHP Method

block() public method

public block ( string $username ) : boolean | Response
$username string
return boolean | seregazhuk\PinterestBot\Api\Response
    public function block($username)
    {
        // Retrieve profile data to get user id
        $profile = $this->info($username);
        if (empty($profile)) {
            return false;
        }
        return $this->blockById($profile['id']);
    }

Usage Example

 /** @test */
 public function it_proxies_block_by_username_to_block_by_id()
 {
     $this->apiShouldReturnData(['id' => 1111])->apiShouldReturnSuccess()->assertTrue($this->provider->block('test'));
 }