
In order to migrate IDP from LV 4.x to latest LV version, following task were performed: * Updated namespace to be complain with PSR-4 * General Refactoring: moved all DB access code from services to repositories. * Migration to LV 5.X: these migration guides were applied - https://laravel.com/docs/5.3/upgrade#upgrade-5.0 - https://laravel.com/docs/5.3/upgrade#upgrade-5.1.0 - https://laravel.com/docs/5.3/upgrade#upgrade-5.2.0 * Improved caching: added repositories decorators in order to add REDIS cache to queries, entities Change-Id: I8edf9f5fce6585129701c88bb88332f242307534
58 lines
1.1 KiB
PHP
58 lines
1.1 KiB
PHP
<?php
|
|
|
|
use Illuminate\Support\Facades\Redis;
|
|
|
|
/**
|
|
* Class TestCase
|
|
*/
|
|
class TestCase extends Illuminate\Foundation\Testing\TestCase
|
|
{
|
|
private $redis;
|
|
|
|
/**
|
|
* The base URL to use while testing the application.
|
|
*
|
|
* @var string
|
|
*/
|
|
protected $baseUrl = 'http://localhost';
|
|
|
|
/**
|
|
* Creates the application.
|
|
*
|
|
* @return \Illuminate\Foundation\Application
|
|
*/
|
|
public function createApplication()
|
|
{
|
|
$app = require __DIR__.'/../bootstrap/app.php';
|
|
|
|
$app->make(Illuminate\Contracts\Console\Kernel::class)->bootstrap();
|
|
|
|
return $app;
|
|
}
|
|
|
|
public function __construct(){
|
|
|
|
}
|
|
|
|
public function setUp()
|
|
{
|
|
parent::setUp(); // Don't forget this!
|
|
$this->redis = Redis::connection();
|
|
$this->redis->flushall();
|
|
$this->prepareForTests();
|
|
}
|
|
|
|
|
|
/**
|
|
* Migrates the database and set the mailer to 'pretend'.
|
|
* This will cause the tests to run quickly.
|
|
*
|
|
*/
|
|
protected function prepareForTests()
|
|
{
|
|
Artisan::call('migrate');
|
|
//Mail::pretend(true);
|
|
$this->seed('TestSeeder');
|
|
}
|
|
}
|