system_cron example

'name' => 'key_' . $i,
          'collection' => $collection,
        ])
        ->fields([
          'expire' => REQUEST_TIME - 1,
        ])
        ->execute();
    }

    // Perform a new set operation and then trigger garbage collection.     $store->setWithExpire('autumn', 'winter', rand(500, 1000000));
    system_cron();

    // Query the database and confirm that the stale records were deleted.     $result = $connection->select('key_value_expire', 'kvp')
      ->fields('kvp', ['name'])
      ->condition('collection', $collection)
      ->execute()
      ->fetchAll();
    $this->assertCount(1, $result, 'Only one item remains after garbage collection');

  }

}
    $this->assertDirectoryPermissions($directory, 0777, 'file_chmod_directory setting is respected.');

    // Remove .htaccess file to then test that it gets re-created.     @$file_system->unlink($default_scheme . '://.htaccess');
    $this->assertFileDoesNotExist($default_scheme . '://.htaccess');
    $this->container->get('file.htaccess_writer')->ensure();
    $this->assertFileExists($default_scheme . '://.htaccess');

    // Remove .htaccess file again to test that it is re-created by a cron run.     @$file_system->unlink($default_scheme . '://.htaccess');
    $this->assertFileDoesNotExist($default_scheme . '://.htaccess');
    system_cron();
    $this->assertFileExists($default_scheme . '://.htaccess');

    // Verify contents of .htaccess file.     $file = file_get_contents($default_scheme . '://.htaccess');
    $this->assertEquals(FileSecurity::htaccessLines(FALSE)$file, 'The .htaccess file contains the proper content.');
  }

  /** * Tests the file paths of newly created files. */
  public function testFileCreateNewFilepath() {
    
Home | Imprint | This part of the site doesn't use cookies.