Sebastian Marcet ce12d3cb89 Upgrade Laravel Version and ORM Framework
upgraded laravel version from 5.0 to 5.2.
Changed ORM from eloquent to Doctrine to support better inheritance handling
basically eloquent does not suppor the inheritance model used by Silverstripe
which makes dificult to implement write apis on model hierarchies defined with
SS schema.
Refactoring.

Change-Id: I802e171c8b95e81dc21578543ddb6a02003985e5
2016-09-06 13:47:37 -03:00

46 lines
831 B
PHP

<?php
use Illuminate\Support\Facades\Redis;
class TestCase extends Illuminate\Foundation\Testing\TestCase
{
//services
private $redis = null;
/**
* Creates the application.
*
* @return \Illuminate\Foundation\Application
*/
public function createApplication()
{
//putenv('DB_DEFAULT=sqlite_testing');
$app = require __DIR__.'/../bootstrap/app.php';
$instance = $app->make('Illuminate\Contracts\Console\Kernel');
$app->loadEnvironmentFrom('.env.testing');
$instance->bootstrap();
return $app;
}
public function setUp()
{
parent::setUp();
$this->redis = Redis::connection();
$this->redis->flushall();
$this->prepareForTests();
}
protected function prepareForTests()
{
Artisan::call('migrate');
$this->seed('TestSeeder');
}
public function tearDown()
{
parent::tearDown();
}
}