Exemplo n.º 1
0
 function __setupApp()
 {
     $config = new Config();
     $config->setProtected('basePath', BASE_PATH);
     setCommonConfig($config);
     setUniqueConfig($config);
     return new \App\Application($config);
 }
Exemplo n.º 2
0
 function __setupApp($serverName = null)
 {
     if (empty($serverName) && defined($_SERVER["SERVER_NAME"])) {
         $serverName = $_SERVER["SERVER_NAME"];
     }
     $config = new Config();
     $config->setProtected('basePath', BASE_PATH);
     setCommonConfig($config, $serverName);
     setUniqueConfig($config, $serverName);
     return new \TestApp\Application($config);
 }
Exemplo n.º 3
0
 protected function setUp()
 {
     $config = new Config();
     $config->setProtected('basePath', BASE_PATH);
     setCommonConfig($config);
     setUniqueConfig($config);
     Application::setupRedBean('sqlite:test.db', 'user', 'password', $this->frozen, 'sqlite');
     R::freeze(false);
     R::nuke();
     R::freeze($this->frozen);
     $this->app = __setupApp();
     /** $http Mock Http object. */
     $http = $this->getMock('Skully\\Core\\Http');
     $http->expects($this->any())->method('redirect')->will($this->returnCallback('stubRedirect'));
     $this->app->setHttp($http);
 }
Exemplo n.º 4
0
 protected function setUp()
 {
     $config = new Config();
     $config->setProtected('basePath', BASE_PATH);
     setCommonConfig($config);
     setUniqueConfig($config);
     $dbConfig = $config->getProtected('dbConfig');
     if ($dbConfig['type'] == 'mysql') {
         Application::setupRedBean("mysql:host={$dbConfig['host']};dbname={$dbConfig['dbname']};port={$dbConfig['port']}", $dbConfig['user'], $dbConfig['password'], $config->getProtected('isDevMode'));
     } elseif ($dbConfig['type'] == 'sqlite') {
         Application::setupRedBean("sqlite:{$dbConfig['dbname']}", $dbConfig['user'], $dbConfig['password'], $config->getProtected('isDevMode'));
     }
     R::freeze(false);
     R::nuke();
     R::freeze($this->frozen);
     $this->app = __setupApp();
     /** $http Mock Http object. */
     $http = $this->getMock('Skully\\Core\\Http');
     $http->expects($this->any())->method('redirect')->will($this->returnCallback('stubRedirect'));
     $this->app->setHttp($http);
 }