Skip to content

Commit

Permalink
Make path to INI file configurable
Browse files Browse the repository at this point in the history
  • Loading branch information
gudmdharalds committed Sep 17, 2020
1 parent 880b30c commit 7b37cfe
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions tests/IncludesForTests.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,25 @@
define( 'VIPGOCI_UNIT_TESTING', true );
}

if ( ! defined( 'VIPGOCI_UNIT_TESTS_INI_DIR_PATH' ) ) {
define( 'VIPGOCI_UNIT_TESTS_INI_DIR_PATH', dirname( __DIR__ ) );
}

function vipgoci_unittests_get_config_value(
$section,
$key,
$secret_file = false
) {
if ( false === $secret_file ) {
$ini_array = parse_ini_file(
dirname( __FILE__ ) . '/../unittests.ini',
VIPGOCI_UNIT_TESTS_INI_DIR_PATH . '/unittests.ini',
true
);
}

else {
$ini_array = parse_ini_file(
dirname( __FILE__ ) . '/../unittests-secrets.ini',
VIPGOCI_UNIT_TESTS_INI_DIR_PATH . '/unittests-secrets.ini',
true
);
}
Expand Down

0 comments on commit 7b37cfe

Please sign in to comment.