Tripal
Loading...
Searching...
No Matches
Public Attributes | Protected Member Functions | Static Protected Attributes | List of all members
Drupal\Tests\tripal_chado\Kernel\ChadoTestKernelBase Class Reference
Inheritance diagram for Drupal\Tests\tripal_chado\Kernel\ChadoTestKernelBase:
Inheritance graph
[legend]
Collaboration diagram for Drupal\Tests\tripal_chado\Kernel\ChadoTestKernelBase:
Collaboration graph
[legend]

Public Attributes

const SCHEMA_NAME_ONLY = 0
 
const CREATE_SCHEMA = 1
 
const INIT_DUMMY = 2
 
const INIT_CHADO_EMPTY = 3
 
const INIT_CHADO_DUMMY = 4
 
const PREPARE_TEST_CHADO = 5
 

Protected Member Functions

 setUp ()
 
 prepareEnvironment (array $functionality)
 

Static Protected Attributes

static $modules = ['tripal', 'tripal_biodb', 'tripal_chado']
 
- Static Protected Attributes inherited from Drupal\Tests\tripal\Kernel\TripalTestKernelBase
static $modules = ['tripal']
 

Additional Inherited Members

- Protected Attributes inherited from Drupal\Tests\tripal\Kernel\TripalTestKernelBase
 $messenger = NULL
 
 $logger = NULL
 
 $fileretriever = NULL
 
 $publish_manager = NULL
 

Detailed Description

This is a base class for Chado tests.

It enables Chado tests schemas and helper functions to efficiently perform tests.

Example:

// Gets a Chado test schema with dummy data:
$biodb = $this->getTestSchema(ChadoTestKernelBase::INIT_CHADO_DUMMY);
//... do some tests
// After all is done, remove the schema properly:
$this->freeTestSchema($biodb);
// Note: if a test fails, the tearDownAfterClass will remove unremoved
// schemas.

@group Tripal @group Tripal Chado

Member Function Documentation

◆ prepareEnvironment()

Drupal\Tests\tripal_chado\Kernel\ChadoTestKernelBase::prepareEnvironment ( array  $functionality)
protected

Prepare kernel environments to support specific functionality.

This method is foccused on making it easier to write kernel test for Tripal functionality. Simply pass in the parts of Tripal core you need in your tests and this method will handle any dependencies to install all the needed schema + config associated with that functionality. Additionally it will try to warn you if your modules array is missing entries with a more user friendly failure then the typical one provided by Drupal.

Parameters
array$functionalityA list of functionality you need to support. Although this method handles dependencies, you should include all items in the supported keys below that you need. This is because in some cases you will want to mock rather then include in your kernel tests and this way, this method supports that. Supported keys are:
  • TripalTerm
  • TripalEntity
  • TripalField
Returns
void

Reimplemented from Drupal\Tests\tripal\Kernel\TripalTestKernelBase.

◆ setUp()

Drupal\Tests\tripal_chado\Kernel\ChadoTestKernelBase::setUp ( )
protected

{{}}

Reimplemented from Drupal\Tests\tripal\Kernel\TripalTestKernelBase.

