예제 #1
0
 protected function setUp()
 {
     $this->_frontController = System_Application::getInstance()->getBootstrap()->getResource('FrontController');
     $this->frontController->setParam('bootstrap', System_Application::getInstance()->getBootstrap());
     $this->getRequest()->setBaseUrl($this->frontController->getBaseUrl());
     Zend_Session::$_unitTestEnabled = true;
 }
예제 #2
0
 /**
  * Get Application instance
  * @return System_Application
  */
 public function getApplication()
 {
     if (!$this->_application) {
         $this->setApplication(System_Application::getInstance());
     }
     return $this->_application;
 }
예제 #3
0
 /**
  * Get Application instance
  * @return System_Application
  */
 public function getApplication()
 {
     if (!$this->_application) {
         try {
             $this->_application = System_Application::getInstance();
         } catch (Zend_Exception $e) {
             $root = $this->getProject()->getProperty('path.root');
             $environment = $this->getProject()->getProperty('environment');
             $this->_application = new System_Application($environment, $root);
         }
     }
     return $this->_application;
 }
예제 #4
0
 /**
  * @covers System_Application::getInstance
  */
 public function testGetInstance()
 {
     $app = new System_Application('test');
     self::assertType('Zend_Application', System_Application::getInstance());
 }
예제 #5
0
파일: index.php 프로젝트: kandy/HamsterCMF
<?php

require_once '../common.php';
$application = System_Application::getInstance();
$application->bootstrap()->run();
예제 #6
0
파일: AuthTest.php 프로젝트: kandy/system
 /**
  * Sets up the fixture, for example, opens a network connection.
  * This method is called before a test is executed.
  */
 protected function setUp()
 {
     parent::setUp();
     $this->object = new System_Controller_Action_Helper_Auth();
     $this->setBootstrap(System_Application::getInstance()->getBootstrap());
 }
예제 #7
0
<?php

require_once 'common.php';
$path = System_Application::getInstance()->getOption('path');
$modelDir = $path['application'] . '/models';
if (!isset($_SERVER['argv'][1])) {
    echo 'Add table and row class scrip
	Usege: add-table %TableName%';
    die("\n");
}
$tableName = $_SERVER['argv'][1];
$tableSource = "<?php\n/**\n * {$tableName} table\n */\nclass Model_Table_{$tableName} extends System_Db_Table_Abstract\n{\n\tprotected \$_name = '{$tableName}';\n\tprotected \$_rowClass = 'Model_Row_{$tableName}';\n}\n";
$rowSource = "<?php\n/**\n * {$tableName} row\n */\nclass Model_Row_{$tableName} extends System_Db_Table_Row_Abstract\n{\n}\n";
file_put_contents($modelDir . '/Table/' . $tableName . '.php', $tableSource);
file_put_contents($modelDir . '/Row/' . $tableName . '.php', $rowSource);