You are here

protected function Fix404RedirectCronJobTest::insert404Row in Redirect 8

Inserts a 404 request log in the redirect_404 test table.

Parameters

string $path: The path of the request.

int $count: (optional) The visits count of the request.

int $daily_count: (optional) The visits count of the request for a day.

int $timestamp: (optional) The timestamp of the last visited request.

string $langcode: (optional) The langcode of the request.

2 calls to Fix404RedirectCronJobTest::insert404Row()
Fix404RedirectCronJobTest::setUp in modules/redirect_404/tests/src/Kernel/Fix404RedirectCronJobTest.php
Fix404RedirectCronJobTest::testRedirect404CronJobDailyCountReset in modules/redirect_404/tests/src/Kernel/Fix404RedirectCronJobTest.php
Tests resetting the daily counts in the redirect_404 table.

File

modules/redirect_404/tests/src/Kernel/Fix404RedirectCronJobTest.php, line 160

Class

Fix404RedirectCronJobTest
Tests the clean up cron job for redirect_404.

Namespace

Drupal\Tests\redirect_404\Kernel

Code

protected function insert404Row($path, $count = 1, $daily_count = 0, $timestamp = 0, $langcode = 'en') {
  \Drupal::database()
    ->insert('redirect_404')
    ->fields([
    'path' => $path,
    'langcode' => $langcode,
    'count' => $count,
    'daily_count' => $daily_count,
    'timestamp' => $timestamp,
    'resolved' => 0,
  ])
    ->execute();
}