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

Public Member Functions

 provideSinglePropFieldNames ()
 
 testCRUDForSinglePropField ($prop_field_name)
 
 provideMultiplePropFields ()
 
 testCRUDForMultiplePropFields ($prop_field_settings)
 

Protected Member Functions

 setUp ()
 

Protected Attributes

 $fields = []
 
 $yaml_file = __DIR__ . "/ChadoLinkerPropertyDefault-FieldDefinitions.yml"
 
int $organism_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 property fields as we expect. The array of fields/properties used for these tests are designed to match those in the ChadoLinkerPropertyDefault field with values filled based on a gene content type.

Note: testotherfeaturefield is added to ensure we meet the unique constraint on the base feature 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

◆ provideMultiplePropFields()

Drupal\Tests\tripal_chado\Kernel\Plugin\ChadoStorage\ChadoLinkerPropertyDefaultTest::provideMultiplePropFields ( )

Data Provider: Provide values for testing multiple property fields.

◆ provideSinglePropFieldNames()

Drupal\Tests\tripal_chado\Kernel\Plugin\ChadoStorage\ChadoLinkerPropertyDefaultTest::provideSinglePropFieldNames ( )

Data Provider: Test both the current store_link model and the old one.

◆ setUp()

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

◆ testCRUDForMultiplePropFields()

Drupal\Tests\tripal_chado\Kernel\Plugin\ChadoStorage\ChadoLinkerPropertyDefaultTest::testCRUDForMultiplePropFields (   $prop_field_settings)

Testing ChadoStorage on multiple property fields, each with multiple values.

@dataProvider provideMultiplePropFields

Test Cases:

  • Both fields create values in Chado when they don't yet exists (similar to creating Tripal Content)
  • Both fields have changed values to be updated in chado (update the page and change both fields)
  • Load tested after create and update.

Focus on ensuring that the values from one field are in different chado records than those from the other field.

◆ testCRUDForSinglePropField()

Drupal\Tests\tripal_chado\Kernel\Plugin\ChadoStorage\ChadoLinkerPropertyDefaultTest::testCRUDForSinglePropField (   $prop_field_name)

Testing ChadoStorage on single property field with multiple values.

@dataProvider provideSinglePropFieldNames

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.

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