public function testGetProtectedEnrichmentKeysNotConfigured() { $model = new Admin_Model_EnrichmentKeys(); $config = new Zend_Config(array()); $model->setConfig($config); $protectedKeys = $model->getProtectedEnrichmentKeys(); $this->assertInternalType('array', $protectedKeys); $this->assertCount(0, $protectedKeys); }
/** * Checks if a model can be modified. * @param $model Opus_EnrichmentKey * @return bool true if model can be edited and deleted, false if model is protected */ public function isModifiable($model) { $protectedKeys = $this->_enrichmentKeys->getProtectedEnrichmentKeys(); return !in_array($model->getId(), array_merge($protectedKeys, Opus_EnrichmentKey::getAllReferenced())); }