Example #1
0
 /**
  * getContent()
  *
  * @param \Zend\Tool\Project\Context $context
  * @param string $method
  * @param mixed $parameters
  */
 public function getContent(Context $context, $method, $parameters)
 {
     $streamUri = $this->_storage->getStreamUri($this->_contentPrefix . '/' . $context->getName() . '/' . $method . '.phtml');
     ob_start();
     include $streamUri;
     $content = ob_get_clean();
     return $content;
 }
Example #2
0
 /**
  * getContent()
  *
  * @param \Zend\Tool\Project\Context $context
  * @param string $method
  * @param mixed $parameters
  * @return string
  */
 public function getContent(Context $context, $method, $parameters)
 {
     $streamUri = $this->_storage->getStreamUri($this->_contentPrefix . '/' . $context->getName() . '/' . $method . '.php');
     if (method_exists($context, 'getCodeGenerator')) {
         $codeGenerator = $context->getCodeGenerator();
     } else {
         $codeGenerator = new FileGenerator();
     }
     $codeGenerator = (include $streamUri);
     if (!$codeGenerator instanceof AbstractGenerator) {
         throw new Exception\RuntimeException('Custom file at ' . $streamUri . ' did not return the $codeGenerator object.');
     }
     return $codeGenerator->generate();
 }
Example #3
0
 public function testPassingArrayToConstructor()
 {
     $directory = new Storage\Directory($this->getStorageDirectory());
     $storage = new Storage(array('adapter' => $directory));
     $this->assertTrue($storage->isEnabled());
 }
Example #4
0
 public function testNoAdapterStorageIsNotEnabled()
 {
     $this->assertFalse($this->storage->isEnabled());
 }