Reimplemented in Drupal\Tests\tripal_chado\Kernel\ChadoAutocompleteControllerTest, Drupal\Tests\tripal_chado\Kernel\ChadoOrganismFormElementControllerTest, Drupal\Tests\tripal_chado\Kernel\Entity\TripalEntityChadoFieldTest, Drupal\Tests\tripal_chado\Kernel\Plugin\ChadoBuddy\ChadoBuddyBaseTest, Drupal\Tests\tripal_chado\Kernel\Plugin\ChadoBuddy\ChadoCvtermBuddyTest, Drupal\Tests\tripal_chado\Kernel\Plugin\ChadoBuddy\ChadoDbxrefBuddyTest, Drupal\Tests\tripal_chado\Kernel\Plugin\ChadoBuddy\ChadoPropertyBuddyTest, Drupal\Tests\tripal_chado\Kernel\ChadoField\FieldType\ChadoPropertyTypeCRUDTest, Drupal\Tests\tripal_chado\Kernel\ChadoField\FieldType\ChadoPropertyWidgetFormTest, Drupal\Tests\tripal_chado\Kernel\Plugin\ChadoStorage\ChadoAnalysisDefaultTest, Drupal\Tests\tripal_chado\Kernel\Plugin\ChadoStorage\ChadoContactDefaultTest, Drupal\Tests\tripal_chado\Kernel\Plugin\ChadoStorage\ChadoLinkerPropertyDefaultTest, Drupal\Tests\tripal_chado\Kernel\Plugin\ChadoStorage\ChadoStorageActions_ReadValueTest, Drupal\Tests\tripal_chado\Kernel\Plugin\ChadoStorage\ChadoStorageActions_StoreIdTest, Drupal\Tests\tripal_chado\Kernel\Plugin\ChadoStorage\ChadoStorageActions_StoreLinkTest, Drupal\Tests\tripal_chado\Kernel\Plugin\ChadoStorage\ChadoStorageActions_StorePkeyTest, Drupal\Tests\tripal_chado\Kernel\Plugin\ChadoStorage\ChadoStorageActions_StoreTest, Drupal\Tests\tripal_chado\Kernel\Plugin\ChadoStorage\ChadoStorageDeleteValuesTest, Drupal\Tests\tripal_chado\Kernel\Plugin\ChadoStorage\ChadoStorageFindValuesTest, Drupal\Tests\tripal_chado\Kernel\Plugin\ChadoStorage\ChadoStorageLinkerFieldTest, Drupal\Tests\tripal\Kernel\ChadoPublishTest, Drupal\Tests\tripal_chado\Kernel\Plugin\TripalImporter\ChadoImporterBaseTest, Drupal\Tests\tripal_chado\Kernel\Plugin\TripalImporter\ChadoImporterTransactionTest, Drupal\Tests\tripal_chado\Kernel\Plugin\TripalImporter\ImporterFormTest, Drupal\Tests\tripal_chado\Functional\OboImporterTest, Drupal\Tests\tripal_chado\Kernel\Plugin\TripalVocabTerms\ChadoVocabTermsTest, Drupal\Tests\tripal\Kernel\SyncTripalFieldStorageTest, Drupal\Tests\tripal\Kernel\TripalEntityLookupServiceTest, Drupal\Tests\tripal\Kernel\TripalDBX\ChadoConnectionInheritedTest, Drupal\Tests\tripal\Kernel\TripalDBX\ChadoConnectionTest, and Drupal\Tests\tripal\Kernel\TripalDBX\ChadoSchemaTest.

Member Data Documentation

◆ CREATE_SCHEMA

const Drupal\Tests\tripal_chado\Kernel\ChadoTestKernelBase::CREATE_SCHEMA = 1

Create an empty schema.

◆ INIT_CHADO_DUMMY

const Drupal\Tests\tripal_chado\Kernel\ChadoTestKernelBase::INIT_CHADO_DUMMY = 4

Create a Chado schema and initialize it with dummy data.

◆ INIT_CHADO_EMPTY

const Drupal\Tests\tripal_chado\Kernel\ChadoTestKernelBase::INIT_CHADO_EMPTY = 3

Create a Chado schema with default data.

◆ INIT_DUMMY

const Drupal\Tests\tripal_chado\Kernel\ChadoTestKernelBase::INIT_DUMMY = 2

Create a schema and initialize it with dummy data.

◆ PREPARE_TEST_CHADO

const Drupal\Tests\tripal_chado\Kernel\ChadoTestKernelBase::PREPARE_TEST_CHADO = 5

Create a Chado schema and prepare both it and the associated drupal schema.

◆ SCHEMA_NAME_ONLY

const Drupal\Tests\tripal_chado\Kernel\ChadoTestKernelBase::SCHEMA_NAME_ONLY = 0

{} Just get a free test schema name.


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