384 Laravel 6 changes (#385)
* 384 Laravel 6 changes * Library versions * Update package versions * Add keyType to models * Remove unused dependencies * StyleCI fixes * Fix models for test * Fix tests output and update test runner * Unused imports * Update exceptions handler * Fix login page
This commit is contained in:
parent
7a76ac4226
commit
23eb9dcbda
@ -9,6 +9,14 @@ indent_size = 2
|
||||
indent_style = space
|
||||
indent_size = 4
|
||||
|
||||
[*.blade.php]
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
|
||||
[*.stub]
|
||||
indent_style = space
|
||||
indent_size = 4
|
||||
|
||||
[Makefile]
|
||||
indent_style = tab
|
||||
|
||||
|
@ -13,6 +13,9 @@
|
||||
<directory suffix="Test.php">./tests</directory>
|
||||
</testsuite>
|
||||
</testsuites>
|
||||
<extensions>
|
||||
<extension class="Tests\Bootstrap"/>
|
||||
</extensions>
|
||||
<filter>
|
||||
<whitelist processUncoveredFilesFromWhitelist="true">
|
||||
<directory suffix=".php">./app</directory>
|
||||
@ -22,16 +25,21 @@
|
||||
<listener class="NunoMaduro\Collision\Adapters\Phpunit\Listener"/>
|
||||
</listeners>
|
||||
<php>
|
||||
<env name="APP_ENV" value="unittest"/>
|
||||
<env name="APP_KEY" value="base64:ve66Z5Kt/zTN3p++0zOPu854PHfZkwJE5VuoFAlzHtI="/>
|
||||
<env name="APP_DEBUG" value="true"/>
|
||||
<env name="APP_LOG_LEVEL" value="debug"/>
|
||||
<env name="DB_CONNECTION" value="memory"/>
|
||||
<env name="CACHE_DRIVER" value="array"/>
|
||||
<env name="SESSION_DRIVER" value="array"/>
|
||||
<env name="QUEUE_DRIVER" value="sync"/>
|
||||
<ini name="error_reporting" value="E_ALL"/>
|
||||
<ini name="display_errors" value="On"/>
|
||||
<ini name="display_startup_errors" value="On"/>
|
||||
<server name="APP_ENV" value="testing"/>
|
||||
<server name="APP_KEY" value="base64:ve66Z5Kt/zTN3p++0zOPu854PHfZkwJE5VuoFAlzHtI="/>
|
||||
<server name="APP_DEBUG" value="true"/>
|
||||
<server name="APP_LOG_LEVEL" value="debug"/>
|
||||
<server name="DB_CONNECTION" value="memory"/>
|
||||
<server name="CACHE_DRIVER" value="array"/>
|
||||
<server name="SESSION_DRIVER" value="array"/>
|
||||
<server name="QUEUE_DRIVER" value="sync"/>
|
||||
<server name="APP_CONFIG_CACHE" value="bootstrap/cache/config.phpunit.php"/>
|
||||
<server name="APP_SERVICES_CACHE" value="bootstrap/cache/services.phpunit.php"/>
|
||||
<server name="APP_PACKAGES_CACHE" value="bootstrap/cache/packages.phpunit.php"/>
|
||||
<server name="APP_ROUTES_CACHE" value="bootstrap/cache/routes.phpunit.php"/>
|
||||
<server name="APP_EVENTS_CACHE" value="bootstrap/cache/events.phpunit.php"/>
|
||||
</php>
|
||||
</phpunit>
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
namespace App\Console;
|
||||
|
||||
use Log;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use Symfony\Component\Process\Process;
|
||||
|
||||
/**
|
||||
@ -10,6 +10,16 @@ use Symfony\Component\Process\Process;
|
||||
*/
|
||||
abstract class Command extends \Illuminate\Console\Command
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
// Running in the console but not in the tests
|
||||
if (app()->runningInConsole() && env('APP_ENV') !== 'testing') {
|
||||
$this->redirectLoggingToFile('stdout');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
*/
|
||||
|
@ -7,9 +7,6 @@ use App\Facades\Utils;
|
||||
use GuzzleHttp\Client;
|
||||
use Illuminate\Database\Eloquent\Collection;
|
||||
|
||||
/**
|
||||
* Class AcarsReplay
|
||||
*/
|
||||
class AcarsReplay extends Command
|
||||
{
|
||||
protected $signature = 'phpvms:replay {files} {--manual} {--write-all} {--no-submit}';
|
||||
@ -47,8 +44,6 @@ class AcarsReplay extends Command
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
$this->redirectLoggingToFile('stdout');
|
||||
|
||||
$this->httpClient = new Client([
|
||||
'base_uri' => config('app.url'),
|
||||
'headers' => [
|
||||
|
@ -3,23 +3,13 @@
|
||||
namespace App\Console\Commands;
|
||||
|
||||
use App\Console\Command;
|
||||
use Artisan;
|
||||
use Illuminate\Support\Facades\Artisan;
|
||||
|
||||
/**
|
||||
* Class ComposerCommand
|
||||
*/
|
||||
class ComposerCommand extends Command
|
||||
{
|
||||
protected $signature = 'phpvms:composer {cmd}';
|
||||
protected $description = 'Composer related tasks';
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
$this->redirectLoggingToFile('stdout');
|
||||
}
|
||||
|
||||
/**
|
||||
* Run composer update related commands
|
||||
*/
|
||||
|
@ -3,12 +3,9 @@
|
||||
namespace App\Console\Commands;
|
||||
|
||||
use App\Console\Command;
|
||||
use Log;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use Tivie\OS\Detector;
|
||||
|
||||
/**
|
||||
* Class CreateDatabase
|
||||
*/
|
||||
class CreateDatabase extends Command
|
||||
{
|
||||
protected $signature = 'database:create {--reset} {--conn=?}';
|
||||
@ -21,8 +18,6 @@ class CreateDatabase extends Command
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
$this->redirectLoggingToFile('stdout');
|
||||
$this->os = new Detector();
|
||||
}
|
||||
|
||||
|
@ -19,9 +19,6 @@ use Illuminate\Support\Facades\Schema;
|
||||
use PDO;
|
||||
use Symfony\Component\Yaml\Yaml;
|
||||
|
||||
/**
|
||||
* Class DevCommands
|
||||
*/
|
||||
class DevCommands extends Command
|
||||
{
|
||||
protected $signature = 'phpvms {cmd} {param?}';
|
||||
@ -37,7 +34,6 @@ class DevCommands extends Command
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
$this->redirectLoggingToFile('stdout');
|
||||
$this->dbSvc = $dbSvc;
|
||||
}
|
||||
|
||||
|
@ -27,7 +27,6 @@ class DevInstall extends Command
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
$this->redirectLoggingToFile('stdout');
|
||||
$this->databaseSeeder = $databaseSeeder;
|
||||
}
|
||||
|
||||
|
@ -5,9 +5,6 @@ namespace App\Console\Commands;
|
||||
use App\Console\Command;
|
||||
use App\Services\ImportService;
|
||||
|
||||
/**
|
||||
* Class ImportCsv
|
||||
*/
|
||||
class ImportCsv extends Command
|
||||
{
|
||||
protected $signature = 'phpvms:csv-import {type} {file}';
|
||||
@ -24,7 +21,6 @@ class ImportCsv extends Command
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
$this->redirectLoggingToFile('stdout');
|
||||
$this->importer = $importer;
|
||||
}
|
||||
|
||||
|
@ -6,21 +6,11 @@ use App\Console\Command;
|
||||
use App\Models\Enums\NavaidType;
|
||||
use App\Models\Navdata;
|
||||
|
||||
/**
|
||||
* Class NavdataImport
|
||||
*/
|
||||
class NavdataImport extends Command
|
||||
{
|
||||
protected $signature = 'phpvms:navdata';
|
||||
protected $description = '';
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
$this->redirectLoggingToFile('stdout');
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws \League\Geotools\Exception\InvalidArgumentException
|
||||
*
|
||||
|
@ -5,20 +5,11 @@ namespace App\Console\Commands;
|
||||
use App\Console\Command;
|
||||
use GuzzleHttp\Client;
|
||||
|
||||
/**
|
||||
* Class TestApi
|
||||
*/
|
||||
class TestApi extends Command
|
||||
{
|
||||
protected $signature = 'phpvms:test-api {apikey} {url}';
|
||||
protected $httpClient;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->redirectLoggingToFile('stdout');
|
||||
}
|
||||
|
||||
/**
|
||||
* Run dev related commands
|
||||
*/
|
||||
|
@ -6,9 +6,6 @@ use App\Console\Command;
|
||||
use App\Services\VersionService;
|
||||
use Symfony\Component\Yaml\Yaml;
|
||||
|
||||
/**
|
||||
* Class Version
|
||||
*/
|
||||
class Version extends Command
|
||||
{
|
||||
protected $signature = 'phpvms:version {--write} {--base-only}';
|
||||
@ -19,7 +16,6 @@ class Version extends Command
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
$this->redirectLoggingToFile('stdout');
|
||||
$this->versionSvc = $versionSvc;
|
||||
}
|
||||
|
||||
|
@ -14,13 +14,6 @@ class YamlExport extends Command
|
||||
protected $signature = 'phpvms:yaml-export {tables*}';
|
||||
protected $description = 'YAML table export';
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
$this->redirectLoggingToFile('stdout');
|
||||
}
|
||||
|
||||
/**
|
||||
* Run dev related commands
|
||||
*/
|
||||
|
@ -24,7 +24,6 @@ class YamlImport extends Command
|
||||
parent::__construct();
|
||||
|
||||
$this->dbSvc = $dbSvc;
|
||||
$this->redirectLoggingToFile('stdout');
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -9,9 +9,6 @@ use App\Console\Cron\Weekly;
|
||||
use Illuminate\Console\Scheduling\Schedule;
|
||||
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
|
||||
|
||||
/**
|
||||
* Class Kernel
|
||||
*/
|
||||
class Kernel extends ConsoleKernel
|
||||
{
|
||||
/**
|
||||
|
@ -7,8 +7,6 @@ namespace App\Contracts;
|
||||
*/
|
||||
class FormRequest extends \Illuminate\Foundation\Http\FormRequest
|
||||
{
|
||||
protected $sanitizer;
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
|
@ -9,6 +9,7 @@ use App\Exceptions\Converters\ValidationException;
|
||||
use Exception;
|
||||
use Illuminate\Auth\Access\AuthorizationException;
|
||||
use Illuminate\Auth\AuthenticationException;
|
||||
use Illuminate\Contracts\Container\BindingResolutionException;
|
||||
use Illuminate\Database\Eloquent\ModelNotFoundException;
|
||||
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
|
||||
use Illuminate\Http\Request;
|
||||
@ -19,6 +20,7 @@ use Symfony\Component\HttpFoundation\Response;
|
||||
use Symfony\Component\HttpKernel\Exception\HttpException as SymfonyHttpException;
|
||||
use Symfony\Component\HttpKernel\Exception\HttpExceptionInterface;
|
||||
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
|
||||
use Whoops\Handler\HandlerInterface;
|
||||
|
||||
/**
|
||||
* Class Handler
|
||||
@ -133,4 +135,16 @@ class Handler extends ExceptionHandler
|
||||
|
||||
return $this->convertExceptionToResponse($e);
|
||||
}
|
||||
|
||||
/**
|
||||
* Ignition error page integration
|
||||
*/
|
||||
protected function whoopsHandler()
|
||||
{
|
||||
try {
|
||||
return app(HandlerInterface::class);
|
||||
} catch (BindingResolutionException $e) {
|
||||
return parent::whoopsHandler();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -8,6 +8,7 @@ use App\Http\Resources\AirportDistance as AirportDistanceResource;
|
||||
use App\Repositories\AirportRepository;
|
||||
use App\Services\AirportService;
|
||||
use Illuminate\Http\Request;
|
||||
use Prettus\Repository\Criteria\RequestCriteria;
|
||||
|
||||
/**
|
||||
* Class AirportController
|
||||
@ -45,6 +46,8 @@ class AirportController extends Controller
|
||||
$where['hub'] = $request->get('hub');
|
||||
}
|
||||
|
||||
$this->airportRepo->pushCriteria(new RequestCriteria($request));
|
||||
|
||||
$airports = $this->airportRepo
|
||||
->whereOrder($where, 'icao', 'asc')
|
||||
->paginate();
|
||||
|
@ -28,6 +28,8 @@ class Acars extends Model
|
||||
use HashIdTrait;
|
||||
|
||||
public $table = 'acars';
|
||||
|
||||
protected $keyType = 'string';
|
||||
public $incrementing = false;
|
||||
|
||||
public $fillable = [
|
||||
|
@ -30,8 +30,10 @@ class Airport extends Model
|
||||
use FilesTrait;
|
||||
|
||||
public $table = 'airports';
|
||||
public $timestamps = false;
|
||||
|
||||
protected $keyType = 'string';
|
||||
public $incrementing = false;
|
||||
public $timestamps = false;
|
||||
|
||||
protected $fillable = [
|
||||
'id',
|
||||
|
@ -23,7 +23,9 @@ class File extends Model
|
||||
use HashIdTrait;
|
||||
use ReferenceTrait;
|
||||
|
||||
protected $table = 'files';
|
||||
public $table = 'files';
|
||||
|
||||
protected $keyType = 'string';
|
||||
public $incrementing = false;
|
||||
|
||||
protected $fillable = [
|
||||
|
@ -38,12 +38,14 @@ class Flight extends Model
|
||||
use HashIdTrait;
|
||||
|
||||
public $table = 'flights';
|
||||
public $incrementing = false;
|
||||
|
||||
/** The form wants this */
|
||||
public $hours;
|
||||
public $minutes;
|
||||
|
||||
protected $keyType = 'string';
|
||||
public $incrementing = false;
|
||||
|
||||
protected $fillable = [
|
||||
'id',
|
||||
'airline_id',
|
||||
|
@ -4,13 +4,11 @@ namespace App\Models;
|
||||
|
||||
use App\Contracts\Model;
|
||||
|
||||
/**
|
||||
* Class Navdata
|
||||
*/
|
||||
class Navdata extends Model
|
||||
{
|
||||
public $table = 'navdata';
|
||||
|
||||
protected $keyType = 'string';
|
||||
public $timestamps = false;
|
||||
public $incrementing = false;
|
||||
|
||||
|
@ -4,9 +4,6 @@ namespace App\Models;
|
||||
|
||||
use App\Contracts\Model;
|
||||
|
||||
/**
|
||||
* Class News
|
||||
*/
|
||||
class News extends Model
|
||||
{
|
||||
public $table = 'news';
|
||||
|
@ -13,8 +13,6 @@ use Carbon\Carbon;
|
||||
use Illuminate\Support\Collection;
|
||||
|
||||
/**
|
||||
* Class Pirep
|
||||
*
|
||||
* @property string id
|
||||
* @property string flight_number
|
||||
* @property string route_code
|
||||
@ -57,6 +55,8 @@ class Pirep extends Model
|
||||
use HashIdTrait;
|
||||
|
||||
public $table = 'pireps';
|
||||
|
||||
protected $keyType = 'string';
|
||||
public $incrementing = false;
|
||||
|
||||
/** The form wants this */
|
||||
|
@ -5,8 +5,6 @@ namespace App\Models;
|
||||
use App\Contracts\Model;
|
||||
|
||||
/**
|
||||
* Class PirepComment
|
||||
*
|
||||
* @property string pirep_id
|
||||
* @property int user_id
|
||||
*/
|
||||
|
@ -4,9 +4,6 @@ namespace App\Models;
|
||||
|
||||
use App\Contracts\Model;
|
||||
|
||||
/**
|
||||
* Class PirepFare
|
||||
*/
|
||||
class PirepFare extends Model
|
||||
{
|
||||
public $table = 'pirep_fares';
|
||||
|
@ -5,8 +5,6 @@ namespace App\Models;
|
||||
use App\Contracts\Model;
|
||||
|
||||
/**
|
||||
* Class PirepField
|
||||
*
|
||||
* @property string name
|
||||
* @property string slug
|
||||
*/
|
||||
|
@ -6,7 +6,11 @@ use App\Contracts\Model;
|
||||
use App\Models\Enums\PirepFieldSource;
|
||||
|
||||
/**
|
||||
* Class PirepFieldValue
|
||||
* @property string pirep_id
|
||||
* @property string name
|
||||
* @property string slug
|
||||
* @property string value
|
||||
* @property string source
|
||||
*/
|
||||
class PirepFieldValue extends Model
|
||||
{
|
||||
|
@ -5,8 +5,6 @@ namespace App\Models;
|
||||
use App\Contracts\Model;
|
||||
|
||||
/**
|
||||
* Class Rank
|
||||
*
|
||||
* @property string name
|
||||
* @property int hours
|
||||
* @property float manual_base_pay_rate
|
||||
|
@ -5,8 +5,6 @@ namespace App\Models;
|
||||
use App\Contracts\Model;
|
||||
|
||||
/**
|
||||
* Class Setting
|
||||
*
|
||||
* @property string id
|
||||
* @property string name
|
||||
* @property string key
|
||||
@ -19,6 +17,8 @@ use App\Contracts\Model;
|
||||
class Setting extends Model
|
||||
{
|
||||
public $table = 'settings';
|
||||
|
||||
protected $keyType = 'string';
|
||||
public $incrementing = false;
|
||||
|
||||
protected $fillable = [
|
||||
|
@ -4,9 +4,6 @@ namespace App\Models;
|
||||
|
||||
use App\Contracts\Model;
|
||||
|
||||
/**
|
||||
* Class UserAward
|
||||
*/
|
||||
class UserAward extends Model
|
||||
{
|
||||
public $table = 'user_awards';
|
||||
|
@ -2,10 +2,10 @@
|
||||
|
||||
namespace App\Providers;
|
||||
|
||||
use App\Support\TimezonelistExtended;
|
||||
use App\Support\Timezonelist;
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
|
||||
class ExtendedTimezonelistProvider extends ServiceProvider
|
||||
class TimezonelistProvider extends ServiceProvider
|
||||
{
|
||||
/**
|
||||
* Bootstrap services.
|
||||
@ -24,7 +24,7 @@ class ExtendedTimezonelistProvider extends ServiceProvider
|
||||
public function register()
|
||||
{
|
||||
$this->app->singleton('timezonelist', function ($app) {
|
||||
return new TimezonelistExtended();
|
||||
return new Timezonelist();
|
||||
});
|
||||
}
|
||||
}
|
@ -1,12 +1,67 @@
|
||||
<?php
|
||||
/**
|
||||
* MIT License
|
||||
* Copyright (c) 2017 Anh Vũ Đỗ
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
namespace App\Support;
|
||||
|
||||
use DateTimeZone;
|
||||
use Jackiedo\Timezonelist\Timezonelist;
|
||||
|
||||
class TimezonelistExtended extends Timezonelist
|
||||
/**
|
||||
* This library is from:
|
||||
* https://github.com/JackieDo/Timezone-List
|
||||
*
|
||||
* With some changes to suite the formatting, etc that we need
|
||||
*/
|
||||
class Timezonelist
|
||||
{
|
||||
/**
|
||||
* Whitespace seperate
|
||||
*/
|
||||
const WHITESPACE_SEP = ' ';
|
||||
/**
|
||||
* Popular timezones
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $popularTimezones = [
|
||||
'GMT' => 'GMT timezone',
|
||||
'UTC' => 'UTC timezone',
|
||||
];
|
||||
/**
|
||||
* All continents of the world
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $continents = [
|
||||
'Africa' => DateTimeZone::AFRICA,
|
||||
'America' => DateTimeZone::AMERICA,
|
||||
'Antarctica' => DateTimeZone::ANTARCTICA,
|
||||
'Arctic' => DateTimeZone::ARCTIC,
|
||||
'Asia' => DateTimeZone::ASIA,
|
||||
'Atlantic' => DateTimeZone::ATLANTIC,
|
||||
'Australia' => DateTimeZone::AUSTRALIA,
|
||||
'Europe' => DateTimeZone::EUROPE,
|
||||
'Indian' => DateTimeZone::INDIAN,
|
||||
'Pacific' => DateTimeZone::PACIFIC,
|
||||
];
|
||||
|
||||
/**
|
||||
* Format to display timezones
|
||||
*
|
@ -12,49 +12,44 @@
|
||||
"ext-mbstring": "*",
|
||||
"ext-simplexml": "*",
|
||||
"ext-pdo": "*",
|
||||
"composer/composer": "1.8.*",
|
||||
"laravel/framework": "5.8.*",
|
||||
"akaunting/money": "1.0.*",
|
||||
"anhskohbo/no-captcha": "3.0.*",
|
||||
"composer/composer": "~1.8.0",
|
||||
"laravel/framework": "~6.0.0",
|
||||
"akaunting/money": "^1.0",
|
||||
"anhskohbo/no-captcha": "^3.0",
|
||||
"appstract/laravel-opcache": "^2.0",
|
||||
"arrilot/laravel-widgets": "3.13.*",
|
||||
"doctrine/dbal": "2.9.*",
|
||||
"elcobvg/laravel-opcache": "0.4.*",
|
||||
"fzaninotto/faker": "^1.8",
|
||||
"guzzlehttp/guzzle": "6.3.*",
|
||||
"hashids/hashids": "2.0.*",
|
||||
"igaster/laravel-theme": "2.0.*",
|
||||
"arrilot/laravel-widgets": "~3.13.0",
|
||||
"doctrine/dbal": "~2.9.2",
|
||||
"elcobvg/laravel-opcache": "~0.4",
|
||||
"guzzlehttp/guzzle": "~6.3.3",
|
||||
"hashids/hashids": "^2.0.0",
|
||||
"igaster/laravel-theme": "^2.0",
|
||||
"intervention/image": "2.4.*",
|
||||
"irazasyed/laravel-gamp": "1.3.*",
|
||||
"jackiedo/timezonelist": "5.*",
|
||||
"irazasyed/laravel-gamp": "^1.4",
|
||||
"jmikola/geojson": "1.0.*",
|
||||
"joshbrw/laravel-module-installer": "0.1.*",
|
||||
"laracasts/flash": "3.0.*",
|
||||
"laracasts/flash": "^3.0",
|
||||
"laravel/helpers": "^1.0",
|
||||
"laravelcollective/html": "^5.8",
|
||||
"laravelcollective/html": "~6.0.0",
|
||||
"league/csv": "9.2.*",
|
||||
"league/geotools": "0.8.*",
|
||||
"league/iso3166": "2.1.*",
|
||||
"markrogoyski/math-php": "^0.38.0",
|
||||
"myclabs/deep-copy": "1.8.*",
|
||||
"nabeel/vacentral": "2.x",
|
||||
"nwidart/laravel-modules": "5.*",
|
||||
"php-units-of-measure/php-units-of-measure": "2.1.*",
|
||||
"nabeel/vacentral": "~2.0",
|
||||
"nwidart/laravel-modules": "~5.1",
|
||||
"php-units-of-measure/php-units-of-measure": "~2.1.0",
|
||||
"pragmarx/version": "0.2.*",
|
||||
"predis/predis": "1.1.*",
|
||||
"prettus/l5-repository": "2.6.*",
|
||||
"santigarcor/laratrust": "5.2.*",
|
||||
"sebastiaanluca/laravel-helpers": "3.*",
|
||||
"semver/semver": "1.1.*",
|
||||
"spatie/laravel-backup": "6.3.*",
|
||||
"spatie/laravel-pjax": "1.3.*",
|
||||
"spatie/valuestore": "1.2.*",
|
||||
"symfony/polyfill-iconv": "^1.11",
|
||||
"prettus/l5-repository": "~2.6.0",
|
||||
"santigarcor/laratrust": "~5.2.0",
|
||||
"sebastiaanluca/laravel-helpers": "~4.0",
|
||||
"semver/semver": "~1.1.0",
|
||||
"spatie/laravel-backup": "~6.3",
|
||||
"spatie/valuestore": "~1.2.3",
|
||||
"symfony/polyfill-iconv": "~1.12",
|
||||
"theiconic/php-ga-measurement-protocol": "2.7.*",
|
||||
"tivie/php-os-detector": "1.1.*",
|
||||
"toin0u/geotools-laravel": "1.0.*",
|
||||
"waavi/sanitizer": "1.0.*",
|
||||
"webpatser/laravel-uuid": "3.*"
|
||||
"tivie/php-os-detector": "~1.1.0",
|
||||
"webpatser/laravel-uuid": "~3.0",
|
||||
"facade/ignition": "^1.6"
|
||||
},
|
||||
"require-dev": {
|
||||
"barryvdh/laravel-debugbar": "^3.0",
|
||||
@ -62,6 +57,7 @@
|
||||
"bpocallaghan/generators": "5.0.1",
|
||||
"codedungeon/phpunit-result-printer": "^0.13.0",
|
||||
"filp/whoops": "~2.0",
|
||||
"fzaninotto/faker": "~1.8.0",
|
||||
"friendsofphp/php-cs-fixer": "^2.15",
|
||||
"mockery/mockery": "0.9.*",
|
||||
"nunomaduro/collision": "^2.0",
|
||||
|
1076
composer.lock
generated
1076
composer.lock
generated
File diff suppressed because it is too large
Load Diff
@ -68,8 +68,6 @@ return [
|
||||
Laracasts\Flash\FlashServiceProvider::class,
|
||||
Prettus\Repository\Providers\RepositoryServiceProvider::class,
|
||||
SebastiaanLuca\Helpers\Collections\CollectionMacrosServiceProvider::class,
|
||||
Toin0u\Geotools\GeotoolsServiceProvider::class,
|
||||
Jackiedo\Timezonelist\TimezonelistServiceProvider::class,
|
||||
Irazasyed\LaravelGAMP\LaravelGAMPServiceProvider::class,
|
||||
Igaster\LaravelTheme\themeServiceProvider::class,
|
||||
Nwidart\Modules\LaravelModulesServiceProvider::class,
|
||||
@ -84,7 +82,7 @@ return [
|
||||
App\Providers\AuthServiceProvider::class,
|
||||
App\Providers\EventServiceProvider::class,
|
||||
App\Providers\RouteServiceProvider::class,
|
||||
App\Providers\ExtendedTimezonelistProvider::class,
|
||||
App\Providers\TimezonelistProvider::class,
|
||||
App\Providers\MeasurementsProvider::class,
|
||||
App\Providers\BindServiceProviders::class,
|
||||
],
|
||||
@ -106,7 +104,6 @@ return [
|
||||
'Flash' => Laracasts\Flash\Flash::class,
|
||||
'Form' => Collective\Html\FormFacade::class,
|
||||
'Gate' => Illuminate\Support\Facades\Gate::class,
|
||||
'Geotools' => Toin0u\Geotools\Facade\Geotools::class,
|
||||
'Hash' => Illuminate\Support\Facades\Hash::class,
|
||||
'Html' => Collective\Html\HtmlFacade::class,
|
||||
'Lang' => Illuminate\Support\Facades\Lang::class,
|
||||
|
@ -32,9 +32,9 @@ return [
|
||||
'timezone' => '+00:00',
|
||||
'prefix' => '',
|
||||
],
|
||||
'unittest' => [
|
||||
'testing' => [
|
||||
'driver' => 'sqlite',
|
||||
'database' => storage_path('unittest.sqlite'),
|
||||
'database' => storage_path('testing.sqlite'),
|
||||
'timezone' => '+00:00',
|
||||
'prefix' => '',
|
||||
],
|
||||
@ -50,11 +50,19 @@ return [
|
||||
|
||||
'redis' => [
|
||||
'cluster' => false,
|
||||
'client' => 'phpredis',
|
||||
'default' => [
|
||||
'host' => env('REDIS_HOST', 'localhost'),
|
||||
'password' => env('REDIS_PASSWORD', null),
|
||||
'port' => env('REDIS_PORT', 6379),
|
||||
'database' => env('REDIS_DATABASE', 1),
|
||||
],
|
||||
'cache' => [
|
||||
'url' => env('REDIS_URL'),
|
||||
'host' => env('REDIS_HOST', '127.0.0.1'),
|
||||
'password' => env('REDIS_PASSWORD', null),
|
||||
'port' => env('REDIS_PORT', 6379),
|
||||
'database' => env('REDIS_CACHE_DB', 1),
|
||||
],
|
||||
],
|
||||
];
|
||||
|
110
config/ignition.php
Normal file
110
config/ignition.php
Normal file
@ -0,0 +1,110 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Editor
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Choose your preferred editor to use when clicking any edit button.
|
||||
|
|
||||
| Supported: "phpstorm", "vscode", "vscode-insiders",
|
||||
| "sublime", "atom"
|
||||
|
|
||||
*/
|
||||
|
||||
'editor' => env('IGNITION_EDITOR', 'phpstorm'),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Theme
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here you may specify which theme Ignition should use.
|
||||
|
|
||||
| Supported: "light", "dark", "auto"
|
||||
|
|
||||
*/
|
||||
|
||||
'theme' => env('IGNITION_THEME', 'light'),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Sharing
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| You can share local errors with colleagues or others around the world.
|
||||
| Sharing is completely free and doesn't require an account on Flare.
|
||||
|
|
||||
| If necessary, you can completely disable sharing below.
|
||||
|
|
||||
*/
|
||||
|
||||
'enable_share_button' => env('IGNITION_SHARING_ENABLED', true),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Ignored Solution Providers
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| You may specify a list of solution providers (as fully qualified class
|
||||
| names) that shouldn't be loaded. Ignition will ignore these classes
|
||||
| and possible solutions provided by them will never be displayed.
|
||||
|
|
||||
*/
|
||||
|
||||
'ignored_solution_providers' => [
|
||||
//
|
||||
],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Runnable Solutions
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Some solutions that Ignition displays are runnable and can perform
|
||||
| various tasks. Runnable solutions are enabled when your app has
|
||||
| debug mode enabled. You may also fully disable this feature.
|
||||
|
|
||||
*/
|
||||
|
||||
'enable_runnable_solutions' => env('IGNITION_ENABLE_RUNNABLE_SOLUTIONS', null),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Remote Path Mapping
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| If you are using a remote dev server, like Laravel Homestead, Docker, or
|
||||
| even a remote VPS, it will be necessary to specify your path mapping.
|
||||
|
|
||||
| Leaving one, or both of these, empty or null will not trigger the remote
|
||||
| URL changes and Ignition will treat your editor links as local files.
|
||||
|
|
||||
| "remote_sites_path" is an absolute base path for your sites or projects
|
||||
| in Homestead, Vagrant, Docker, or another remote development server.
|
||||
|
|
||||
| Example value: "/home/vagrant/Code"
|
||||
|
|
||||
| "local_sites_path" is an absolute base path for your sites or projects
|
||||
| on your local computer where your IDE or code editor is running on.
|
||||
|
|
||||
| Example values: "/Users/<name>/Code", "C:\Users\<name>\Documents\Code"
|
||||
|
|
||||
*/
|
||||
|
||||
'remote_sites_path' => env('IGNITION_REMOTE_SITES_PATH', ''),
|
||||
'local_sites_path' => env('IGNITION_LOCAL_SITES_PATH', ''),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Housekeeping Endpoint Prefix
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Ignition registers a couple of routes when it is enabled. Below you may
|
||||
| specify a route prefix that will be used to host all internal links.
|
||||
|
|
||||
*/
|
||||
'housekeeping_endpoint_prefix' => '_ignition',
|
||||
|
||||
];
|
24
phpunit.xml
24
phpunit.xml
@ -14,6 +14,9 @@
|
||||
<directory suffix="Test.php">./tests</directory>
|
||||
</testsuite>
|
||||
</testsuites>
|
||||
<extensions>
|
||||
<extension class="Tests\Bootstrap"/>
|
||||
</extensions>
|
||||
<listeners>
|
||||
<listener class="NunoMaduro\Collision\Adapters\Phpunit\Listener"/>
|
||||
</listeners>
|
||||
@ -23,16 +26,21 @@
|
||||
</whitelist>
|
||||
</filter>
|
||||
<php>
|
||||
<env name="APP_ENV" value="unittest"/>
|
||||
<env name="APP_KEY" value="base64:ve66Z5Kt/zTN3p++0zOPu854PHfZkwJE5VuoFAlzHtI="/>
|
||||
<env name="APP_DEBUG" value="true"/>
|
||||
<env name="APP_LOG_LEVEL" value="error"/>
|
||||
<env name="DB_CONNECTION" value="memory"/>
|
||||
<env name="CACHE_DRIVER" value="array"/>
|
||||
<env name="SESSION_DRIVER" value="array"/>
|
||||
<env name="QUEUE_DRIVER" value="sync"/>
|
||||
<ini name="error_reporting" value="E_ALL" />
|
||||
<ini name="display_errors" value="On" />
|
||||
<ini name="display_startup_errors" value="On" />
|
||||
<server name="APP_ENV" value="testing"/>
|
||||
<server name="APP_KEY" value="base64:ve66Z5Kt/zTN3p++0zOPu854PHfZkwJE5VuoFAlzHtI="/>
|
||||
<server name="APP_DEBUG" value="true"/>
|
||||
<server name="APP_LOG_LEVEL" value="error"/>
|
||||
<server name="DB_CONNECTION" value="memory"/>
|
||||
<server name="CACHE_DRIVER" value="array"/>
|
||||
<server name="SESSION_DRIVER" value="array"/>
|
||||
<server name="QUEUE_DRIVER" value="sync"/>
|
||||
<server name="APP_CONFIG_CACHE" value="bootstrap/cache/config.phpunit.php"/>
|
||||
<server name="APP_SERVICES_CACHE" value="bootstrap/cache/services.phpunit.php"/>
|
||||
<server name="APP_PACKAGES_CACHE" value="bootstrap/cache/packages.phpunit.php"/>
|
||||
<server name="APP_ROUTES_CACHE" value="bootstrap/cache/routes.phpunit.php"/>
|
||||
<server name="APP_EVENTS_CACHE" value="bootstrap/cache/events.phpunit.php"/>
|
||||
</php>
|
||||
</phpunit>
|
||||
|
@ -86,6 +86,7 @@ return [
|
||||
|
||||
// Overrides config/logging.php
|
||||
'logging' => [
|
||||
'default' => 'stack',
|
||||
'channels' => [
|
||||
'single' => ['level' => 'debug'],
|
||||
'daily' => ['level' => 'debug'],
|
||||
|
@ -16,7 +16,7 @@
|
||||
<link rel="shortcut icon" type="image/png" href="{{ public_asset('/assets/img/favicon.png') }}"/>
|
||||
<link href="https://fonts.googleapis.com/css?family=Montserrat:400,700,200" rel="stylesheet"/>
|
||||
<link href="{{ public_asset('/assets/frontend/css/bootstrap.min.css') }}" rel="stylesheet"/>
|
||||
<link href="{{ public_asset('/assets/frontend/css/now-ui-kit.css') }}" rel="stylesheet"/>
|
||||
<link href="{{ public_mix('/assets/frontend/css/now-ui-kit.css') }}" rel="stylesheet"/>
|
||||
<link href="{{ public_asset('/assets/frontend/css/styles.css') }}" rel="stylesheet"/>
|
||||
|
||||
{{-- Start of the required files in the head block --}}
|
||||
|
@ -11,7 +11,9 @@
|
||||
<meta content='width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0, shrink-to-fit=no' name='viewport' />
|
||||
<link href="https://fonts.googleapis.com/css?family=Montserrat:400,700,200" rel="stylesheet" />
|
||||
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/latest/css/font-awesome.min.css" />
|
||||
<link href="{{ public_mix('/assets/frontend/css/vendor.min.css') }}" rel="stylesheet" />
|
||||
<link href="{{ public_asset('/assets/frontend/css/bootstrap.min.css') }}" rel="stylesheet"/>
|
||||
<link href="{{ public_mix('/assets/frontend/css/now-ui-kit.css') }}" rel="stylesheet"/>
|
||||
<link href="{{ public_asset('/assets/frontend/css/styles.css') }}" rel="stylesheet"/>
|
||||
@yield('css')
|
||||
</head>
|
||||
|
||||
|
@ -2,80 +2,73 @@
|
||||
@section('title', __('common.login'))
|
||||
|
||||
@section('content')
|
||||
<div class="navbar-translate">
|
||||
<a class="navbar-brand" href="https://demos.creative-tim.com/now-ui-kit/index.html" rel="tooltip"
|
||||
title="Designed by Invision. Coded by Creative Tim" data-placement="bottom" target="_blank">
|
||||
Now Ui Kit
|
||||
</a>
|
||||
<button class="navbar-toggler navbar-toggler" type="button" data-toggle="collapse" data-target="#navigation"
|
||||
aria-controls="navigation-index" aria-expanded="false" aria-label="Toggle navigation">
|
||||
<span class="navbar-toggler-bar top-bar"></span>
|
||||
<span class="navbar-toggler-bar middle-bar"></span>
|
||||
<span class="navbar-toggler-bar bottom-bar"></span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="col-md-4 ml-auto mr-auto content-center">
|
||||
<div class="col-md-4 ml-auto mr-auto content-center">
|
||||
<div class="card card-login card-plain">
|
||||
{{ Form::open(['url' => url('/login'), 'method' => 'post']) }}
|
||||
<div class="header header-primary text-center">
|
||||
<div class="logo-container" style="width: 320px;">
|
||||
<img src="{{ public_asset('/assets/frontend/img/logo.svg') }}" width="320" height="320" style="background: #FFF">
|
||||
</div>
|
||||
</div>
|
||||
<div class="content">
|
||||
<div class="input-group form-group-no-border{{ $errors->has('email') ? ' has-error' : '' }} input-lg">
|
||||
<span class="input-group-addon">
|
||||
<i class="now-ui-icons users_circle-08"></i>
|
||||
</span>
|
||||
{{
|
||||
Form::text('email', old('email'), [
|
||||
'id' => 'email',
|
||||
'placeholder' => __('common.email'),
|
||||
'class' => 'form-control',
|
||||
'required' => true,
|
||||
])
|
||||
}}
|
||||
</div>
|
||||
@if ($errors->has('email'))
|
||||
<span class="help-block">
|
||||
<strong>{{ $errors->first('email') }}</strong>
|
||||
</span>
|
||||
@endif
|
||||
{{ Form::open(['url' => url('/login'), 'method' => 'post']) }}
|
||||
<div class="header header-primary text-center">
|
||||
<div class="logo-container" style="width: 320px;">
|
||||
<img src="{{ public_asset('/assets/frontend/img/logo.svg') }}" width="320" height="320"
|
||||
style="background: #FFF">
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="input-group form-group-no-border{{ $errors->has('email') ? ' has-error' : '' }} input-lg">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text">
|
||||
<i class="now-ui-icons users_circle-08"></i>
|
||||
</span>
|
||||
</div>
|
||||
{{
|
||||
Form::text('email', old('email'), [
|
||||
'id' => 'email',
|
||||
'placeholder' => __('common.email'),
|
||||
'class' => 'form-control',
|
||||
'required' => true,
|
||||
])
|
||||
}}
|
||||
</div>
|
||||
@if ($errors->has('email'))
|
||||
<span class="help-block">
|
||||
<strong>{{ $errors->first('email') }}</strong>
|
||||
</span>
|
||||
@endif
|
||||
|
||||
<div class="input-group form-group-no-border{{ $errors->has('password') ? ' has-error' : '' }} input-lg">
|
||||
<span class="input-group-addon">
|
||||
<i class="now-ui-icons ui-1_lock-circle-open"></i>
|
||||
</span>
|
||||
{{
|
||||
Form::password('password', [
|
||||
'name' => 'password',
|
||||
'class' => 'form-control',
|
||||
'placeholder' => __('auth.password'),
|
||||
'required' => true,
|
||||
])
|
||||
}}
|
||||
</div>
|
||||
@if ($errors->has('password'))
|
||||
<span class="help-block">
|
||||
<strong>{{ $errors->first('password') }}</strong>
|
||||
</span>
|
||||
@endif
|
||||
<div class="input-group form-group-no-border{{ $errors->has('password') ? ' has-error' : '' }} input-lg">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text">
|
||||
<i class="now-ui-icons text_caps-small"></i>
|
||||
</span>
|
||||
</div>
|
||||
{{
|
||||
Form::password('password', [
|
||||
'name' => 'password',
|
||||
'class' => 'form-control',
|
||||
'placeholder' => __('auth.password'),
|
||||
'required' => true,
|
||||
])
|
||||
}}
|
||||
</div>
|
||||
@if ($errors->has('password'))
|
||||
<span class="help-block">
|
||||
<strong>{{ $errors->first('password') }}</strong>
|
||||
</span>
|
||||
@endif
|
||||
|
||||
</div>
|
||||
<div class="footer text-center">
|
||||
<button class="btn btn-primary btn-round btn-lg btn-block">@lang('common.login')</button>
|
||||
</div>
|
||||
<div class="pull-left">
|
||||
<h6>
|
||||
<a href="{{ url('/register') }}" class="link">@lang('auth.createaccount')</a>
|
||||
</h6>
|
||||
</div>
|
||||
<div class="pull-right">
|
||||
<h6>
|
||||
<a href="{{ url('/password/reset') }}" class="link">@lang('auth.forgotpassword')?</a>
|
||||
</h6>
|
||||
</div>
|
||||
{{ Form::close() }}
|
||||
</div>
|
||||
<div class="footer text-center">
|
||||
<button class="btn btn-primary btn-round btn-lg btn-block">@lang('common.login')</button>
|
||||
</div>
|
||||
<div class="pull-left">
|
||||
<h6>
|
||||
<a href="{{ url('/register') }}" class="link">@lang('auth.createaccount')</a>
|
||||
</h6>
|
||||
</div>
|
||||
<div class="pull-right">
|
||||
<h6>
|
||||
<a href="{{ url('/password/reset') }}" class="link">@lang('auth.forgotpassword')?</a>
|
||||
</h6>
|
||||
</div>
|
||||
{{ Form::close() }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
@ -15,8 +15,14 @@
|
||||
@endif
|
||||
|
||||
{{ __('Before proceeding, please check your email for a verification link.') }}
|
||||
{{ __('If you did not receive the email') }}, <a
|
||||
href="{{ route('verification.resend') }}">{{ __('click here to request another') }}</a>.
|
||||
{{ __('If you did not receive the email') }},
|
||||
|
||||
<form class="d-inline" method="POST" action="{{ route('verification.resend') }}">
|
||||
@csrf
|
||||
<button type="submit" class="btn btn-link p-0 m-0 align-baseline">
|
||||
{{ __('click here to request another') }}
|
||||
</button>.
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
39
tests/Bootstrap.php
Normal file
39
tests/Bootstrap.php
Normal file
@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
namespace Tests;
|
||||
|
||||
use Illuminate\Contracts\Console\Kernel;
|
||||
use PHPUnit\Runner\AfterLastTestHook;
|
||||
use PHPUnit\Runner\BeforeFirstTestHook;
|
||||
|
||||
class Bootstrap implements BeforeFirstTestHook, AfterLastTestHook
|
||||
{
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Bootstrap The Test Environment
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| You may specify console commands that execute once before your test is
|
||||
| run. You are free to add your own additional commands or logic into
|
||||
| this file as needed in order to help your test suite run quicker.
|
||||
|
|
||||
*/
|
||||
use CreatesApplication;
|
||||
|
||||
public function executeBeforeFirstTest(): void
|
||||
{
|
||||
$console = $this->createApplication()->make(Kernel::class);
|
||||
$commands = [
|
||||
'config:cache',
|
||||
'event:cache',
|
||||
];
|
||||
foreach ($commands as $command) {
|
||||
$console->call($command);
|
||||
}
|
||||
}
|
||||
|
||||
public function executeAfterLastTest(): void
|
||||
{
|
||||
array_map('unlink', glob('bootstrap/cache/*.phpunit.php'));
|
||||
}
|
||||
}
|
21
tests/CreatesApplication.php
Normal file
21
tests/CreatesApplication.php
Normal file
@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
namespace Tests;
|
||||
|
||||
use Illuminate\Contracts\Console\Kernel;
|
||||
|
||||
trait CreatesApplication
|
||||
{
|
||||
/**
|
||||
* Creates the application.
|
||||
*
|
||||
* @return \Illuminate\Foundation\Application
|
||||
*/
|
||||
public function createApplication()
|
||||
{
|
||||
$app = require __DIR__.'/../bootstrap/app.php';
|
||||
$app->make(Kernel::class)->bootstrap();
|
||||
|
||||
return $app;
|
||||
}
|
||||
}
|
@ -7,14 +7,15 @@ use GuzzleHttp\Handler\MockHandler;
|
||||
use GuzzleHttp\HandlerStack;
|
||||
use GuzzleHttp\Psr7\Response;
|
||||
use Illuminate\Routing\Middleware\ThrottleRequests;
|
||||
use Illuminate\Support\Facades\Artisan;
|
||||
use Illuminate\Support\Facades\Mail;
|
||||
use Tests\CreatesApplication;
|
||||
use Tests\TestData;
|
||||
|
||||
/**
|
||||
* Class TestCase
|
||||
*/
|
||||
class TestCase extends Illuminate\Foundation\Testing\TestCase
|
||||
{
|
||||
use TestData;
|
||||
use CreatesApplication;
|
||||
|
||||
/**
|
||||
* The base URL to use while testing the application.
|
||||
@ -45,8 +46,10 @@ class TestCase extends Illuminate\Foundation\Testing\TestCase
|
||||
ThrottleRequests::class
|
||||
);
|
||||
|
||||
Mail::fake();
|
||||
|
||||
Artisan::call('database:create', ['--reset' => true]);
|
||||
Artisan::call('migrate:refresh', ['--env' => 'unittest']);
|
||||
Artisan::call('migrate:refresh', ['--env' => 'testing']);
|
||||
}
|
||||
|
||||
public function tearDown() : void
|
||||
@ -54,18 +57,6 @@ class TestCase extends Illuminate\Foundation\Testing\TestCase
|
||||
parent::tearDown();
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates the application. Required to be implemented
|
||||
*
|
||||
* @return \Illuminate\Foundation\Application
|
||||
*/
|
||||
public function createApplication()
|
||||
{
|
||||
$app = require __DIR__.'/../bootstrap/app.php';
|
||||
$app->make(Illuminate\Contracts\Console\Kernel::class)->bootstrap();
|
||||
return $app;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $user
|
||||
* @param array $headers
|
||||
|
Loading…
Reference in New Issue
Block a user