Replies: 2 comments 17 replies
-
Did you have any "dump" function running inside your code? If so please remove the dump function inside your code. I too faced similar issue that dump function stops the tests running without a response. |
Beta Was this translation helpful? Give feedback.
0 replies
-
I'm not 100% sure what do you mean with "dump" function? The issue is, when I ran each test individually, all tests are successful. |
Beta Was this translation helpful? Give feedback.
17 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
this is the first time, I use this discussion here, so please be patient.
I'm having an issue with Laravel / PHPUnit Testing.
I'm using the latest Laravel version (8.82.0) and PHPUnit with version 9.5.13 on PHP 7.4.
I have created 2 units tests in my application, but only one test is being executed when I run
php artisan test
, when I use Laravel'sTestCase
class.Here are my two tests:
WoodWoodConnectionTest:
Here are my two tests:
WoodConcreteConnectionTest:
When I run
php artisan test
it tells me that the testWoodConcreteConnectionTest
is being successful, but the other test is not running.If I create a new test with
php artisan make:test TestTest
, the test will be executed too (that means 2 tests are running successful), but when I changeuse PHPUnit\Framework\TestCase;
to
use Tests\TestCase;
only the
TestTest
is being executed.I already put the tests directly in the
Unit
folder without subfolders etc.I checked the
phpunit.xml
,TestCase
class andCreatesApplication
trait (copied it from the Laravel project source).I described the issue on StackOverflow, too (https://stackoverflow.com/questions/70918132/laravel-testing-only-one-test-is-being-executed-when-running-command-php-arti).
I'm not sure if it is an issue of Laravel or PHPUnit, but when I'm using the PHPUnit's
TestCase
class more than one test is being executed. So I assume it is more a Laravel issue.Are there any other locations in a Laravel project which controls or have influence on testing?
Any help appreciated! Many thanks in advance!
Beta Was this translation helpful? Give feedback.
All reactions