Exemple #1
0
 public function setUp()
 {
     Configure::load('../app/config/config.php');
     $viewPath = '../app/View';
     $layoutPath = '../app/Layout';
     $elementPath = '../app/View/Element';
     $this->view = new ViewAdapter($viewPath, $layoutPath, $elementPath, new UsersController(new RequestAggregate()));
 }
Exemple #2
0
    public function testExceptionRenderCaseForbiddenException()
    {
        Configure::load('../app/config/test.config.php');
        $this->expectOutputString('<div><h2>Forbidden</h2>
</div>
');
        ErrorHandler::handleException(new ForbiddenException('error'));
    }
<?php

use TRW\Core\Configure;
use TRW\Router\Router;
use TRW\ActiveRecord\BaseRecord;
use TRW\ActiveRecord\Database\Driver\MySql;
use TRW\Exception\ErrorHandler;
//ini_set('display_errors',1);
Configure::load(dirname(__FILE__) . '/config.php');
set_exception_handler('TRW\\Exception\\ErrorHandler::handleException');
BaseRecord::setConnection(new MySql(Configure::read('Database', 'MySql')));
Router::add('/', ['controller' => 'Pages', 'action' => 'index']);
Exemple #4
0
 public function setUp()
 {
     Configure::load('../app/config/config.php');
 }
Exemple #5
0
 public function setUp()
 {
     Configure::load('../app/config/config.php');
     BaseRecord::setConnection(new MySql(Configure::read('Database', 'MySql')));
 }
Exemple #6
0
 public function setUp()
 {
     Configure::load('../app/config/config.php');
     Router::clear();
 }
Exemple #7
0
 public function testLoadAndRead()
 {
     Configure::load('../app/config/config.php');
     $this->assertEquals('App', Configure::read('App', 'namespace'));
 }