tuandm / laravue

Admin dashboard for enterprise Laravel applications built by VueJS and Element UI https://laravue.dev
https://laravue.dev
MIT License
2.21k stars 653 forks source link

Failed run test/phpunit #233

Closed ganjarsetia closed 4 years ago

ganjarsetia commented 4 years ago

when I run phpunit its failed, if I create new laravel project with same test, its succeed. How to fix this issue?

image

tuandm commented 4 years ago

@ganjarsetia What's your APP_URL in test environment (in .env or .env.testing)? php artisan test or ./vendor/bin/phpunit ./tests/ work in my side (fresh installation).

ganjarsetia commented 4 years ago

@tuandm I'm using .env & .env.testing the contents is same

APP_NAME=Laravel
APP_ENV=local
APP_KEY=base64:q0GwY69KKcboi+QZvW5k4s1imrBJqssk2x2ZVQymhqg=
APP_DEBUG=true
APP_URL=http://localhost

LOG_CHANNEL=stack

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=laravel
DB_USERNAME=root
DB_PASSWORD=

BROADCAST_DRIVER=log
CACHE_DRIVER=file
QUEUE_CONNECTION=sync
SESSION_DRIVER=cookie
SESSION_LIFETIME=120

REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
REDIS_PORT=6379

MAIL_MAILER=smtp
MAIL_HOST=smtp.mailtrap.io
MAIL_PORT=2525
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null
MAIL_FROM_ADDRESS=null
MAIL_FROM_NAME="${APP_NAME}"

AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
AWS_DEFAULT_REGION=us-east-1
AWS_BUCKET=

PUSHER_APP_ID=
PUSHER_APP_KEY=
PUSHER_APP_SECRET=
PUSHER_APP_CLUSTER=mt1
SANCTUM_STATEFUL_DOMAINS=localhost,127.0.0.1,127.0.0.1:8000

MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"

BASE_API=/api
LARAVUE_USE_ESLINT=true
LARAVUE_PATH=
MIX_BASE_API="${BASE_API}"
MIX_LARAVUE_PATH="${LARAVUE_PATH}"

I modified the phpunit.xml just uncomment 2 lines to be like this:

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

After I run php artisan test & ./vendor/bin/phpunit ./tests/ still getting failed.

image

ganjarsetia commented 4 years ago

My PHP version is 7.4

When I run using docker & upgrade the PHP to 7.4, it all works. I think my PHP installation is broken, I will close it now.

tuandm commented 4 years ago

@ganjarsetia You can check storage/logs/laravel.log for the error detail. If you didn't run npm install and npm run dev/watch/production before, you would get the error related to missing manifest file.

ganjarsetia commented 4 years ago

@tuandm sure thanks.

Btw this is OOT. Can I make PR of:

tuandm commented 4 years ago

Thanks @ganjarsetia. PRs are always welcome.