Пример #1
0
if ($db_driver == 'sqlite') {
    @unlink($db_config['database']);
}
require __DIR__ . '/../src/bootstrap/connection.php';
Hook\Http\Router::setInstance($app);
//
// Ensure that tests will run against an valid fresh app
//
if (Hook\Model\AppKey::count() == 0) {
    $app->environment->offsetSet('PATH_INFO', '/apps');
    $app->environment->offsetSet('slim.request.form_hash', array('app' => array('name' => 'testing')));
    $app_controller = new Hook\Controllers\ApplicationController();
    $app_controller->create();
}
// Force application key for testing
Hook\Application\Context::setTablePrefix('');
Hook\Application\Context::setKey(Hook\Model\AppKey::with('app')->first());
$app->log->setWriter(new Hook\Logger\LogWriter(storage_dir() . '/logs.txt'));
class TestCase extends PHPUnit_Framework_TestCase
{
}
class HTTP_TestCase extends PHPUnit_Framework_TestCase
{
    // protected $base_url = 'http://localhost/index.php/';
    // protected $base_url = 'http://localhost/index.php/';
    protected $base_url = 'http://hook.dev/public/index.php/';
    protected $app_keys = array();
    protected $app_key = array();
    // protected $base_url = 'http://dl-api.dev/index.php/';
    public function setUp()
    {