You are here

public function Framework::endToEndTests in Realistic Dummy Content 8.2

Same name and namespace in other branches
  1. 7.2 api/src/Framework/Framework.php \Drupal\realistic_dummy_content_api\Framework\Framework::endToEndTests()
  2. 3.x api/src/Framework/Framework.php \Drupal\realistic_dummy_content_api\Framework\Framework::endToEndTests()

Run high-level tests.

For example, create entities, make sure they have been improved with realistic dummy content.

Parameters

array $errors: Will be populated with error strings.

array $tests: Will be populated with passing test strings.

1 call to Framework::endToEndTests()
Framework::selfTest in api/src/Framework/Framework.php
Tests all functions in the class.

File

api/src/Framework/Framework.php, line 337

Class

Framework
The entry point for the framework.

Namespace

Drupal\realistic_dummy_content_api\Framework

Code

public function endToEndTests(&$errors, &$tests) {
  $generator = new RealisticDummyContentDevelGenerateGenerator('user', 'user', 1, array(
    'kill' => TRUE,
  ));
  $generator
    ->generate();
  $user = user_load(Framework::instance()
    ->latestId('users', 'uid'));
  if (strpos(Framework::instance()
    ->userPictureFilename($user), 'dummyfile') !== FALSE) {
    $tests[] = 'User picture substitution OK, and aliases work correctly.';
  }
  else {
    $errors[] = 'User picture substitution does not work.';
  }
  $generator = new RealisticDummyContentDevelGenerateGenerator('node', 'article', 1, array(
    'kill' => TRUE,
  ));
  $generator
    ->generate();
}