You are here

protected function LinkcheckerLinkCheckerServiceTest::createDummyLink in Link checker 8

Helper function for link creation.

1 call to LinkcheckerLinkCheckerServiceTest::createDummyLink()
LinkcheckerLinkCheckerServiceTest::testStatusHandling in tests/src/Kernel/LinkcheckerLinkCheckerServiceTest.php
Test link checker service status handling.

File

tests/src/Kernel/LinkcheckerLinkCheckerServiceTest.php, line 222

Class

LinkcheckerLinkCheckerServiceTest
Test for LinkCheckerService.

Namespace

Drupal\Tests\linkchecker\Kernel

Code

protected function createDummyLink($url) {
  $link = LinkCheckerLink::create([
    'url' => $url,
    'entity_id' => [
      'target_id' => 1,
      'target_type' => 'dummy_type',
    ],
    'entity_field' => 'dummy_field',
    'entity_langcode' => 'en',
  ]);
  $link
    ->save();
  return $link;
}