Iām setting up the PHP Unit in my Laravel project, but I'm receiving Fatal Error in my first run. Can someone give a help?
I'm running in my Laravel Project, using Laravel 5.2.45, PHP 7.3.2 and PHPUnit 7.2.19. This is my first time trying to do some tests, but I always receive error, when I execute my test.
I expect when I run the phpunit receive the asset true, but I'm receiving the follow error:
PHP Fatal error: Uncaught TypeError: Argument 1 passed to PHPUnit\Runner\BaseTestRunner::getTest() must be of the type string, object given, called in /usr/share/php/PHPUnit/TextUI/Command.php on line 180 and defined in /usr/share/php/PHPUnit/Runner/BaseTestRunner.php:59 Stack trace:
0 /usr/share/php/PHPUnit/TextUI/Command.php(180): PHPUnit\Runner\BaseTestRunner->getTest(Object(PHPUnit\Framework\TestSuite), '', Array)
1 /usr/share/php/PHPUnit/TextUI/Command.php(159): PHPUnit\TextUI\Command->run(Array, true)
2 /usr/bin/phpunit(34): PHPUnit\TextUI\Command::main()
3 {main} thrown in /usr/share/php/PHPUnit/Runner/BaseTestRunner.php on line 59
namespace Tests\Unit;
use Tests\TestCase;
use Illuminate\Foundation\Testing\RefreshDatabase;
class ExampleTest extends TestCase
{
/**
* A basic test example.
*
* @return void
*/
public function testBasicTest()
{
$this->assertTrue(true);
}
}