Closed ian-patel closed 4 years ago
Looks like you might have some var_dump
in either the tests or working classes.
Easiest way to debug close would be to create a new simple test class with a few assertions
./vendor/bin/phpunit—filter NewTestClass
If you still have troubles, try whipping together a new Laravel app and test again to try and remove any variables.
You can add some more assertions to the example tests that come out of the box and see what happens
I tried with new Test class, it worked fine. Not sure what's wrong with existing tests.
When I use Illuminate\Foundation\Testing\TestCase
that time it print weird.
It was working fine with v0.26.2. Recently I upgraded to v0.28.0.
namespace Tests\Unit;
use Tests\CreatesApplication;
use Illuminate\Foundation\Testing\TestCase; // here
class ExampleTest extends TestCase
{
use CreatesApplication;
/**
* A basic test example.
*
* @return void
*/
public function testBasicTest()
{
$this->assertTrue(true);
}
/**
* A basic test example.
*
* @return void
*/
public function testBasicTest2()
{
$this->assertTrue(true);
}
}
What version of Laravel are you using? What version of PHP are you using?
When it worked as stated above, what TestCase were you using?
Laravel: v7.27.0 PHP: 7.4.9
It was working fine when ExampleTest
was extending PHPUnit\Framework\TestCase
I just created a new testing application and configured as you have defined and all is working as well.
Did you modify either Illuminate\Foundation\Testing\TestCase
or CreateApplication
trait?
Did you modify any other support files?
I am posting my test application here should you want to try, but all seems good on this end
There was empty line before <?php
in one file. That was causing this issue.
Fixed.
Well, I am glad you got things working!
It's not pretty result after upgrade. Checkboxes are not inline.
PHPUnit Pretty Result Printer 0.28.0 PHPUnit 8.5.8 Laravel Framework 7.25.0 MacOS iTerm2 Font: Melso LG L DZ for Powerline