You are here

public function LinkcheckerCleanUpTest::testRemoveAllBatch in Link checker 8

@covers ::removeAllBatch

File

tests/src/Kernel/LinkcheckerCleanUpTest.php, line 118

Class

LinkcheckerCleanUpTest
Test for linkchecker.clean_up service.

Namespace

Drupal\Tests\linkchecker\Kernel

Code

public function testRemoveAllBatch() {
  $urls = [
    'https://existing.com',
    'https://not-existing.com',
    'https://example.com/existing',
  ];
  foreach ($urls as $url) {
    $this
      ->createDummyLink($url);
  }
  $this
    ->assertCount(3, $this->linkCheckerLinkStorage
    ->loadMultiple(NULL));
  $this->linkCleanUp
    ->removeAllBatch();
  $this
    ->runBatch();
  $this
    ->assertEmpty($this->linkCheckerLinkStorage
    ->loadMultiple($this->linkCheckerLinkStorage
    ->loadMultiple(NULL)));
}