public function setup() { // setup the registry components required to test with $this->_registry = new \Zend\Tool\Framework\Registry\FrameworkRegistry(); $this->_registry->setActionRepository(new Action\Repository()); $this->_targetSignature = new Provider\Signature(new \ZendTest\Tool\Framework\Provider\TestAsset\ProviderFullFeatured()); $this->_targetSignature->setRegistry($this->_registry); $this->_targetSignature->process(); }
/** * Process all of the unprocessed providers * */ public function process() { // process all providers in the unprocessedProviders array //foreach ($this->_unprocessedProviders as $providerName => $provider) { reset($this->_unprocessedProviders); while ($this->_unprocessedProviders) { $providerName = key($this->_unprocessedProviders); $provider = array_shift($this->_unprocessedProviders); // create a signature for the provided provider $providerSignature = new Zend_Tool_Framework_Provider_Signature($provider); if ($providerSignature instanceof Zend_Tool_Framework_Registry_EnabledInterface) { $providerSignature->setRegistry($this->_registry); } $providerSignature->process(); // ensure the name is lowercased for easier searching $providerName = strtolower($providerName); // add to the appropraite place $this->_providerSignatures[$providerName] = $providerSignature; $this->_providers[$providerName] = $providerSignature->getProvider(); if ($provider instanceof Zend_Tool_Framework_Provider_Initializable) { $provider->initialize(); } } }
/** * @expectedException Zend_Tool_Framework_Provider_Exception */ public function testGetSpecialtiesReturnsParsedSpecialtiesThrowsExceptionOnBadReturnValue() { $signature = new Zend_Tool_Framework_Provider_Signature(new Zend_Tool_Framework_Provider_ProviderFullFeaturedBadSpecialties2()); $signature->setRegistry($this->_registry); $signature->process(); }
/** * Process all of the unprocessed providers * */ public function process() { // process all providers in the unprocessedProviders array foreach ($this->_unprocessedProviders as $providerName => $provider) { // create a signature for the provided provider $providerSignature = new Zend_Tool_Framework_Provider_Signature($provider); if ($providerSignature instanceof Zend_Tool_Framework_Registry_EnabledInterface) { $providerSignature->setRegistry($this->_registry); } $providerSignature->process(); // ensure the name is lowercased for easier searching $providerName = strtolower($providerName); // add to the appropraite place $this->_providerSignatures[$providerName] = $providerSignature; $this->_providers[$providerName] = $providerSignature->getProvider(); // remove from unprocessed array unset($this->_unprocessedProviders[$providerName]); } }