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

Public Member Functions

 testDetectDifferences (string $chado_verison_under_test, array $bundles_to_create, string|null $bundle_under_test, array $expectations)
 
 testResolveDifferences (string $chado_verison_under_test, array $bundles_to_create, string|null $bundle_under_test, array $expectations)
 

Static Public Member Functions

static provideChadoVersionsToTest ()
 

Protected Member Functions

 setUp ()
 
- Protected Member Functions inherited from Drupal\Tests\tripal_chado\Kernel\ChadoTestKernelBase
 prepareEnvironment (array $functionality)
 

Protected Attributes

 $defaultTheme = 'stark'
 
ChadoConnection $chado_connection
 
Connection $drupal_connection
 
- Protected Attributes inherited from Drupal\Tests\tripal\Kernel\TripalTestKernelBase
 $messenger = NULL
 
 $logger = NULL
 
 $fileretriever = NULL
 
 $publish_manager = NULL
 

Static Protected Attributes

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

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
 

Detailed Description

Tests the SyncTripalFieldStorage service.

@group SyncTripalFieldStorage

Member Function Documentation

◆ provideChadoVersionsToTest()

static Drupal\Tests\tripal\Kernel\SyncTripalFieldStorageTest::provideChadoVersionsToTest ( )
static

Provides information about specific versions of Chado to test.

Note: specifically aimed at testing for discrepancies against field installed on Chado 1.3.

Returns
array Each entry in this array is a specific scenario to be tested. Each scenario has the following elements:
  • chado_verison_under_test The version of chado we want to test for differences from Chado 1.3.
  • bundles_to_create An array of bundles to create for the test. The bundles should be a string of the format CATEGORY.BUNDLENAME. Each bundle will be created when the test schema is at 1.3 using createContentTypeFromConfig().
  • bundle_under_test The bundle name to pass into our test function.
  • expectations An array of expectations. Specifically,
    • num_fields: the number of fields with detected differences.
    • differences: the keys are field names with differences and the value for each is a list of property names with differences for that field.

◆ setUp()

Drupal\Tests\tripal\Kernel\SyncTripalFieldStorageTest::setUp ( )
protected

◆ testDetectDifferences()

Drupal\Tests\tripal\Kernel\SyncTripalFieldStorageTest::testDetectDifferences ( string  $chado_verison_under_test,
array  $bundles_to_create,
string|null  $bundle_under_test,
array  $expectations 
)

Tests detectDifferences() + resolveDetectedDifferences().

Parameters
string$chado_verison_under_testThe version of chado we want to test for differences from Chado 1.3.
array$bundles_to_createAn array of bundles to create for the test. The bundles should be a string of the format CATEGORY.BUNDLENAME. Each bundle will be created when the test schema is at 1.3 using createContentTypeFromConfig().
string | null$bundle_under_testThe bundle name to pass into our test function.
array$expectationsAn array of expectations. Specifically,
  • num_fields: the number of fields with detected differences.
  • differences: the keys are field names with differences and the value for each is a list of property names with differences for that field.

@dataProvider provideChadoVersionsToTest

◆ testResolveDifferences()

Drupal\Tests\tripal\Kernel\SyncTripalFieldStorageTest::testResolveDifferences ( string  $chado_verison_under_test,
array  $bundles_to_create,
string|null  $bundle_under_test,
array  $expectations 
)

Tests detectDifferences() + resolveDetectedDifferences().

Parameters
string$chado_verison_under_testThe version of chado we want to test for differences from Chado 1.3.
array$bundles_to_createAn array of bundles to create for the test. The bundles should be a string of the format CATEGORY.BUNDLENAME. Each bundle will be created when the test schema is at 1.3 using createContentTypeFromConfig().
string | null$bundle_under_testThe bundle name to pass into our test function.
array$expectationsAn array of expectations. Specifically,
  • num_fields: the number of fields with detected differences.
  • differences: the keys are field names with differences and the value for each is a list of property names with differences for that field.

@dataProvider provideChadoVersionsToTest

Member Data Documentation

◆ $modules

Drupal\Tests\tripal\Kernel\SyncTripalFieldStorageTest::$modules
staticprotected
Initial value:
= [
'system',
'user',
'path',
'path_alias',
'tripal',
'tripal_chado',
'views',
'field',
'field_ui',
]

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