Skip to content

Cheatsheet

Clio Brichaut edited this page Jan 14, 2023 · 1 revision

URLs

Authentication

There are two seeded test users ready for authentication. Here are their credentials:

  • "james.bond@example.com" - "007" ; this is an internal user, i.e. with access to the endpoint download-losses.
  • "dracula@example.com" - "666" ; this isn't an internal user, i.e. he's forbidden to access that endpoint.

Commands

  • Enter the PHP container with docker exec -it app-laravel.test-1 bash (in powershell).

  • Run PHPUnit with ./vendor/bin/sail artisan test or ./vendor/bin/sail phpunit (in wsl terminal) or ./vendor/bin/phpunit (in the php container).

  • Run PHPStan with ./vendor/bin/phpstan analyze (in the php container).

  • Run PHP-CS-Fixer with ./vendor/bin/php-cs-fixer fix -vvv --show-progress=dots adding --dry-run for preview (in the php container).

  • Regenerate the Swagger documentation with ./vendor/bin/sail artisan l5-swagger:generate (in wsl).

  • Database:

    • Execute pending migrations with ./vendor/bin/sail artisan migrate (in wsl).

    • Apply seeders with ./vendor/bin/sail artisan db:seed (in wsl).

    • Rebuild the whole database and apply all seeders with with ./vendor/bin/sail artisan migrate:refresh --seed (in wsl).

    • Apply any of the above to the test database by adding --env=testing.

Clone this wiki locally