From ed54446f873d32d69c7a2e6e58d9fa0ad4302753 Mon Sep 17 00:00:00 2001 From: Jonny Barnes Date: Mon, 19 Oct 2020 19:41:50 +0100 Subject: [PATCH] Follow laravel upgrade guide --- app/Console/Kernel.php | 2 +- app/Exceptions/Handler.php | 1 + app/Http/Kernel.php | 26 +-- .../PreventRequestsDuringMaintenance.php | 17 ++ .../Middleware/RedirectIfAuthenticated.php | 17 +- app/Http/Middleware/TrustHosts.php | 20 +++ app/Models/Bookmark.php | 3 + app/Models/Tag.php | 3 + app/Models/User.php | 2 + app/Providers/AuthServiceProvider.php | 3 +- composer.json | 1 + composer.lock | 157 ++++++++++++++++-- config/app.php | 10 +- config/auth.php | 15 ++ config/cache.php | 5 +- config/database.php | 25 +-- config/filesystems.php | 32 +++- config/hashing.php | 3 + config/image.php | 6 +- config/logging.php | 18 +- config/mail.php | 139 +++++++--------- config/queue.php | 9 +- config/services.php | 12 +- config/session.php | 16 +- database/seeders/BookmarksTableSeeder.php | 17 +- routes/channels.php | 4 +- routes/console.php | 1 + .../Feature/Admin/AdminHomeControllerTest.php | 2 +- tests/Feature/Admin/ArticlesTest.php | 14 +- tests/Feature/Admin/ClientsTest.php | 12 +- tests/Feature/Admin/ContactsTest.php | 22 +-- tests/Feature/Admin/LikesTest.php | 12 +- tests/Feature/Admin/NotesTest.php | 12 +- tests/Feature/Admin/PlacesTest.php | 10 +- tests/Feature/SessionStoreControllerTest.php | 15 -- tests/Feature/ShortURLsControllerTest.php | 6 - tests/Unit/PlacesTest.php | 2 +- 37 files changed, 412 insertions(+), 259 deletions(-) create mode 100644 app/Http/Middleware/PreventRequestsDuringMaintenance.php create mode 100644 app/Http/Middleware/TrustHosts.php delete mode 100644 tests/Feature/SessionStoreControllerTest.php diff --git a/app/Console/Kernel.php b/app/Console/Kernel.php index a6ed6c7c..551ef20a 100644 --- a/app/Console/Kernel.php +++ b/app/Console/Kernel.php @@ -21,7 +21,7 @@ class Kernel extends ConsoleKernel /** * Define the application's command schedule. * - * @param Schedule $schedule + * @param \Illuminate\Console\Scheduling\Schedule $schedule * @return void */ protected function schedule(Schedule $schedule) diff --git a/app/Exceptions/Handler.php b/app/Exceptions/Handler.php index d00054b4..2f7e5fbc 100644 --- a/app/Exceptions/Handler.php +++ b/app/Exceptions/Handler.php @@ -46,6 +46,7 @@ class Handler extends ExceptionHandler * @param Throwable $throwable * @return void * @throws Exception + * @throws Throwable */ public function report(Throwable $throwable) { diff --git a/app/Http/Kernel.php b/app/Http/Kernel.php index 1a0dc77b..6104d941 100644 --- a/app/Http/Kernel.php +++ b/app/Http/Kernel.php @@ -14,8 +14,10 @@ class Kernel extends HttpKernel * @var array */ protected $middleware = [ + // \App\Http\Middleware\TrustHosts::class, \App\Http\Middleware\TrustProxies::class, - \App\Http\Middleware\CheckForMaintenanceMode::class, + \Fruitcake\Cors\HandleCors::class, + \App\Http\Middleware\PreventRequestsDuringMaintenance::class, \Illuminate\Foundation\Http\Middleware\ValidatePostSize::class, \App\Http\Middleware\TrimStrings::class, \Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull::class, @@ -42,8 +44,8 @@ class Kernel extends HttpKernel ], 'api' => [ - 'throttle:60,1', - 'bindings', + 'throttle:api', + \Illuminate\Routing\Middleware\SubstituteBindings::class, ], ]; @@ -57,10 +59,10 @@ class Kernel extends HttpKernel protected $routeMiddleware = [ 'auth' => \App\Http\Middleware\Authenticate::class, 'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class, - 'bindings' => \Illuminate\Routing\Middleware\SubstituteBindings::class, 'cache.headers' => \Illuminate\Http\Middleware\SetCacheHeaders::class, 'can' => \Illuminate\Auth\Middleware\Authorize::class, 'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class, + 'password.confirm' => \Illuminate\Auth\Middleware\RequirePassword::class, 'signed' => \Illuminate\Routing\Middleware\ValidateSignature::class, 'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class, 'verified' => \Illuminate\Auth\Middleware\EnsureEmailIsVerified::class, @@ -68,20 +70,4 @@ class Kernel extends HttpKernel 'myauth' => \App\Http\Middleware\MyAuthMiddleware::class, 'cors' => \App\Http\Middleware\CorsHeaders::class, ]; - - /** - * The priority-sorted list of middleware. - * - * This forces non-global middleware to always be in the given order. - * - * @var array - */ - protected $middlewarePriority = [ - \Illuminate\Session\Middleware\StartSession::class, - \Illuminate\View\Middleware\ShareErrorsFromSession::class, - \App\Http\Middleware\Authenticate::class, - \Illuminate\Session\Middleware\AuthenticateSession::class, - \Illuminate\Routing\Middleware\SubstituteBindings::class, - \Illuminate\Auth\Middleware\Authorize::class, - ]; } diff --git a/app/Http/Middleware/PreventRequestsDuringMaintenance.php b/app/Http/Middleware/PreventRequestsDuringMaintenance.php new file mode 100644 index 00000000..e4956d0b --- /dev/null +++ b/app/Http/Middleware/PreventRequestsDuringMaintenance.php @@ -0,0 +1,17 @@ +check()) { - return redirect('/home'); + $guards = empty($guards) ? [null] : $guards; + + foreach ($guards as $guard) { + if (Auth::guard($guard)->check()) { + return redirect(RouteServiceProvider::HOME); + } } return $next($request); diff --git a/app/Http/Middleware/TrustHosts.php b/app/Http/Middleware/TrustHosts.php new file mode 100644 index 00000000..b0550cfc --- /dev/null +++ b/app/Http/Middleware/TrustHosts.php @@ -0,0 +1,20 @@ +allSubdomainsOfApplicationUrl(), + ]; + } +} diff --git a/app/Models/Bookmark.php b/app/Models/Bookmark.php index 9d472f44..45cefcba 100644 --- a/app/Models/Bookmark.php +++ b/app/Models/Bookmark.php @@ -7,6 +7,7 @@ namespace App\Models; use Eloquent; use Illuminate\Database\Eloquent\Builder; use Illuminate\Database\Eloquent\Collection; +use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Relations\BelongsToMany; use Illuminate\Support\Carbon; @@ -42,6 +43,8 @@ use Illuminate\Support\Carbon; */ class Bookmark extends Model { + use HasFactory; + /** * The attributes that are mass assignable. * diff --git a/app/Models/Tag.php b/app/Models/Tag.php index f049adeb..3e44da31 100644 --- a/app/Models/Tag.php +++ b/app/Models/Tag.php @@ -7,6 +7,7 @@ namespace App\Models; use Eloquent; use Illuminate\Database\Eloquent\Builder; use Illuminate\Database\Eloquent\Collection; +use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Relations\BelongsToMany; use Illuminate\Support\Carbon; @@ -33,6 +34,8 @@ use Illuminate\Support\Carbon; */ class Tag extends Model { + use HasFactory; + /** * We shall set a blacklist of non-modifiable model attributes. * diff --git a/app/Models/User.php b/app/Models/User.php index 2d0c8fb5..6b32bd04 100644 --- a/app/Models/User.php +++ b/app/Models/User.php @@ -6,6 +6,7 @@ namespace App\Models; use Eloquent; use Illuminate\Database\Eloquent\Builder; +use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Foundation\Auth\User as Authenticatable; use Illuminate\Notifications\DatabaseNotification; use Illuminate\Notifications\DatabaseNotificationCollection; @@ -36,6 +37,7 @@ use Illuminate\Support\Carbon; */ class User extends Authenticatable { + use HasFactory; use Notifiable; /** diff --git a/app/Providers/AuthServiceProvider.php b/app/Providers/AuthServiceProvider.php index 686d6023..1252db90 100644 --- a/app/Providers/AuthServiceProvider.php +++ b/app/Providers/AuthServiceProvider.php @@ -3,6 +3,7 @@ namespace App\Providers; use Illuminate\Foundation\Support\Providers\AuthServiceProvider as ServiceProvider; +use Illuminate\Support\Facades\Gate; class AuthServiceProvider extends ServiceProvider { @@ -12,7 +13,7 @@ class AuthServiceProvider extends ServiceProvider * @var array */ protected $policies = [ - // 'App\Model' => 'App\Policies\ModelPolicy', + // 'App\Models\Model' => 'App\Policies\ModelPolicy', ]; /** diff --git a/composer.json b/composer.json index 88b65c84..868d7d05 100644 --- a/composer.json +++ b/composer.json @@ -15,6 +15,7 @@ "ext-dom": "*", "cviebrock/eloquent-sluggable": "^8.0", "fideloper/proxy": "~4.0", + "fruitcake/laravel-cors": "^2.0", "guzzlehttp/guzzle": "^7.0.1", "indieauth/client": "~0.1", "intervention/image": "^2.4", diff --git a/composer.lock b/composer.lock index 61d6f471..415223f0 100644 --- a/composer.lock +++ b/composer.lock @@ -4,8 +4,64 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "c3028e72c591a7b87bca672b158d7e3c", + "content-hash": "cf573bfdecec40388c59b9d24d857126", "packages": [ + { + "name": "asm89/stack-cors", + "version": "v2.0.1", + "source": { + "type": "git", + "url": "https://github.com/asm89/stack-cors.git", + "reference": "23f469e81c65e2fb7fc7bce371fbdc363fe32adf" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/asm89/stack-cors/zipball/23f469e81c65e2fb7fc7bce371fbdc363fe32adf", + "reference": "23f469e81c65e2fb7fc7bce371fbdc363fe32adf", + "shasum": "" + }, + "require": { + "php": "^7.0", + "symfony/http-foundation": "~2.7|~3.0|~4.0|~5.0", + "symfony/http-kernel": "~2.7|~3.0|~4.0|~5.0" + }, + "require-dev": { + "phpunit/phpunit": "^6|^7|^8|^9", + "squizlabs/php_codesniffer": "^3.5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + } + }, + "autoload": { + "psr-4": { + "Asm89\\Stack\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Alexander", + "email": "iam.asm89@gmail.com" + } + ], + "description": "Cross-origin resource sharing library and stack middleware", + "homepage": "https://github.com/asm89/stack-cors", + "keywords": [ + "cors", + "stack" + ], + "support": { + "issues": "https://github.com/asm89/stack-cors/issues", + "source": "https://github.com/asm89/stack-cors/tree/master" + }, + "time": "2020-05-31T07:17:05+00:00" + }, { "name": "aws/aws-sdk-php", "version": "3.158.8", @@ -824,6 +880,83 @@ }, "time": "2020-06-23T01:36:47+00:00" }, + { + "name": "fruitcake/laravel-cors", + "version": "v2.0.2", + "source": { + "type": "git", + "url": "https://github.com/fruitcake/laravel-cors.git", + "reference": "4b19bfc3bd422948af37a42a62fad7f49025894a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/fruitcake/laravel-cors/zipball/4b19bfc3bd422948af37a42a62fad7f49025894a", + "reference": "4b19bfc3bd422948af37a42a62fad7f49025894a", + "shasum": "" + }, + "require": { + "asm89/stack-cors": "^2.0.1", + "illuminate/contracts": "^6|^7|^8", + "illuminate/support": "^6|^7|^8", + "php": ">=7.2", + "symfony/http-foundation": "^4|^5", + "symfony/http-kernel": "^4.3.4|^5" + }, + "require-dev": { + "laravel/framework": "^6|^7|^8", + "orchestra/testbench-dusk": "^4|^5|^6", + "phpunit/phpunit": "^6|^7|^8", + "squizlabs/php_codesniffer": "^3.5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + }, + "laravel": { + "providers": [ + "Fruitcake\\Cors\\CorsServiceProvider" + ] + } + }, + "autoload": { + "psr-4": { + "Fruitcake\\Cors\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fruitcake", + "homepage": "https://fruitcake.nl" + }, + { + "name": "Barry vd. Heuvel", + "email": "barryvdh@gmail.com" + } + ], + "description": "Adds CORS (Cross-Origin Resource Sharing) headers support in your Laravel application", + "keywords": [ + "api", + "cors", + "crossdomain", + "laravel" + ], + "support": { + "issues": "https://github.com/fruitcake/laravel-cors/issues", + "source": "https://github.com/fruitcake/laravel-cors/tree/master" + }, + "funding": [ + { + "url": "https://github.com/barryvdh", + "type": "github" + } + ], + "time": "2020-09-07T11:48:52+00:00" + }, { "name": "graham-campbell/result-type", "version": "v1.0.1", @@ -2022,16 +2155,16 @@ }, { "name": "league/commonmark", - "version": "1.5.5", + "version": "1.5.6", "source": { "type": "git", "url": "https://github.com/thephpleague/commonmark.git", - "reference": "45832dfed6007b984c0d40addfac48d403dc6432" + "reference": "a56e91e0fa1f6d0049153a9c34f63488f6b7ce61" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/commonmark/zipball/45832dfed6007b984c0d40addfac48d403dc6432", - "reference": "45832dfed6007b984c0d40addfac48d403dc6432", + "url": "https://api.github.com/repos/thephpleague/commonmark/zipball/a56e91e0fa1f6d0049153a9c34f63488f6b7ce61", + "reference": "a56e91e0fa1f6d0049153a9c34f63488f6b7ce61", "shasum": "" }, "require": { @@ -2119,7 +2252,7 @@ "type": "tidelift" } ], - "time": "2020-09-13T14:44:46+00:00" + "time": "2020-10-17T21:33:03+00:00" }, { "name": "league/flysystem", @@ -2334,16 +2467,16 @@ }, { "name": "league/mime-type-detection", - "version": "1.5.0", + "version": "1.5.1", "source": { "type": "git", "url": "https://github.com/thephpleague/mime-type-detection.git", - "reference": "ea2fbfc988bade315acd5967e6d02274086d0f28" + "reference": "353f66d7555d8a90781f6f5e7091932f9a4250aa" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/mime-type-detection/zipball/ea2fbfc988bade315acd5967e6d02274086d0f28", - "reference": "ea2fbfc988bade315acd5967e6d02274086d0f28", + "url": "https://api.github.com/repos/thephpleague/mime-type-detection/zipball/353f66d7555d8a90781f6f5e7091932f9a4250aa", + "reference": "353f66d7555d8a90781f6f5e7091932f9a4250aa", "shasum": "" }, "require": { @@ -2373,7 +2506,7 @@ "description": "Mime-type detection for Flysystem", "support": { "issues": "https://github.com/thephpleague/mime-type-detection/issues", - "source": "https://github.com/thephpleague/mime-type-detection/tree/1.5.0" + "source": "https://github.com/thephpleague/mime-type-detection/tree/1.5.1" }, "funding": [ { @@ -2385,7 +2518,7 @@ "type": "tidelift" } ], - "time": "2020-09-21T18:10:53+00:00" + "time": "2020-10-18T11:50:25+00:00" }, { "name": "league/uri-parser", diff --git a/config/app.php b/config/app.php index d63fe83d..220277cc 100644 --- a/config/app.php +++ b/config/app.php @@ -22,7 +22,7 @@ return [ | | This value determines the "environment" your application is currently | running in. This may determine how you prefer to configure various - | services your application utilizes. Set this in your ".env" file. + | services the application utilizes. Set this in your ".env" file. | */ @@ -39,7 +39,7 @@ return [ | */ - 'debug' => env('APP_DEBUG', false), + 'debug' => (bool) env('APP_DEBUG', false), /* |-------------------------------------------------------------------------- @@ -207,6 +207,10 @@ return [ Illuminate\Validation\ValidationServiceProvider::class, Illuminate\View\ViewServiceProvider::class, + /* + * Package Service Providers... + */ + /* * Application Service Providers... */ @@ -238,6 +242,7 @@ return [ 'Artisan' => Illuminate\Support\Facades\Artisan::class, 'Auth' => Illuminate\Support\Facades\Auth::class, 'Blade' => Illuminate\Support\Facades\Blade::class, + 'Broadcast' => Illuminate\Support\Facades\Broadcast::class, 'Bus' => Illuminate\Support\Facades\Bus::class, 'Cache' => Illuminate\Support\Facades\Cache::class, 'Config' => Illuminate\Support\Facades\Config::class, @@ -249,6 +254,7 @@ return [ 'File' => Illuminate\Support\Facades\File::class, 'Gate' => Illuminate\Support\Facades\Gate::class, 'Hash' => Illuminate\Support\Facades\Hash::class, + 'Http' => Illuminate\Support\Facades\Http::class, 'Lang' => Illuminate\Support\Facades\Lang::class, 'Log' => Illuminate\Support\Facades\Log::class, 'Mail' => Illuminate\Support\Facades\Mail::class, diff --git a/config/auth.php b/config/auth.php index 087bbb3e..ba1a4d8c 100644 --- a/config/auth.php +++ b/config/auth.php @@ -44,6 +44,7 @@ return [ 'api' => [ 'driver' => 'token', 'provider' => 'users', + 'hash' => false, ], ], @@ -96,7 +97,21 @@ return [ 'provider' => 'users', 'table' => 'password_resets', 'expire' => 60, + 'throttle' => 60, ], ], + /* + |-------------------------------------------------------------------------- + | Password Confirmation Timeout + |-------------------------------------------------------------------------- + | + | Here you may define the amount of seconds before a password confirmation + | times out and the user is prompted to re-enter their password via the + | confirmation screen. By default, the timeout lasts for three hours. + | + */ + + 'password_timeout' => 10800, + ]; diff --git a/config/cache.php b/config/cache.php index 02e85eef..4f41fdf9 100644 --- a/config/cache.php +++ b/config/cache.php @@ -39,6 +39,7 @@ return [ 'array' => [ 'driver' => 'array', + 'serialize' => false, ], 'database' => [ @@ -73,7 +74,7 @@ return [ 'redis' => [ 'driver' => 'redis', - 'connection' => 'default', + 'connection' => 'cache', ], 'dynamodb' => [ @@ -98,6 +99,6 @@ return [ | */ - 'prefix' => env('CACHE_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_') . '_cache'), + 'prefix' => env('CACHE_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_').'_cache'), ]; diff --git a/config/database.php b/config/database.php index 6bbc22c0..b42d9b30 100644 --- a/config/database.php +++ b/config/database.php @@ -46,7 +46,7 @@ return [ 'mysql' => [ 'driver' => 'mysql', 'url' => env('DATABASE_URL'), - 'host' => env('DB_HOST', 'localhost'), + 'host' => env('DB_HOST', '127.0.0.1'), 'port' => env('DB_PORT', '3306'), 'database' => env('DB_DATABASE', 'forge'), 'username' => env('DB_USERNAME', 'forge'), @@ -66,7 +66,7 @@ return [ 'pgsql' => [ 'driver' => 'pgsql', 'url' => env('DATABASE_URL'), - 'host' => env('DB_HOST', 'localhost'), + 'host' => env('DB_HOST', '127.0.0.1'), 'port' => env('DB_PORT', '5432'), 'database' => env('DB_DATABASE', 'forge'), 'username' => env('DB_USERNAME', 'forge'), @@ -91,17 +91,6 @@ return [ 'prefix_indexes' => true, ], - 'travis' => [ - 'driver' => 'pgsql', - 'host' => 'localhost', - 'database' => 'travis_ci_test', - 'username' => 'travis', - 'password' => '', - 'charset' => 'utf8', - 'prefix' => '', - 'schema' => 'public', - ] - ], /* @@ -134,23 +123,23 @@ return [ 'options' => [ 'cluster' => env('REDIS_CLUSTER', 'redis'), - 'prefix' => env('REDIS_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_') . '_database_'), + 'prefix' => env('REDIS_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_').'_database_'), ], 'default' => [ '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_DB', 0), + 'port' => env('REDIS_PORT', '6379'), + 'database' => env('REDIS_DB', '0'), ], '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), + 'port' => env('REDIS_PORT', '6379'), + 'database' => env('REDIS_CACHE_DB', '1'), ], ], diff --git a/config/filesystems.php b/config/filesystems.php index 5ac4c82b..945b0190 100644 --- a/config/filesystems.php +++ b/config/filesystems.php @@ -8,8 +8,8 @@ return [ |-------------------------------------------------------------------------- | | Here you may specify the default filesystem disk that should be used - | by the framework. A "local" driver, as well as a variety of cloud - | based drivers are available for your choosing. Just store away! + | by the framework. The "local" disk, as well as a variety of cloud + | based disks are available to your application. Just store away! | */ @@ -37,7 +37,7 @@ return [ | may even configure multiple disks of the same driver. Defaults have | been setup for each driver as an example of the required options. | - | Supported Drivers: "local", "ftp", "s3", "rackspace" + | Supported Drivers: "local", "ftp", "sftp", "s3" | */ @@ -57,11 +57,12 @@ return [ 's3' => [ 'driver' => 's3', - 'key' => env('AWS_S3_KEY'), - 'secret' => env('AWS_S3_SECRET'), - 'region' => env('AWS_S3_REGION'), - 'bucket' => env('AWS_S3_BUCKET'), - 'url' => env('AWS_S3_URL'), + 'key' => env('AWS_ACCESS_KEY_ID'), + 'secret' => env('AWS_SECRET_ACCESS_KEY'), + 'region' => env('AWS_DEFAULT_REGION'), + 'bucket' => env('AWS_BUCKET'), + 'url' => env('AWS_URL'), + 'endpoint' => env('AWS_ENDPOINT'), ], 'media' => [ @@ -71,4 +72,19 @@ return [ ], + /* + |-------------------------------------------------------------------------- + | Symbolic Links + |-------------------------------------------------------------------------- + | + | Here you may configure the symbolic links that will be created when the + | `storage:link` Artisan command is executed. The array keys should be + | the locations of the links and the values should be their targets. + | + */ + + 'links' => [ + public_path('storage') => storage_path('app/public'), + ], + ]; diff --git a/config/hashing.php b/config/hashing.php index 58b46f1c..84257708 100644 --- a/config/hashing.php +++ b/config/hashing.php @@ -27,9 +27,11 @@ return [ | to control the amount of time it takes to hash the given password. | */ + 'bcrypt' => [ 'rounds' => env('BCRYPT_ROUNDS', 10), ], + /* |-------------------------------------------------------------------------- | Argon Options @@ -40,6 +42,7 @@ return [ | to control the amount of time it takes to hash the given password. | */ + 'argon' => [ 'memory' => 1024, 'threads' => 2, diff --git a/config/image.php b/config/image.php index eff7cfcd..32ab36a8 100644 --- a/config/image.php +++ b/config/image.php @@ -1,6 +1,6 @@ 'imagick' + 'driver' => 'imagick', -); +]; diff --git a/config/logging.php b/config/logging.php index 61d002e7..e16e0bd7 100644 --- a/config/logging.php +++ b/config/logging.php @@ -37,20 +37,20 @@ return [ 'channels' => [ 'stack' => [ 'driver' => 'stack', - 'channels' => ['daily'], + 'channels' => ['single'], 'ignore_exceptions' => false, ], 'single' => [ 'driver' => 'single', 'path' => storage_path('logs/laravel.log'), - 'level' => 'debug', + 'level' => env('LOG_LEVEL', 'debug'), ], 'daily' => [ 'driver' => 'daily', 'path' => storage_path('logs/laravel.log'), - 'level' => 'debug', + 'level' => env('LOG_LEVEL', 'debug'), 'days' => 14, ], @@ -59,12 +59,12 @@ return [ 'url' => env('LOG_SLACK_WEBHOOK_URL'), 'username' => 'Laravel Log', 'emoji' => ':boom:', - 'level' => 'critical', + 'level' => env('LOG_LEVEL', 'critical'), ], 'papertrail' => [ 'driver' => 'monolog', - 'level' => 'debug', + 'level' => env('LOG_LEVEL', 'debug'), 'handler' => SyslogUdpHandler::class, 'handler_with' => [ 'host' => env('PAPERTRAIL_URL'), @@ -83,18 +83,22 @@ return [ 'syslog' => [ 'driver' => 'syslog', - 'level' => 'debug', + 'level' => env('LOG_LEVEL', 'debug'), ], 'errorlog' => [ 'driver' => 'errorlog', - 'level' => 'debug', + 'level' => env('LOG_LEVEL', 'debug'), ], 'null' => [ 'driver' => 'monolog', 'handler' => NullHandler::class, ], + + 'emergency' => [ + 'path' => storage_path('logs/laravel.log'), + ], ], 'slack' => env('LOG_SLACK_WEBHOOK_URL'), diff --git a/config/mail.php b/config/mail.php index ecefa0e8..54299aab 100644 --- a/config/mail.php +++ b/config/mail.php @@ -4,45 +4,73 @@ return [ /* |-------------------------------------------------------------------------- - | Mail Driver + | Default Mailer |-------------------------------------------------------------------------- | - | Laravel supports both SMTP and PHP's "mail" function as drivers for the - | sending of e-mail. You may specify which one you're using throughout - | your application here. By default, Laravel is setup for SMTP mail. + | This option controls the default mailer that is used to send any email + | messages sent by your application. Alternative mailers may be setup + | and used as needed; however, this mailer will be used by default. | - | Supported: "smtp", "sendmail", "mailgun", "ses" + */ + + 'default' => env('MAIL_MAILER', 'smtp'), + + /* + |-------------------------------------------------------------------------- + | Mailer Configurations + |-------------------------------------------------------------------------- + | + | Here you may configure all of the mailers used by your application plus + | their respective settings. Several examples have been configured for + | you and you are free to add your own as your application requires. + | + | Laravel supports a variety of mail "transport" drivers to be used while + | sending an e-mail. You will specify which one you are using for your + | mailers below. You are free to add additional mailers as required. + | + | Supported: "smtp", "sendmail", "mailgun", "ses", | "postmark", "log", "array" | */ - 'driver' => env('MAIL_DRIVER', 'smtp'), + 'mailers' => [ + 'smtp' => [ + 'transport' => 'smtp', + 'host' => env('MAIL_HOST', 'smtp.mailgun.org'), + 'port' => env('MAIL_PORT', 587), + 'encryption' => env('MAIL_ENCRYPTION', 'tls'), + 'username' => env('MAIL_USERNAME'), + 'password' => env('MAIL_PASSWORD'), + 'timeout' => null, + 'auth_mode' => null, + ], - /* - |-------------------------------------------------------------------------- - | SMTP Host Address - |-------------------------------------------------------------------------- - | - | Here you may provide the host address of the SMTP server used by your - | applications. A default option is provided that is compatible with - | the Mailgun mail service which will provide reliable deliveries. - | - */ + 'ses' => [ + 'transport' => 'ses', + ], - 'host' => env('MAIL_HOST', 'smtp.mailgun.org'), + 'mailgun' => [ + 'transport' => 'mailgun', + ], - /* - |-------------------------------------------------------------------------- - | SMTP Host Port - |-------------------------------------------------------------------------- - | - | This is the SMTP port used by your application to deliver e-mails to - | users of the application. Like the host we have set this value to - | stay compatible with the Mailgun e-mail application by default. - | - */ + 'postmark' => [ + 'transport' => 'postmark', + ], - 'port' => env('MAIL_PORT', 587), + 'sendmail' => [ + 'transport' => 'sendmail', + 'path' => '/usr/sbin/sendmail -bs', + ], + + 'log' => [ + 'transport' => 'log', + 'channel' => env('MAIL_LOG_CHANNEL'), + ], + + 'array' => [ + 'transport' => 'array', + ], + ], /* |-------------------------------------------------------------------------- @@ -54,52 +82,12 @@ return [ | used globally for all e-mails that are sent by your application. | */ + 'from' => [ 'address' => env('MAIL_FROM_ADDRESS', 'hello@example.com'), 'name' => env('MAIL_FROM_NAME', 'Example'), ], - /* - |-------------------------------------------------------------------------- - | E-Mail Encryption Protocol - |-------------------------------------------------------------------------- - | - | Here you may specify the encryption protocol that should be used when - | the application send e-mail messages. A sensible default using the - | transport layer security protocol should provide great security. - | - */ - - 'encryption' => env('MAIL_ENCRYPTION', 'tls'), - - /* - |-------------------------------------------------------------------------- - | SMTP Server Username - |-------------------------------------------------------------------------- - | - | If your SMTP server requires a username for authentication, you should - | set it here. This will get used to authenticate with your server on - | connection. You may also set the "password" value below this one. - | - */ - - 'username' => env('MAIL_USERNAME'), - - 'password' => env('MAIL_PASSWORD'), - - /* - |-------------------------------------------------------------------------- - | Sendmail System Path - |-------------------------------------------------------------------------- - | - | When using the "sendmail" driver to send e-mails, we will need to know - | the path to where Sendmail lives on this server. A default path has - | been provided here, which will work well on most of your systems. - | - */ - - 'sendmail' => '/usr/sbin/sendmail -bs', - /* |-------------------------------------------------------------------------- | Markdown Mail Settings @@ -119,17 +107,4 @@ return [ ], ], - /* - |-------------------------------------------------------------------------- - | Log Channel - |-------------------------------------------------------------------------- - | - | If you are using the "log" driver, you may specify the logging channel - | if you prefer to keep mail messages separate from other log entries - | for simpler reading. Otherwise, the default channel will be used. - | - */ - - 'log_channel' => env('MAIL_LOG_CHANNEL'), - ]; diff --git a/config/queue.php b/config/queue.php index 9d0cf030..12222966 100644 --- a/config/queue.php +++ b/config/queue.php @@ -51,11 +51,12 @@ return [ 'sqs' => [ 'driver' => 'sqs', - 'key' => env('SQS_KEY', 'your-public-key'), - 'secret' => env('SQS_SECRET', 'your-secret-key'), + 'key' => env('AWS_ACCESS_KEY_ID'), + 'secret' => env('AWS_SECRET_ACCESS_KEY'), 'prefix' => env('SQS_PREFIX', 'https://sqs.us-east-1.amazonaws.com/your-account-id'), 'queue' => env('SQS_QUEUE', 'your-queue-name'), - 'region' => env('SQS_REGION', 'us-east-1'), + 'suffix' => env('SQS_SUFFIX'), + 'region' => env('AWS_DEFAULT_REGION', 'us-east-1'), ], 'redis' => [ @@ -80,7 +81,7 @@ return [ */ 'failed' => [ - 'driver' => env('QUEUE_FAILED_DRIVER', 'database'), + 'driver' => env('QUEUE_FAILED_DRIVER', 'database-uuids'), 'database' => env('DB_CONNECTION', 'mysql'), 'table' => 'failed_jobs', ], diff --git a/config/services.php b/config/services.php index 22d494c7..2a1d616c 100644 --- a/config/services.php +++ b/config/services.php @@ -8,9 +8,9 @@ return [ |-------------------------------------------------------------------------- | | This file is for storing the credentials for third party services such - | as Stripe, Mailgun, SparkPost and others. This file provides a sane - | default location for this type of information, allowing packages - | to have a conventional place to find your various credentials. + | as Mailgun, Postmark, AWS and more. This file provides the de facto + | location for this type of information, allowing packages to have + | a conventional file to locate the various service credentials. | */ @@ -25,9 +25,9 @@ return [ ], 'ses' => [ - 'key' => env('SES_KEY'), - 'secret' => env('SES_SECRET'), - 'region' => 'us-east-1', + 'key' => env('AWS_ACCESS_KEY_ID'), + 'secret' => env('AWS_SECRET_ACCESS_KEY'), + 'region' => env('AWS_DEFAULT_REGION', 'us-east-1'), ], ]; diff --git a/config/session.php b/config/session.php index baae68a6..9016f2df 100644 --- a/config/session.php +++ b/config/session.php @@ -92,9 +92,11 @@ return [ | Session Cache Store |-------------------------------------------------------------------------- | - | When using the "apc" or "memcached" session drivers, you may specify a - | cache store that should be used for these sessions. This value must - | correspond with one of the application's configured cache stores. + | While using one of the framework's cache driven session backends you may + | list a cache store that should be used for these sessions. This value + | must match with one of the application's configured cache "stores". + | + | Affects: "apc", "dynamodb", "memcached", "redis" | */ @@ -166,7 +168,7 @@ return [ | */ - 'secure' => env('SESSION_SECURE_COOKIE', null), + 'secure' => env('SESSION_SECURE_COOKIE'), /* |-------------------------------------------------------------------------- @@ -188,12 +190,12 @@ return [ | | This option determines how your cookies behave when cross-site requests | take place, and can be used to mitigate CSRF attacks. By default, we - | do not enable this as other CSRF protection services are in place. + | will set this value to "lax" since this is a secure default value. | - | Supported: "lax", "strict" + | Supported: "lax", "strict", "none", null | */ - 'same_site' => null, + 'same_site' => 'lax', ]; diff --git a/database/seeders/BookmarksTableSeeder.php b/database/seeders/BookmarksTableSeeder.php index d4c0dd2f..2a0ce55a 100644 --- a/database/seeders/BookmarksTableSeeder.php +++ b/database/seeders/BookmarksTableSeeder.php @@ -2,10 +2,8 @@ namespace Database\Seeders; -use Illuminate\Support\Carbon; use App\Models\{Bookmark, Tag}; use Illuminate\Database\Seeder; -use Illuminate\Support\Facades\DB; class BookmarksTableSeeder extends Seeder { @@ -16,17 +14,8 @@ class BookmarksTableSeeder extends Seeder */ public function run() { - Bookmark::factory(10)->create(); - factory(Bookmark::class, 10)->create()->each(function ($bookmark) { - $bookmark->tags()->save(factory(Tag::class)->make()); - - $now = Carbon::now()->subDays(rand(2, 12)); - DB::table('bookmarks') - ->where('id', $bookmark->id) - ->update([ - 'created_at' => $now->toDateTimeString(), - 'updated_at' => $now->toDateTimeString(), - ]); - }); + Bookmark::factory(10) + ->has(Tag::factory()->count(1)) + ->create(); } } diff --git a/routes/channels.php b/routes/channels.php index f16a20b9..5d451e1f 100644 --- a/routes/channels.php +++ b/routes/channels.php @@ -1,5 +1,7 @@ id === (int) $id; }); diff --git a/routes/console.php b/routes/console.php index 75dd0cde..da55196d 100644 --- a/routes/console.php +++ b/routes/console.php @@ -1,6 +1,7 @@ create(); + $user = User::factory()->make(); $response = $this->actingAs($user) ->get('/admin'); diff --git a/tests/Feature/Admin/ArticlesTest.php b/tests/Feature/Admin/ArticlesTest.php index 7a952212..c873a9c8 100644 --- a/tests/Feature/Admin/ArticlesTest.php +++ b/tests/Feature/Admin/ArticlesTest.php @@ -13,7 +13,7 @@ class ArticlesTest extends TestCase public function test_index_page() { - $user = factory(User::class)->create(); + $user = User::factory()->make(); $response = $this->actingAs($user) ->get('/admin/blog'); @@ -22,7 +22,7 @@ class ArticlesTest extends TestCase public function test_create_page() { - $user = factory(User::class)->create(); + $user = User::factory()->make(); $response = $this->actingAs($user) ->get('/admin/blog/create'); @@ -31,7 +31,7 @@ class ArticlesTest extends TestCase public function test_create_new_article() { - $user = factory(User::class)->create(); + $user = User::factory()->make(); $this->actingAs($user) ->post('/admin/blog', [ @@ -43,7 +43,7 @@ class ArticlesTest extends TestCase public function test_create_new_article_with_upload() { - $user = factory(User::class)->create(); + $user = User::factory()->make(); $faker = \Faker\Factory::create(); $text = $faker->text; if ($fh = fopen(sys_get_temp_dir() . '/article.md', 'w')) { @@ -67,7 +67,7 @@ class ArticlesTest extends TestCase public function test_see_edit_form() { - $user = factory(User::class)->create(); + $user = User::factory()->make(); $response = $this->actingAs($user) ->get('/admin/blog/1/edit'); @@ -76,7 +76,7 @@ class ArticlesTest extends TestCase public function test_edit_article() { - $user = factory(User::class)->create(); + $user = User::factory()->make(); $this->actingAs($user) ->post('/admin/blog/1', [ @@ -92,7 +92,7 @@ class ArticlesTest extends TestCase public function test_delete_article() { - $user = factory(User::class)->create(); + $user = User::factory()->make(); $this->actingAs($user) ->post('/admin/blog/1', [ diff --git a/tests/Feature/Admin/ClientsTest.php b/tests/Feature/Admin/ClientsTest.php index bce2729a..ba598012 100644 --- a/tests/Feature/Admin/ClientsTest.php +++ b/tests/Feature/Admin/ClientsTest.php @@ -12,7 +12,7 @@ class ClientsTest extends TestCase public function test_index_page() { - $user = factory(User::class)->create(); + $user = User::factory()->make(); $response = $this->actingAs($user) ->get('/admin/clients'); @@ -21,7 +21,7 @@ class ClientsTest extends TestCase public function test_create_page() { - $user = factory(User::class)->create(); + $user = User::factory()->make(); $response = $this->actingAs($user) ->get('/admin/clients/create'); @@ -30,7 +30,7 @@ class ClientsTest extends TestCase public function test_create_new_client() { - $user = factory(User::class)->create(); + $user = User::factory()->make(); $this->actingAs($user) ->post('/admin/clients', [ @@ -45,7 +45,7 @@ class ClientsTest extends TestCase public function test_see_edit_form() { - $user = factory(User::class)->create(); + $user = User::factory()->make(); $response = $this->actingAs($user) ->get('/admin/clients/1/edit'); @@ -54,7 +54,7 @@ class ClientsTest extends TestCase public function test_edit_client() { - $user = factory(User::class)->create(); + $user = User::factory()->make(); $this->actingAs($user) ->post('/admin/clients/1', [ @@ -70,7 +70,7 @@ class ClientsTest extends TestCase public function test_delete_client() { - $user = factory(User::class)->create(); + $user = User::factory()->make(); $this->actingAs($user) ->post('/admin/clients/1', [ diff --git a/tests/Feature/Admin/ContactsTest.php b/tests/Feature/Admin/ContactsTest.php index 9a5759f9..05dac0e4 100644 --- a/tests/Feature/Admin/ContactsTest.php +++ b/tests/Feature/Admin/ContactsTest.php @@ -27,7 +27,7 @@ class ContactsTest extends TestCase public function test_index_page() { - $user = factory(User::class)->create(); + $user = User::factory()->make(); $response = $this->actingAs($user)->get('/admin/contacts'); $response->assertViewIs('admin.contacts.index'); @@ -35,7 +35,7 @@ class ContactsTest extends TestCase public function test_create_page() { - $user = factory(User::class)->create(); + $user = User::factory()->make(); $response = $this->actingAs($user)->get('/admin/contacts/create'); $response->assertViewIs('admin.contacts.create'); @@ -43,7 +43,7 @@ class ContactsTest extends TestCase public function test_create_new_contact() { - $user = factory(User::class)->create(); + $user = User::factory()->make(); $this->actingAs($user)->post('/admin/contacts', [ 'name' => 'Fred Bloggs', @@ -59,7 +59,7 @@ class ContactsTest extends TestCase public function test_see_edit_form() { - $user = factory(User::class)->create(); + $user = User::factory()->make(); $response = $this->actingAs($user)->get('/admin/contacts/1/edit'); $response->assertViewIs('admin.contacts.edit'); @@ -67,7 +67,7 @@ class ContactsTest extends TestCase public function test_update_contact_no_uploaded_avatar() { - $user = factory(User::class)->create(); + $user = User::factory()->make(); $this->actingAs($user)->post('/admin/contacts/1', [ '_method' => 'PUT', @@ -87,7 +87,7 @@ class ContactsTest extends TestCase copy(__DIR__ . '/../../aaron.png', sys_get_temp_dir() . '/tantek.png'); $path = sys_get_temp_dir() . '/tantek.png'; $file = new UploadedFile($path, 'tantek.png', 'image/png', null, true); - $user = factory(User::class)->create(); + $user = User::factory()->make(); $this->actingAs($user)->post('/admin/contacts/1', [ '_method' => 'PUT', @@ -105,7 +105,7 @@ class ContactsTest extends TestCase public function test_delete_contact() { - $user = factory(User::class)->create(); + $user = User::factory()->make(); $this->actingAs($user)->post('/admin/contacts/1', [ '_method' => 'DELETE', @@ -130,7 +130,7 @@ HTML; $handler = HandlerStack::create($mock); $client = new Client(['handler' => $handler]); $this->app->instance(Client::class, $client); - $user = factory(User::class)->create(); + $user = User::factory()->make(); $this->actingAs($user)->get('/admin/contacts/1/getavatar'); @@ -148,7 +148,7 @@ HTML; $handler = HandlerStack::create($mock); $client = new Client(['handler' => $handler]); $this->app->instance(Client::class, $client); - $user = factory(User::class)->create(); + $user = User::factory()->make(); $response = $this->actingAs($user)->get('/admin/contacts/1/getavatar'); @@ -169,7 +169,7 @@ HTML; $handler = HandlerStack::create($mock); $client = new Client(['handler' => $handler]); $this->app->instance(Client::class, $client); - $user = factory(User::class)->create(); + $user = User::factory()->make(); $response = $this->actingAs($user)->get('/admin/contacts/1/getavatar'); @@ -182,7 +182,7 @@ HTML; 'nick' => 'fred', 'name' => 'Fred Bloggs', ]); - $user = factory(User::class)->create(); + $user = User::factory()->make(); $response = $this->actingAs($user)->get('/admin/contacts/' . $contact->id . '/getavatar'); diff --git a/tests/Feature/Admin/LikesTest.php b/tests/Feature/Admin/LikesTest.php index 5f9eefeb..b6becca2 100644 --- a/tests/Feature/Admin/LikesTest.php +++ b/tests/Feature/Admin/LikesTest.php @@ -15,7 +15,7 @@ class LikesTest extends TestCase public function test_index_page() { - $user = factory(User::class)->create(); + $user = User::factory()->make(); $response = $this->actingAs($user) ->get('/admin/likes'); @@ -24,7 +24,7 @@ class LikesTest extends TestCase public function test_create_page() { - $user = factory(User::class)->create(); + $user = User::factory()->make(); $response = $this->actingAs($user) ->get('/admin/likes/create'); @@ -34,7 +34,7 @@ class LikesTest extends TestCase public function test_create_new_like() { Queue::fake(); - $user = factory(User::class)->create(); + $user = User::factory()->make(); $this->actingAs($user) ->post('/admin/likes', [ @@ -48,7 +48,7 @@ class LikesTest extends TestCase public function test_see_edit_form() { - $user = factory(User::class)->create(); + $user = User::factory()->make(); $response = $this->actingAs($user) ->get('/admin/likes/1/edit'); @@ -58,7 +58,7 @@ class LikesTest extends TestCase public function test_edit_like() { Queue::fake(); - $user = factory(User::class)->create(); + $user = User::factory()->make(); $this->actingAs($user) ->post('/admin/likes/1', [ @@ -75,7 +75,7 @@ class LikesTest extends TestCase { $like = Like::find(1); $url = $like->url; - $user = factory(User::class)->create(); + $user = User::factory()->make(); $this->actingAs($user) ->post('/admin/likes/1', [ diff --git a/tests/Feature/Admin/NotesTest.php b/tests/Feature/Admin/NotesTest.php index 4fc3d68d..b9021a1f 100644 --- a/tests/Feature/Admin/NotesTest.php +++ b/tests/Feature/Admin/NotesTest.php @@ -14,7 +14,7 @@ class NotesTest extends TestCase public function test_index_page() { - $user = factory(User::class)->create(); + $user = User::factory()->make(); $response = $this->actingAs($user)->get('/admin/notes'); $response->assertViewIs('admin.notes.index'); @@ -22,7 +22,7 @@ class NotesTest extends TestCase public function test_create_page() { - $user = factory(User::class)->create(); + $user = User::factory()->make(); $response = $this->actingAs($user)->get('/admin/notes/create'); $response->assertViewIs('admin.notes.create'); @@ -30,7 +30,7 @@ class NotesTest extends TestCase public function test_create_a_new_note() { - $user = factory(User::class)->create(); + $user = User::factory()->make(); $this->actingAs($user)->post('/admin/notes', [ 'content' => 'A new test note', @@ -42,7 +42,7 @@ class NotesTest extends TestCase public function test_edit_page() { - $user = factory(User::class)->create(); + $user = User::factory()->make(); $response = $this->actingAs($user)->get('/admin/notes/1/edit'); $response->assertViewIs('admin.notes.edit'); @@ -51,7 +51,7 @@ class NotesTest extends TestCase public function test_edit_a_note() { Queue::fake(); - $user = factory(User::class)->create(); + $user = User::factory()->make(); $this->actingAs($user)->post('/admin/notes/1', [ '_method' => 'PUT', @@ -67,7 +67,7 @@ class NotesTest extends TestCase public function test_delete_note() { - $user = factory(User::class)->create(); + $user = User::factory()->make(); $this->actingAs($user)->post('/admin/notes/1', [ '_method' => 'DELETE', diff --git a/tests/Feature/Admin/PlacesTest.php b/tests/Feature/Admin/PlacesTest.php index 32de32b6..984f428c 100644 --- a/tests/Feature/Admin/PlacesTest.php +++ b/tests/Feature/Admin/PlacesTest.php @@ -12,7 +12,7 @@ class PlacesTest extends TestCase public function test_index_page() { - $user = factory(User::class)->create(); + $user = User::factory()->make(); $response = $this->actingAs($user)->get('/admin/places'); $response->assertViewIs('admin.places.index'); @@ -20,7 +20,7 @@ class PlacesTest extends TestCase public function test_create_page() { - $user = factory(User::class)->create(); + $user = User::factory()->make(); $response = $this->actingAs($user)->get('/admin/places/create'); $response->assertViewIs('admin.places.create'); @@ -28,7 +28,7 @@ class PlacesTest extends TestCase public function test_create_new_place() { - $user = factory(User::class)->create(); + $user = User::factory()->make(); $this->actingAs($user)->post('/admin/places', [ 'name' => 'Test Place', @@ -44,7 +44,7 @@ class PlacesTest extends TestCase public function test_edit_page() { - $user = factory(User::class)->create(); + $user = User::factory()->make(); $response = $this->actingAs($user)->get('/admin/places/1/edit'); $response->assertViewIs('admin.places.edit'); @@ -52,7 +52,7 @@ class PlacesTest extends TestCase public function test_updating_a_place() { - $user = factory(User::class)->create(); + $user = User::factory()->make(); $this->actingAs($user)->post('/admin/places/1', [ '_method' => 'PUT', diff --git a/tests/Feature/SessionStoreControllerTest.php b/tests/Feature/SessionStoreControllerTest.php deleted file mode 100644 index 36fbaddd..00000000 --- a/tests/Feature/SessionStoreControllerTest.php +++ /dev/null @@ -1,15 +0,0 @@ -post('update-colour-scheme', ['css' => 'some.css']); - $response->assertJson(['status' => 'ok']); - } -} diff --git a/tests/Feature/ShortURLsControllerTest.php b/tests/Feature/ShortURLsControllerTest.php index e26aee76..dfa9b670 100644 --- a/tests/Feature/ShortURLsControllerTest.php +++ b/tests/Feature/ShortURLsControllerTest.php @@ -19,12 +19,6 @@ class ShortURLsControllerTest extends TestCase $response->assertRedirect('https://twitter.com/jonnybarnes'); } - public function test_short_domain_slashplus_redirects_to_googleplus() - { - $response = $this->get('http://' . config('app.shorturl') . '/+'); - $response->assertRedirect('https://plus.google.com/u/0/117317270900655269082/about'); - } - public function test_short_domain_slasht_redirects_to_long_domain_slash_notes() { $response = $this->get('http://' . config('app.shorturl') . '/t/E'); diff --git a/tests/Unit/PlacesTest.php b/tests/Unit/PlacesTest.php index cfc7151f..32fef42a 100644 --- a/tests/Unit/PlacesTest.php +++ b/tests/Unit/PlacesTest.php @@ -64,7 +64,7 @@ class PlacesTest extends TestCase ] ]); $this->assertInstanceOf('App\Models\Place', $ret); // a place was returned - $this->assertEquals(2, count(Place::all())); // still 2 places + $this->assertEquals(12, count(Place::all())); // still 2 places } public function test_service_requires_name()