Inheritance: extends Provider, use trait seregazhuk\PinterestBot\Helpers\Providers\Traits\SearchTrait, use trait seregazhuk\PinterestBot\Helpers\Providers\Traits\FollowTrait, use trait seregazhuk\PinterestBot\Helpers\Providers\Traits\FollowersTrait
Esempio n. 1
0
 public function testGetPins()
 {
     $response = $this->createPaginatedResponse();
     $this->mock->expects($this->at(0))->method('exec')->willReturn($response);
     $this->mock->expects($this->at(1))->method('exec')->willReturn(['resource_response' => ['data' => []]]);
     $this->mock->expects($this->at(2))->method('exec')->willReturn(['resource_response' => ['data' => [['type' => 'module']]]]);
     $pins = $this->provider->pins(1);
     $this->assertCount(2, iterator_to_array($pins)[0]);
     $pins = $this->provider->pins(0);
     $this->assertEmpty(iterator_to_array($pins));
 }
Esempio n. 2
0
 /** @test */
 public function createBoard()
 {
     $response = $this->createSuccessApiResponse();
     $error = $this->createErrorApiResponse();
     $this->mock->shouldReceive('exec')->once()->andReturn($response);
     $this->mock->shouldReceive('exec')->once()->andReturn($error);
     $this->assertTrue($this->provider->create('test', 'test'));
     $this->assertFalse($this->provider->delete('test', 'test'));
 }
 /** @test */
 public function it_should_return_title_suggestions_for_pin()
 {
     $suggestions = ['Board1', 'Board2'];
     $this->apiShouldReturnData($suggestions)->assertEquals($suggestions, $this->provider->titleSuggestionsFor(12345));
     $this->apiShouldReturnError()->assertFalse($this->provider->titleSuggestionsFor(12345));
 }