protected function LinkcheckerCleanUpTest::createDummyLink in Link checker 8
Helper function for link creation.
2 calls to LinkcheckerCleanUpTest::createDummyLink()
- LinkcheckerCleanUpTest::testEntityCleanup in tests/
src/ Kernel/ LinkcheckerCleanUpTest.php - @covers ::cleanUpForEntity
- LinkcheckerCleanUpTest::testRemoveAllBatch in tests/
src/ Kernel/ LinkcheckerCleanUpTest.php - @covers ::removeAllBatch
File
- tests/
src/ Kernel/ LinkcheckerCleanUpTest.php, line 140
Class
- LinkcheckerCleanUpTest
- Test for linkchecker.clean_up service.
Namespace
Drupal\Tests\linkchecker\KernelCode
protected function createDummyLink($url) {
/** @var \Drupal\linkchecker\Entity\LinkCheckerLink $link */
$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;
}