public static function setUpBeforeClass() { // setup static configuration resource path for test purposes RootClassLoader::addLoader(new StandardClassLoader(self::TEST_VENDOR, __DIR__ . '/test-config')); // setup configuration provider for this test (remember previous one) self::$originalProvider = ConfigurationManager::retrieveProvider('ini'); $provider = new IniConfigurationProvider(); $provider->setOmitContext(true); $provider->setOmitConfigSubFolder(true); ConfigurationManager::registerProvider('ini', $provider); }
public static function setUpBeforeClass() { // setup static configuration resource path for test purposes RootClassLoader::addLoader(new StandardClassLoader(self::TEST_VENDOR, __DIR__ . '/' . self::CONFIG_ROOT_FOLDER)); // setup configuration provider for this test /* @var $provider IniConfigurationProvider */ $provider = ConfigurationManager::retrieveProvider('ini'); // store for further re-store self::$originalIniProvider = $provider; $provider->setOmitContext(true); $provider->setOmitConfigSubFolder(true); ConfigurationManager::registerProvider('ini', $provider); }
public function setUp() { // setup config provider to fake tests $this->initialIniProvider = ConfigurationManager::retrieveProvider('ini'); // setup fake ini provider to avoid file-based configuration files $provider = new FakeIniProvider(); $config = new IniConfiguration(); // setup section for action $action = new IniConfiguration(); $action->setValue('ActionClass', PriorityAwareTestAction::class); $config->setSection(FrontControllerActionPriorityTest::TEST_ACTION_NAME, $action); $provider->registerConfiguration(self::TEST_ACTION_NAMESPACE, self::TEST_ACTION_CONFIG_NAME, $config); ConfigurationManager::registerProvider('ini', $provider); }
protected function setUp() { // setup config provider to fake tests $this->initialIniProvider = ConfigurationManager::retrieveProvider('ini'); // setup fake ini provider to avoid file-based configuration files $provider = new FakeIniProvider(); $config = new IniConfiguration(); // setup section for action $action = new IniConfiguration(); $action->setValue('ActionClass', FilterTestAction::class); $config->setSection('say-foo', $action); $provider->registerConfiguration('VENDOR\\foo', self::TEST_ACTION_CONFIG_NAME, $config); $config->setSection('say-bar', $action); $provider->registerConfiguration('VENDOR\\bar', self::TEST_ACTION_CONFIG_NAME, $config); $config->setSection('say-baz', $action); $provider->registerConfiguration('VENDOR\\baz', self::TEST_ACTION_CONFIG_NAME, $config); ConfigurationManager::registerProvider('ini', $provider); }