{"id":13828559,"url":"https://github.com/DCzajkowski/auth-tests","last_synced_at":"2025-07-09T06:32:15.125Z","repository":{"id":55490991,"uuid":"105157549","full_name":"DCzajkowski/auth-tests","owner":"DCzajkowski","description":"Always-current tests for Laravel's authentication system. Curated by the community.","archived":false,"fork":false,"pushed_at":"2021-03-05T12:03:31.000Z","size":74,"stargazers_count":237,"open_issues_count":1,"forks_count":26,"subscribers_count":9,"default_branch":"master","last_synced_at":"2024-11-13T03:44:40.798Z","etag":null,"topics":["authentication","feature-testing","laravel","laravel-5-package","laravel-framework","laravel-package","laravel5","laravel5-package","laravel56","php","phpunit","tdd","testing"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DCzajkowski.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-09-28T14:18:10.000Z","updated_at":"2024-09-20T13:02:26.000Z","dependencies_parsed_at":"2022-08-15T01:40:18.287Z","dependency_job_id":null,"html_url":"https://github.com/DCzajkowski/auth-tests","commit_stats":null,"previous_names":[],"tags_count":34,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DCzajkowski%2Fauth-tests","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DCzajkowski%2Fauth-tests/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DCzajkowski%2Fauth-tests/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DCzajkowski%2Fauth-tests/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DCzajkowski","download_url":"https://codeload.github.com/DCzajkowski/auth-tests/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225492420,"owners_count":17482869,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["authentication","feature-testing","laravel","laravel-5-package","laravel-framework","laravel-package","laravel5","laravel5-package","laravel56","php","phpunit","tdd","testing"],"created_at":"2024-08-04T09:02:52.204Z","updated_at":"2024-11-20T08:30:44.952Z","avatar_url":"https://github.com/DCzajkowski.png","language":"PHP","readme":"# Missing tests for Laravel's auth module\n[![Latest Stable Version](https://poser.pugx.org/dczajkowski/auth-tests/version)](https://packagist.org/packages/dczajkowski/auth-tests)\n[![License MIT](https://poser.pugx.org/dczajkowski/auth-tests/license)](https://packagist.org/packages/dczajkowski/auth-tests)\n[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat)](https://egghead.io/courses/how-to-contribute-to-an-open-source-project-on-github)\n\n![](https://i.imgur.com/1z5XkDc.png)\n\n## ⚠️ Deprecation notice ⚠️\nAs of Laravel 8, the [laravel/ui](https://github.com/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.**\n\nAll of the applications already using [laravel/ui](https://github.com/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.\n\nThe new way of installing Laravel 8's and above auth scaffolding is using the `--jet` option in the Laravel installer. Laravel [Jetstream](https://github.com/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](https://github.com/laravel/jetstream/tree/1.x/tests).\n\n## Versioning\n~The version of this package reflects current major version of the Laravel framework. For example:\nIf Laravel framework has version 5.6, version of this package compatible will be `5.6.*`.~\n\nDue 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.*\n\n## Installation\n\u003e Before installation please make sure you have scaffolded\n\u003e frontend views with a `--auth` flag e.g.\n\u003e ```bash\n\u003e composer require laravel/ui \u0026\u0026 php artisan ui vue --auth\n\u003e ```\n\n```bash\ncomposer require dczajkowski/auth-tests --dev\nphp artisan make:auth-tests --without-email-verification\n```\n\nEdit `phpunit.xml` file by adding these two lines between `\u003cphp\u003e` tags:\n```xml\n\u003cserver name=\"DB_CONNECTION\" value=\"sqlite\"/\u003e\n\u003cserver name=\"DB_DATABASE\" value=\":memory:\"/\u003e\n```\nAlternatively, use different database than sqlite, but also different from the one used for development.\n\n### Using the e-mail verification feature\nIf you want to use the e-mail verification feature, you will have to make following changes:\n- update `routes/web.php`:\n```diff\n- Auth::routes();\n+ Auth::routes(['verify' =\u003e true]);\n```\n- update `app/Models/User.php`:\n```diff\n- class User extends Authenticatable\n+ class User extends Authenticatable implements MustVerifyEmail\n```\n\n## Options\nThere 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`)\n```php\n# make:auth-tests\npublic function testUserCanLogout()\n{\n    //\n}\n\n# make:auth-tests --snake-case\npublic function test_user_can_logout()\n{\n    //\n}\n\n# make:auth-tests --annotation\n/** @test */\npublic function userCanLogout()\n{\n    //\n}\n\n# make:auth-tests --public\nfunction testUserCanLogout()\n{\n    //\n}\n\n# make:auth-tests --curly\npublic function testUserCanLogout() {\n    //\n}\n\n# make:auth-tests -caps # or --zonda\n/** @test */\nfunction user_can_logout() {\n    //\n}\n```\nSince version 5.7 there has been a new test for email verification added. You can omit it by running `--without-email-verification`.\n\nTo review all flags run `php artisan make:auth-tests --help`.\n\n## Updating\nTo update tests when a new version of this package arrives:\n```bash\ncomposer update dczajkowski/auth-tests\nphp artisan make:auth-tests\n```\n**Warning! All changes to the files this package provides will be lost when running this command!**\n\n## Automate your workflow\nInstead 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](https://gist.github.com/DCzajkowski/9ebaeaa09d136e77497e060449b03171). Feel free to edit it and reuse however you like.\n\n## Contributing\nFeel free to make PRs to this repo.\n\n## License\nThis package is open-source software licensed under the MIT license (same as Laravel itself).\n","funding_links":[],"categories":["PHP"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FDCzajkowski%2Fauth-tests","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FDCzajkowski%2Fauth-tests","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FDCzajkowski%2Fauth-tests/lists"}