phpvms/tests/TestCase.php
Nabeel Shahzad 8831f875ef user info
2017-06-09 14:47:02 -05:00

34 lines
865 B
PHP
Executable File

<?php
abstract class TestCase extends Illuminate\Foundation\Testing\TestCase
{
/**
* The base URL to use while testing the application.
*
* @var string
*/
protected $app;
protected $baseUrl = 'http://localhost';
public function __construct($name = null, array $data = [], $dataName = '') {
parent::__construct($name, $data, $dataName);
}
/**
* 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 createRepository($repo_name) {
$app = $this->createApplication();
return $app->make('App\Repositories\\' + $repo_name);
}
}