You are here

public function EntityShareCronServiceTest::testSynchronizationAllPages in Entity Share Cron 8.2

Same name and namespace in other branches
  1. 8 tests/src/Unit/EntityShareCronServiceTest.php \Drupal\Tests\entity_share_cron\Unit\EntityShareCronServiceTest::testSynchronizationAllPages()

Tests the sync() method running through all pages.

File

tests/src/Unit/EntityShareCronServiceTest.php, line 113

Class

EntityShareCronServiceTest
@coversDefaultClass \Drupal\entity_share_cron\EntityShareCronService @group entity_share_cron

Namespace

Drupal\Tests\entity_share_cron\Unit

Code

public function testSynchronizationAllPages() {
  $this->responsePages = 3;

  // No page can be enqueued.
  $this->queue
    ->expects($this
    ->never())
    ->method('createItem');
  $info = [
    'url' => self::CHANNEL_URL,
  ];
  $imported = $this->service
    ->sync(self::REMOTE_ID, self::CHANNEL_ID, $info);
  $this
    ->assertCount(4, $imported);
  $this
    ->assertContains($this->responseData[0][0], $imported);
  $this
    ->assertContains($this->responseData[1][0], $imported);
  $this
    ->assertContains($this->responseData[2][0], $imported);
  $this
    ->assertContains($this->responseData[2][1], $imported);
}