You are here

public function InstallTest::testKeys in farmOS 2.x

Tests keys were created.

File

modules/core/api/tests/src/Functional/InstallTest.php, line 31

Class

InstallTest
Tests hook_install functionality of farm_api module.

Namespace

Drupal\Tests\farm_api\Functional

Code

public function testKeys() {

  // Key directory.
  $dir_name = 'keys';

  // Save keys in the "keys" directory outside of the webroot.
  $relative_path = DRUPAL_ROOT . '/../' . $dir_name;
  $this
    ->assertDirectoryExists($relative_path);
  $pub_filename = sprintf('%s/public.key', $relative_path);
  $pri_filename = sprintf('%s/private.key', $relative_path);
  $this
    ->assertFileExists($pub_filename);
  $this
    ->assertFileExists($pri_filename);
}