rappasoft / laravel-boilerplate

The Laravel Boilerplate Project - https://laravel-boilerplate.com
https://rappasoft.com
5.59k stars 1.58k forks source link

PHPUnit Test. More test fails than success #1439

Closed kukkuricky closed 4 years ago

kukkuricky commented 4 years ago

FAILURES! Tests: 112, Assertions: 158, Failures: 70. Followed all the steps as mentioned. Though maximum test failed while running ./vendor/bin/phpunit PHP Version: 7.3.5

boiler-plated unittest failed

rappasoft commented 4 years ago

Well what does it say? You can see the last set of tests passing here: https://github.com/rappasoft/laravel-boilerplate/runs/960708992?check_suite_focus=true

faycal1 commented 4 years ago

@kukkuricky If you use postgres you need to remove the id's in seeders users and roles

kukkuricky commented 4 years ago

@rappasoft Yesterday only I downloaded it from https://laravel-boilerplate.com/ and configured all the configuration required as mentioned. And while going through the test it threw those (previously mentioned img) errors.

Few errors out of 70 are like:

Time: 55.71 seconds, Memory: 56.00 MB

✖ There were 70 failures:

1) Tests\Feature\Frontend\VerificationTest::a_user_can_resend_the_verification_email The expected [App\Domains\Auth\Notifications\Frontend\VerifyEmail] notification was not sent. ✖ Failed asserting that false is true.

D:\wamp64\www\laravel-boilerplate-master\vendor\laravel\framework\src\Illuminate\Support\Testing\Fakes\NotificationFake.php:68 D:\wamp64\www\laravel-boilerplate-master\vendor\laravel\framework\src\Illuminate\Support\Facades\Facade.php:261 D:\wamp64\www\laravel-boilerplate-master\tests\Feature\Frontend\VerificationTest.php:48

2) Tests\Feature\Frontend\UserAccountTest::a_user_can_update_their_email_address Response status code [419] is not a redirect status code. ✖ Failed asserting that false is true.

D:\wamp64\www\laravel-boilerplate-master\vendor\laravel\framework\src\Illuminate\Testing\TestResponse.php:201 D:\wamp64\www\laravel-boilerplate-master\tests\Feature\Frontend\UserAccountTest.php:86

3) Tests\Feature\Frontend\UserAccountTest::a_user_can_update_their_profile Response status code [419] is not a redirect status code. ✖ Failed asserting that false is true.

D:\wamp64\www\laravel-boilerplate-master\vendor\laravel\framework\src\Illuminate\Testing\TestResponse.php:201 D:\wamp64\www\laravel-boilerplate-master\tests\Feature\Frontend\UserAccountTest.php:58

4) Tests\Feature\Frontend\UserAccountTest::profile_update_requires_validation Session is missing expected key [errors]. ✖ Failed asserting that false is true.

D:\wamp64\www\laravel-boilerplate-master\vendor\laravel\framework\src\Illuminate\Testing\TestResponse.php:974 D:\wamp64\www\laravel-boilerplate-master\vendor\laravel\framework\src\Illuminate\Testing\TestResponse.php:1049 D:\wamp64\www\laravel-boilerplate-master\tests\Feature\Frontend\UserAccountTest.php:32

5) Tests\Feature\Frontend\ResetPasswordTest::a_user_can_not_use_the_same_password_when_history_is_on_on_password_reset ✖ Failed asserting that false is true.

D:\wamp64\www\laravel-boilerplate-master\tests\Feature\Frontend\ResetPasswordTest.php:129

6) Tests\Feature\Frontend\ResetPasswordTest::a_user_can_use_the_same_password_when_history_is_off_on_password_reset ✖ Failed asserting that '<!DOCTYPE html>\n

And few last error are like: errors-boiler-plate-2

kukkuricky commented 4 years ago

@faycal1 I am using MySql.

rappasoft commented 4 years ago

Hmm. I'd start by making sure you have a mail provider attached for testing (mailtrap). I run the tests in GitHub actions on MySQL and it is all good. It's definitely one issue causing them all i'd say, but you'd have to ddd() the results and see what the actual errors are.

kukkuricky commented 4 years ago

Hmm. I'd start by making sure you have a mail provider attached for testing (mailtrap). I run the tests in GitHub actions on MySQL and it is all good. It's definitely one issue causing them all i'd say, but you'd have to ddd() the results and see what the actual errors are.

Thanks alot @rappasoft . Worked like charm!! All green. (Mail trap setup worked.)