Tripal
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
Drupal\Tests\tripal_chado\Kernel\Plugin\ChadoStorage\ChadoStorageLinkerFieldTest Class Reference
Inheritance diagram for Drupal\Tests\tripal_chado\Kernel\Plugin\ChadoStorage\ChadoStorageLinkerFieldTest:
Inheritance graph
[legend]
Collaboration diagram for Drupal\Tests\tripal_chado\Kernel\Plugin\ChadoStorage\ChadoStorageLinkerFieldTest:
Collaboration graph
[legend]

Public Member Functions

 provideTestCases ()
 
 testLinkerTableField ($linker_field_name, $linker_table_name, $right_table_id, $extra_values)
 

Protected Member Functions

 setUp ()
 

Protected Attributes

 $fields = []
 
 $yaml_file = __DIR__ . "/ChadoStorageLinkerFields-FieldDefinitions.yml"
 
int $organism_id
 
int $cvterm_id
 
array $right_id
 

Additional Inherited Members

- Public Attributes inherited from Drupal\Tests\tripal_chado\Kernel\ChadoTestKernelBase
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
 
- Static Protected Attributes inherited from Drupal\Tests\tripal_chado\Kernel\ChadoTestKernelBase
static $modules = ['tripal', 'tripal_biodb', 'tripal_chado']
 

Detailed Description

Tests that ChadoStorage can handle fields for linker tables as we expect. The array of fields/properties used for these tests are designed to match those for a variety of linker tables as examples since the fields are note yet developed. These are the specific cases tested:

Note: testotherfeaturefield is added to ensure we meet the unique constraint on the base table and also to ensure we are testing multi-field functionality.

Note: We do not need to test invalid conditions for createValues() and updateValues() as these are only called after the entity has validated the system using validateValues(). Instead we test all invalid conditions are caught by validateValues().

Specific test cases Test the following for both single and multiple property fields:

@group Tripal @group Tripal Chado @group ChadoStorage @group ChadoStorage Fields

Member Function Documentation

◆ provideTestCases()

Drupal\Tests\tripal_chado\Kernel\Plugin\ChadoStorage\ChadoStorageLinkerFieldTest::provideTestCases ( )

Data Provider: define each test case.

◆ setUp()

Drupal\Tests\tripal_chado\Kernel\Plugin\ChadoStorage\ChadoStorageLinkerFieldTest::setUp ( )
protected

◆ testLinkerTableField()

Drupal\Tests\tripal_chado\Kernel\Plugin\ChadoStorage\ChadoStorageLinkerFieldTest::testLinkerTableField (   $linker_field_name,
  $linker_table_name,
  $right_table_id,
  $extra_values 
)

Testing ChadoStorage on linker fields.

@dataProvider provideTestCases

Test Cases:

  • Create Values in Chado using ChadoStorage when they don't yet exist.
  • Load values in Chado using ChadoStorage after we just inserted them.
  • Update values in Chado using ChadoStorage after we just inserted them.
  • [NOT IMPLEMENTED] Delete values in Chado using ChadoStorage.
  • [NOT IMPLEMENTED] Ensure property field picks up records in Chado not added through field.

Parameters provided by provideTestCases(). @params $linker_field_name The specific field in $fields to be used for the current test case.

Parameters
$linker_table_nameThe name of the chado linker table we are testing in the field specified by $linker_field_name
$right_table_idThe primary key for the right table in the link.
$extra_valuesThe values for the extra fields specific to each linker table where the key is the property key and the value is the value we should set it to.

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