build version 400

This commit is contained in:
Mohit Panjwani
2020-12-02 17:54:08 +05:30
parent 326508e567
commit 89ee58590c
963 changed files with 62887 additions and 48868 deletions

View File

@ -1,27 +1,26 @@
<?php
namespace Tests\Feature;
use Tests\TestCase;
use Illuminate\Foundation\Testing\WithFaker;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Crater\Country;
use SettingsSeeder;
class LocationTest extends TestCase
{
use RefreshDatabase;
use Crater\Models\User;
use Illuminate\Support\Facades\Artisan;
use Laravel\Sanctum\Sanctum;
use function Pest\Laravel\getJson;
public function setUp(): void
{
parent::setUp();
$this->seed();
$this->seed(SettingsSeeder::class);
}
beforeEach(function () {
Artisan::call('db:seed', ['--class' => 'DatabaseSeeder', '--force' => true]);
Artisan::call('db:seed', ['--class' => 'DemoSeeder', '--force' => true]);
/** @test */
public function testGetCountries()
{
$response = $this->json('GET', 'api/countries');
$user = User::find(1);
$this->withHeaders([
'company' => $user->company_id,
]);
Sanctum::actingAs(
$user,
['*']
);
});
$response->assertOk();
}
}
test('get countries', function () {
$response = getJson('api/v1/countries');
$response->assertOk();
});