You are here

abstract class RecipeWebTestBase in Recipe 7.2

Same name and namespace in other branches
  1. 7 src/Tests/RecipeWebTestBase.php \Drupal\recipe\Tests\RecipeWebTestBase

Provides a base class for testing the functionality of the Recipe module.

Hierarchy

  • class \Drupal\recipe\Tests\RecipeWebTestBase extends \Drupal\recipe\Tests\DrupalWebTestCase

Expanded class hierarchy of RecipeWebTestBase

File

src/Tests/RecipeWebTestBase.php, line 8

Namespace

Drupal\recipe\Tests
View source
abstract class RecipeWebTestBase extends \DrupalWebTestCase {

  /**
   * A user with administrative privileges.
   *
   * @var \stdClass
   */
  protected $adminUser;

  /**
   * A multidimentional array containing Recipe's ingredient units.
   *
   * @var array
   */
  protected $unitList;

  /**
   * {@inheritdoc}
   */
  public function setUp() {

    // Enable modules required for testing.
    parent::setUp(array(
      'recipe',
      'recipe_plaintext',
      'recipe_html',
      'recipe_recipeML',
      'recipe_mastercook4',
      'recipe_test',
    ));

    // Create and log in the admin user with Recipe content permissions.
    $this->adminUser = $this
      ->drupalCreateUser(array(
      'create recipe content',
      'edit any recipe content',
      'import recipes',
      'export recipes',
      'administer site configuration',
      'administer blocks',
    ));
    $this
      ->drupalLogin($this->adminUser);

    // Populate the unit list.
    $this->unitList = recipe_get_units();
  }

}

Members

Namesort descending Modifiers Type Description Overrides
RecipeWebTestBase::$adminUser protected property A user with administrative privileges.
RecipeWebTestBase::$unitList protected property A multidimentional array containing Recipe's ingredient units.
RecipeWebTestBase::setUp public function 1