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\ChadoConnectionTest Class Reference
Inheritance diagram for Drupal\Tests\tripal\Kernel\TripalDBX\ChadoConnectionTest:
Inheritance graph
[legend]
Collaboration diagram for Drupal\Tests\tripal\Kernel\TripalDBX\ChadoConnectionTest:
Collaboration graph
[legend]

Public Member Functions

 testGetAvailableInstances (string $version, int $init_level)
 
 testDefaultTablePrefixing (string $version, int $init_level)
 
 testChadoQueryBuilding (string $version)
 
 testFindVersion (string $version, int $init_level)
 
 testFindVersionUnsupported ()
 
 testGetTripalDbxClass ()
 
 testChadoConnectionConstructor ()
 
 testRemoveAllTestSchemas ()
 

Static Public Member Functions

static provideChadoSchemaVersions ()
 
static provideChadoSchemaVersionsAcrossInitLevels ()
 

Protected Member Functions

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

Static Protected Attributes

static $modules = ['system', 'user', 'views', 'path', '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 ChadoConnection @covers \Drupal\tripal\TripalDBX\TripalDbxConnection @covers \Drupal\tripal\TripalDBX\TripalDbxSchema @covers \Drupal\tripal_chado\Database\ChadoConnection::getAvailableInstances @covers \Drupal\tripal_chado\Database\ChadoConnection::findVersion @covers \Drupal\tripal_chado\Database\ChadoConnection::removeAllTestSchemas

Member Function Documentation

◆ provideChadoSchemaVersions()

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

Provides each supported version of chado to the tests.

Returns
array Each scenario is just a version of chado as a string.

◆ provideChadoSchemaVersionsAcrossInitLevels()

static Drupal\Tests\tripal\Kernel\TripalDBX\ChadoConnectionTest::provideChadoSchemaVersionsAcrossInitLevels ( )
static

Provides each supported version of chado to the tests.

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

◆ setUp()

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

◆ testChadoConnectionConstructor()

Drupal\Tests\tripal\Kernel\TripalDBX\ChadoConnectionTest::testChadoConnectionConstructor ( )

Tests ChadoConnection::_construct() directly.

◆ testChadoQueryBuilding()

Drupal\Tests\tripal\Kernel\TripalDBX\ChadoConnectionTest::testChadoQueryBuilding ( string  $version)

Tests the Drupal query builders while querying chado.

@dataProvider provideChadoSchemaVersions

Parameters
string$versionThe version of chado to test against.

◆ testDefaultTablePrefixing()

Drupal\Tests\tripal\Kernel\TripalDBX\ChadoConnectionTest::testDefaultTablePrefixing ( string  $version,
int  $init_level 
)

Tests table prefixing by the ChadoConnection + TripalDbxConnection classes.

@dataProvider provideChadoSchemaVersionsAcrossInitLevels

NOTE: In Drupal you can execute queries directly using CONNECTION->query() or you can use the various query builders: CONNECTION->select(), CONNECTION->update(), CONNECTION->merge(), CONNECTION->upsert(), CONNECTION->delete().

This test is focusing on CONNECTION->query() since a code analysis shows that the other options are simply preparing a query and then executing it using CONNECTION->query().

That said, at some point we may want to add additional tests to show that the query builders are building queries appropriately but because these are Drupal functionalities and our differences come during execution and not at the query building stage, we are currently going to assume that the Drupal testing is sufficient for the query builders.

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

◆ testFindVersion()

Drupal\Tests\tripal\Kernel\TripalDBX\ChadoConnectionTest::testFindVersion ( string  $version,
int  $init_level 
)

Tests the ChadoConnection::findVersion() across unique version/init levels.

@dataProvider provideChadoSchemaVersionsAcrossInitLevels

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

◆ testFindVersionUnsupported()

Drupal\Tests\tripal\Kernel\TripalDBX\ChadoConnectionTest::testFindVersionUnsupported ( )

Tests the ChadoConnection::findVersion() when version unsupported.

◆ testGetAvailableInstances()

Drupal\Tests\tripal\Kernel\TripalDBX\ChadoConnectionTest::testGetAvailableInstances ( string  $version,
int  $init_level 
)

Tests ChadoConnection::getAvailableInstances() across chado versions.

@dataProvider provideChadoSchemaVersionsAcrossInitLevels

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

◆ testGetTripalDbxClass()

Drupal\Tests\tripal\Kernel\TripalDBX\ChadoConnectionTest::testGetTripalDbxClass ( )

Tests ChadoConnection::getTripalDbxClass() directly.

◆ testRemoveAllTestSchemas()

Drupal\Tests\tripal\Kernel\TripalDBX\ChadoConnectionTest::testRemoveAllTestSchemas ( )

Tests ChadoConnection::removeAllTestSchemas().

Member Data Documentation

◆ $init_levels

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

◆ $modules

Drupal\Tests\tripal\Kernel\TripalDBX\ChadoConnectionTest::$modules = ['system', 'user', 'views', 'path', 'tripal', 'tripal_chado']
staticprotected

{}

◆ $supported_chado_versions

array Drupal\Tests\tripal\Kernel\TripalDBX\ChadoConnectionTest::$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: