Skip to content

Instantly share code, notes, and snippets.

@rizkytegar
Created September 13, 2024 05:44
Show Gist options
  • Save rizkytegar/0e4e2efa5321a10105923745c1530bf3 to your computer and use it in GitHub Desktop.
Save rizkytegar/0e4e2efa5321a10105923745c1530bf3 to your computer and use it in GitHub Desktop.
<?php
namespace Tests\Feature;
use Tests\TestCase;
use Illuminate\Http\Response;
use Illuminate\Support\Facades\DB;
class KategoriAsetControllerTest extends TestCase
{
public function test_tambah_kategori_aset()
{
$response = $this->withHeaders([
'X-CSRF-TOKEN' => csrf_token(),
])->post(route('kategoriaset.save'), [
'kode_kategori' => '001',
'nama_kategori' => '001',
'deskripsi' => '001',
]);
$response->assertStatus(302);
}
public function test_update_kategori_aset()
{
$response = $this->withHeaders([
'X-CSRF-TOKEN' => csrf_token(),
])->post(route('kategoriaset.update'), [
'kode_kategori' => '001',
'nama_kategori' => '002',
'deskripsi' => '002',
]);
$response->assertStatus(302);
}
public function test_delete_kategori_aset()
{
$response = $this->withHeaders([
'X-CSRF-TOKEN' => csrf_token(),
])->delete(route('kategoriaset.delete'), [
'kode_kategori' => '001'
]);
$response->assertStatus(302);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment