seregazhuk\PinterestBot\Api\Providers\Comments::create PHP Method

create() public method

Write a comment for a pin with current id.
public create ( integer $pinId, string $text ) : array | boolean
$pinId integer
$text string Comment
return array | boolean
    public function create($pinId, $text)
    {
        $requestOptions = ['pin_id' => $pinId, 'text' => $text];
        return $this->execPostRequest($requestOptions, UrlBuilder::RESOURCE_COMMENT_PIN);
    }

Usage Example

 /** @test */
 public function it_should_create_comments_for_pin()
 {
     $this->apiShouldReturnSuccess()->assertNotEmpty($this->provider->create(1111, 'comment text'));
     $this->apiShouldReturnError()->assertFalse($this->provider->create(1111, 'comment text'));
 }