All Projects → DCzajkowski → Auth Tests

DCzajkowski / Auth Tests

Licence: mit
Always-current tests for Laravel's authentication system. Curated by the community.

Projects that are alternatives of or similar to Auth Tests

Laravel Settings
Simple Settings package for a laravel application
Stars: ✭ 45 (-80.43%)
Mutual labels:  laravel, laravel-package, laravel-5-package, laravel5
Eye
Eyewitness.io package for Laravel 5 applications
Stars: ✭ 114 (-50.43%)
Mutual labels:  laravel, laravel-package, laravel-5-package, laravel5
Laravel Gitscrum
GitScrum is a Project Management Tool, developed to help entrepreneurs, freelancers, managers, and teams Skyrocket their Productivity with the Agile methodology and Gamification.
Stars: ✭ 2,686 (+1067.83%)
Mutual labels:  laravel, laravel-package, laravel-5-package, laravel-framework
Laravel Email Verification
Laravel package to handle user verification using an activation mail
Stars: ✭ 63 (-72.61%)
Mutual labels:  laravel, laravel-package, laravel-5-package, laravel5
Laraupdater
Enable Laravel App Self-Update. Allow your Laravel Application to auto-update itself.
Stars: ✭ 75 (-67.39%)
Mutual labels:  laravel, laravel-package, laravel-5-package, laravel-framework
Brandenburg
Laravel Authentication Package
Stars: ✭ 79 (-65.65%)
Mutual labels:  laravel, laravel-5-package, laravel-framework, authentication
Laravel Pdf
A Simple package for easily generating PDF documents from HTML. This package is specially for laravel but you can use this without laravel.
Stars: ✭ 79 (-65.65%)
Mutual labels:  laravel, laravel-package, laravel-5-package, laravel5
Blogetc
Easily add a full Laravel blog (with built in admin panel and public views) to your laravel project with this simple package.
Stars: ✭ 198 (-13.91%)
Mutual labels:  laravel, laravel-package, laravel-5-package, laravel-framework
Voyager Frontend
The Missing Front-end for The Missing Laravel Admin 🔥
Stars: ✭ 200 (-13.04%)
Mutual labels:  laravel, laravel-package, laravel-5-package
Laravel Excel
🚀 Supercharged Excel exports and imports in Laravel
Stars: ✭ 10,417 (+4429.13%)
Mutual labels:  laravel, laravel-package, laravel-5-package
Learn Laravel
Laravel 学习资料和开源项目集
Stars: ✭ 229 (-0.43%)
Mutual labels:  laravel, laravel-framework, laravel5
Hooks
Hooks is a extension system for your Laravel application.
Stars: ✭ 202 (-12.17%)
Mutual labels:  laravel, laravel-package, laravel-5-package
Laravel Single Session
This package prevents a User from being logged in more than once. It destroys the previous session when a User logs in and thereby allowing only one session per user.
Stars: ✭ 95 (-58.7%)
Mutual labels:  laravel, laravel-5-package, authentication
Voyager Hooks
Hooks system integrated into Voyager.
Stars: ✭ 200 (-13.04%)
Mutual labels:  laravel, laravel-package, laravel-5-package
Admin One Laravel Dashboard
Admin One — Free Laravel Dashboard (Bulma Buefy Vue.js SPA)
Stars: ✭ 94 (-59.13%)
Mutual labels:  laravel, laravel-package, laravel-framework
Dropzone Laravel Image Upload
Laravel 5.2 and Dropzone.js auto image uploads with removal links
Stars: ✭ 92 (-60%)
Mutual labels:  laravel, laravel-package, laravel-framework
Pagination
🎁 Laravel 5 Custom Pagination Presenter
Stars: ✭ 119 (-48.26%)
Mutual labels:  laravel, laravel-package, laravel-5-package
Sneaker
An easy way to send emails whenever an exception occurs on server.
Stars: ✭ 223 (-3.04%)
Mutual labels:  laravel, laravel-package, laravel-5-package
Laravel Form Builder
Laravel Form builder for version 5+!
Stars: ✭ 1,601 (+596.09%)
Mutual labels:  laravel, laravel-5-package, laravel-framework
Telegram Bot Sdk
🤖 Telegram Bot API PHP SDK. Lets you build Telegram Bots easily! Supports Laravel out of the box.
Stars: ✭ 2,212 (+861.74%)
Mutual labels:  laravel, laravel-package, laravel-5-package

Missing tests for Laravel's auth module

Latest Stable Version License MIT PRs Welcome

⚠️ Deprecation notice ⚠️

As of Laravel 8, the laravel/ui package is discouraged to be used on new Laravel installations. This package should be used only with already-existing, created with Laravel 7 or lower, applications that use laravel/ui auth controllers.

All of the applications already using laravel/ui will get updates of this package to new Laravel versions, although the support may be dropped in the future. This doesn't mean you won't be able to use the package or upgrade to new Laravel versions, but that the upgrades to the major versions may require manual changes from the consumers of this package.

The new way of installing Laravel 8's and above auth scaffolding is using the --jet option in the Laravel installer. Laravel Jetstream hides all of its controllers inside the package, meaning it doesn't make sense to test those controllers, as they are already tested inside the package.

Versioning

The version of this package reflects current major version of the Laravel framework. For example: If Laravel framework has version 5.6, version of this package compatible will be 5.6.*.

Due to changes in Laravel's versioning scheme, version 6.1.* will aim to be compatible with a version 6.1.* of Laravel. For example, auth-tests version 6.1.1 and 6.1.20 will be all compatible with Laravel 6.1.*

Installation

Before installation please make sure you have scaffolded frontend views with a --auth flag e.g.

composer require laravel/ui && php artisan ui vue --auth
composer require dczajkowski/auth-tests --dev
php artisan make:auth-tests --without-email-verification

Edit phpunit.xml file by adding these two lines between <php> tags:

<server name="DB_CONNECTION" value="sqlite"/>
<server name="DB_DATABASE" value=":memory:"/>

Alternatively, use different database than sqlite, but also different from the one used for development.

Using the e-mail verification feature

If you want to use the e-mail verification feature, you will have to make following changes:

  • update routes/web.php:
- Auth::routes();
+ Auth::routes(['verify' => true]);
  • update app/Models/User.php:
- class User extends Authenticatable
+ class User extends Authenticatable implements MustVerifyEmail

Options

There are four flags for customizing your tests. You can use any combination of them. (All flags have their short version e.g. --zonda or -z)

# make:auth-tests
public function testUserCanLogout()
{
    //
}

# make:auth-tests --snake-case
public function test_user_can_logout()
{
    //
}

# make:auth-tests --annotation
/** @test */
public function userCanLogout()
{
    //
}

# make:auth-tests --public
function testUserCanLogout()
{
    //
}

# make:auth-tests --curly
public function testUserCanLogout() {
    //
}

# make:auth-tests -caps # or --zonda
/** @test */
function user_can_logout() {
    //
}

Since version 5.7 there has been a new test for email verification added. You can omit it by running --without-email-verification.

To review all flags run php artisan make:auth-tests --help.

Updating

To update tests when a new version of this package arrives:

composer update dczajkowski/auth-tests
php artisan make:auth-tests

Warning! All changes to the files this package provides will be lost when running this command!

Automate your workflow

Instead of including this package manually every project you create, simply create a bash function that will do that for you. I have included my personal function here. Feel free to edit it and reuse however you like.

Contributing

Feel free to make PRs to this repo.

License

This package is open-source software licensed under the MIT license (same as Laravel itself).

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].