Tripal
Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members
Drupal\Tests\tripal\Functional\TripalTestBrowserBase Class Reference
Inheritance diagram for Drupal\Tests\tripal\Functional\TripalTestBrowserBase:
Inheritance graph
[legend]
Collaboration diagram for Drupal\Tests\tripal\Functional\TripalTestBrowserBase:
Collaboration graph
[legend]

Public Member Functions

 createTripalTerm ($values, $idspace_plugin_id, $vocab_plugin_id)
 
 createTripalContent ($values=[])
 
 createTripalContentType ($values=[])
 

Protected Member Functions

 setUp ()
 

Protected Attributes

 $defaultTheme = 'stark'
 

Static Protected Attributes

static $modules = ['tripal']
 

Detailed Description

This is a base class for Tripal tests that need a full Drupal install.

It provides helper methods to create various Tripal-focused objects during testing like Tripal content types, Tripal Content, and Tripal Terms.

@group Tripal

Member Function Documentation

◆ createTripalContent()

Drupal\Tests\tripal\Functional\TripalTestBrowserBase::createTripalContent (   $values = [])

Creates a Tripal Entity (i.e. a piece of Tripal content) for testing purposes.

Currently this function creates a real TripalEntity and saves it. Because this is a testing environment, this does get saved in the Drupal prefixed test tables and dropped after the fact.

We went this route intially for maximum code coverage in order to catch all deprication notices posed by Drupal. We may want to replace this approach at a later date.

Parameters
array$valuesThese values are passed directly to the create() method. Suggested values are:
  • title (string)
  • type (string; eg. organism)
  • user_id (integer)
  • status (boolean; TRUE if published)

◆ createTripalContentType()

Drupal\Tests\tripal\Functional\TripalTestBrowserBase::createTripalContentType (   $values = [])

Creates a Tripal Entity Type object for testing purposes.

Currently this function creates a real TripalEntityType and saves it. Because this is a testing environment, this does get saved in the Drupal prefixed test tables and dropped after the fact.

We went this route intially for maximum code coverage in order to catch all deprication notices posed by Drupal. We may want to replace this approach at a later date.

Parameters
array$valuesThese values are passed directly to the create() method. Suggested values are:
  • id (string)
  • label (label; string)
  • termIdSpace (string)
  • termAccession (string)
  • help_text (text)
  • category (string)
  • title_format (string)
  • url_format (string)
  • hide_empty_field (boolean)
  • ajax_field (boolean)

◆ createTripalTerm()

Drupal\Tests\tripal\Functional\TripalTestBrowserBase::createTripalTerm (   $values,
  $idspace_plugin_id,
  $vocab_plugin_id 
)

Creates a Tripal Vocabulary / ID Space / Term for testing purposes.

Parameters
array$valuesThese values are passed directly to the create() method. Suggested values are:
  • vocab_name (string)
  • id_space_name (string)
  • term (array)
    • name (string)
    • definition (string)
    • accession (string)

◆ setUp()

Drupal\Tests\tripal\Functional\TripalTestBrowserBase::setUp ( )
protected

Member Data Documentation

◆ $defaultTheme

Drupal\Tests\tripal\Functional\TripalTestBrowserBase::$defaultTheme = 'stark'
protected

{}

◆ $modules

Drupal\Tests\tripal\Functional\TripalTestBrowserBase::$modules = ['tripal']
staticprotected

{}


The documentation for this class was generated from the following file: