in Laravel I need to run MY CUSTOM COMMAND after refreshdatabase and db:seed
- new database
- migration
- seed
- MY COMMAND
this test finish successfully when i run all these steps manually
I write this test code.
class ExampleTest extends TestCase
{
use RefreshDatabase;
public function testDbSeed()
{
Artisan::call('db:seed');
$resultAsText = Artisan::output();
$this->assertTrue(true);
}
all tables deleted and then run all my migrations successfully.
My question is How to run my CUSTOM command after seed?
php artisan permission:sync
public function testPermissionSync()
{
Artisan::call('permission:sync');
$resultAsText = Artisan::output();
$this->assertTrue(true);
}
after this command we can open main page in ourlocalsite.local/
/**
* A basic test example.
*
* @return void
*/
public function testBasicTest()
{
$response = $this->get('/');
$response->assertStatus(200);
}
but this test not passed and assert error is 403
(when i do these steps manually this command run)