diff --git a/application/resources/Catalog/Action/Helper/Osid.php b/application/resources/Catalog/Action/Helper/Osid.php index c25186df..28f27fbc 100755 --- a/application/resources/Catalog/Action/Helper/Osid.php +++ b/application/resources/Catalog/Action/Helper/Osid.php @@ -39,7 +39,7 @@ public function getConfigPath () { * @throws osid_IllegalStateException The config path has already been set. */ public function setConfigPath ($path) { - if (isset(self::$configPath)) + if (isset(self::$configPath) && self::$configPath != $path) throw new osid_IllegalStateException('the config path has already been set'); self::$configPath = $path; diff --git a/application/test/Catalog/Action/Helper/OsidTermsTest.php b/application/test/Catalog/Action/Helper/OsidTermsTest.php index 68214895..d899ef6b 100755 --- a/application/test/Catalog/Action/Helper/OsidTermsTest.php +++ b/application/test/Catalog/Action/Helper/OsidTermsTest.php @@ -20,10 +20,12 @@ class Catalog_Action_Helper_OsidTermsTest extends TestCase protected function setUp(): void { $this->osidHelper = new Catalog_Action_Helper_Osid(); + $this->osidHelper->setConfigPath($this->getTestConfigPath()); Zend_Controller_Action_HelperBroker::addHelper($this->osidHelper); $this->osidIdHelper = new Catalog_Action_Helper_OsidId(); Zend_Controller_Action_HelperBroker::addHelper($this->osidIdHelper); $this->osidTermsHelper = new Catalog_Action_Helper_OsidTerms(); + $this->osidHelper->setConfigPath($this->getTestConfigPath()); Zend_Controller_Action_HelperBroker::addHelper($this->osidTermsHelper); $this->mcugId = new phpkit_id_URNInetId('urn:inet:middlebury.edu:catalog/MCUG'); diff --git a/application/test/Catalog/Action/Helper/OsidTopicTest.php b/application/test/Catalog/Action/Helper/OsidTopicTest.php index c75d461b..9382e6f4 100755 --- a/application/test/Catalog/Action/Helper/OsidTopicTest.php +++ b/application/test/Catalog/Action/Helper/OsidTopicTest.php @@ -20,6 +20,7 @@ class Catalog_Action_Helper_OsidTopicTest extends TestCase protected function setUp(): void { $this->osidHelper = new Catalog_Action_Helper_Osid(); + $this->osidHelper->setConfigPath($this->getTestConfigPath()); Zend_Controller_Action_HelperBroker::addHelper($this->osidHelper); $this->osidIdHelper = new Catalog_Action_Helper_OsidId(); Zend_Controller_Action_HelperBroker::addHelper($this->osidIdHelper); diff --git a/application/test/Catalog/ApplicationTestTrait.php b/application/test/Catalog/ApplicationTestTrait.php index 240cfd8e..eff7bac6 100644 --- a/application/test/Catalog/ApplicationTestTrait.php +++ b/application/test/Catalog/ApplicationTestTrait.php @@ -14,10 +14,13 @@ public static function setUpBeforeClass(): void $registry = Zend_Registry::getInstance(); $registry->config = new Zend_Config_Ini(dirname(__FILE__).'/frontend_config.ini', 'development'); + } - // Use the APC implementation instead of the direct-query Banner implementation. - self::$runtimeManager = new phpkit_AutoloadOsidRuntimeManager(dirname(__FILE__).'/../apc/configuration.plist'); - self::$courseManager = self::$runtimeManager->getManager(osid_OSID::COURSE(), 'apc_course_CourseManager', '3.0.0'); + /** + * Answer the configuration path to be used when running tests. + */ + public function getTestConfigPath() { + return dirname(__FILE__).'/../apc/configuration.plist'; } }