Skip to content

Commit

Permalink
Fixed InstallTest so that module is installed after setUp
Browse files Browse the repository at this point in the history
  • Loading branch information
carolyncaron committed Dec 5, 2023
1 parent f81e23c commit 8bb301b
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion trpcultivate_germplasm/tests/src/Functional/InstallTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class InstallTest extends ChadoTestBrowserBase {
*
* @var array
*/
protected static $modules = ['help', 'trpcultivate_germplasm'];
protected static $modules = ['help', 'tripal_chado'];

/**
* The name of your module in the .info.yml
Expand All @@ -38,6 +38,25 @@ class InstallTest extends ChadoTestBrowserBase {
*/
protected static $help_text_excerpt = 'specialized Tripal fields and importers for germplasm';

/**
* {@inheritdoc}
*/
protected function setUp() :void {

parent::setUp();

// Ensure we see all logging in tests.
\Drupal::state()->set('is_a_test_environment', TRUE);

// Open connection to Chado
$this->connection = $this->getTestSchema(ChadoTestBrowserBase::PREPARE_TEST_CHADO);

$moduleHandler = $this->container->get('module_handler');
$moduleInstaller = $this->container->get('module_installer');
$this->assertFalse($moduleHandler->moduleExists('trpcultivate_germplasm'));
$this->assertTrue($moduleInstaller->install(['trpcultivate_germplasm']));
}

/**
* Tests that a specific set of pages load with a 200 response.
*/
Expand Down

0 comments on commit 8bb301b

Please sign in to comment.