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

Public Member Functions

 testGetMainTables (string $version, int $init_level)
 
 testGetDefault (string $version, int $init_level)
 
 testGetChadoSchemaDef (string $version, int $init_level, array $options)
 
 assertValidSchemaDef (array $schema_def, string $message)
 

Static Public Member Functions

static provideChadoSchemaVersions ()
 
static provideSchemaDefParams ()
 

Protected Member Functions

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

Static Protected Attributes

static $modules = ['tripal', 'tripal_chado']
 
static array $supported_chado_versions
 
static array $init_levels
 
- 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
 
- Protected Attributes inherited from Drupal\Tests\tripal\Kernel\TripalTestKernelBase
 $messenger = NULL
 
 $logger = NULL
 
 $fileretriever = NULL
 
 $publish_manager = NULL
 

Detailed Description

Tests for ChadoConnection.

@group Tripal Chado @group TripalDBX @group ChadoDBX @group ChadoSchema

Member Function Documentation

◆ assertValidSchemaDef()

Drupal\Tests\tripal\Kernel\TripalDBX\ChadoSchemaTest::assertValidSchemaDef ( array  $schema_def,
string  $message 
)

Confirms that a Schema Definition array is valid.

Parameters
array$schema_defAn array defining the schema as returned by getSchemaDef().
string$messageA message prefix to use with the asserts.

◆ provideChadoSchemaVersions()

static Drupal\Tests\tripal\Kernel\TripalDBX\ChadoSchemaTest::provideChadoSchemaVersions ( )
static

Provides each supported version of chado to the tests.

Returns
array Each scenario is a unique chado version and init level combination.

◆ provideSchemaDefParams()

static Drupal\Tests\tripal\Kernel\TripalDBX\ChadoSchemaTest::provideSchemaDefParams ( )
static

Provides scenarios to test ChadoSchema::getSchemaDef().

Returns
array Each scenario is a unique chado version and init level combination with a specific option set for getSchemaDef() to be called with.

◆ setUp()

Drupal\Tests\tripal\Kernel\TripalDBX\ChadoSchemaTest::setUp ( )
protected

◆ testGetChadoSchemaDef()

Drupal\Tests\tripal\Kernel\TripalDBX\ChadoSchemaTest::testGetChadoSchemaDef ( string  $version,
int  $init_level,
array  $options 
)

Tests ChadoSchema::getSchemaDef() on all Chado schema versions.

@dataProvider provideSchemaDefParams

Parameters
string$versionThe version of chado to test against.
int$init_levelThe init level to create the test database with.
array$optionsParameters to use when testing ChadoSchema::getSchemaDef().

◆ testGetDefault()

Drupal\Tests\tripal\Kernel\TripalDBX\ChadoSchemaTest::testGetDefault ( string  $version,
int  $init_level 
)

Test the ChadoSchema::getDefault() method on all Chado schema versions.

We will test that the default chado in this test returns the name set by the chadoTestTrait when a new test schema was created. The chadoTestTrait also sets the new chado schema created for testing to the default within the test environment.

There is no way to programatically set the default chado, so we will not test changing the default and seeing if the default is still reported correctly afterwards.

@dataProvider provideChadoSchemaVersions

Parameters
string$versionThe version of chado to test against.
int$init_levelThe init level to create the test database with.

◆ testGetMainTables()

Drupal\Tests\tripal\Kernel\TripalDBX\ChadoSchemaTest::testGetMainTables ( string  $version,
int  $init_level 
)

Tests ChadoSchema::getMainTables() on all Chado schema versions.

@dataProvider provideChadoSchemaVersions

Parameters
string$versionThe version of chado to test against.
int$init_levelThe init level to create the test database with.

Member Data Documentation

◆ $init_levels

array Drupal\Tests\tripal\Kernel\TripalDBX\ChadoSchemaTest::$init_levels
staticprotected
Initial value:
= [
3,
4,
5,
]

◆ $modules

Drupal\Tests\tripal\Kernel\TripalDBX\ChadoSchemaTest::$modules = ['tripal', 'tripal_chado']
staticprotected

{}

◆ $supported_chado_versions

array Drupal\Tests\tripal\Kernel\TripalDBX\ChadoSchemaTest::$supported_chado_versions
staticprotected
Initial value:
= [
'1.3',
'1.3.3.001',
'1.3.3.002',
'1.3.3.003',
'1.3.3.004',
'1.3.3.005',
'1.3.3.006',
'1.3.3.007',
'1.3.3.008',
'1.3.3.009',
'1.3.3.011',
'1.3.3.013',
]

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