This repository has been archived by the owner on Oct 13, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7a25b8d
commit 9794e04
Showing
1 changed file
with
53 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
<?php | ||
namespace Tests; | ||
|
||
/* | ||
* general/guest/* | ||
* | ||
* /:get /_id:get | ||
*/ | ||
|
||
use App\Models\ActivityLog; | ||
use App\Models\Guest; | ||
use App\Models\Term; | ||
use App\Models\User; | ||
use Illuminate\Support\Carbon; | ||
use Illuminate\Support\Str; | ||
|
||
class LogTest extends TestCase { | ||
public function testGetPermission() { | ||
// - general | ||
// - exhibition | ||
// - reservation | ||
|
||
foreach (['general', 'exhibition', 'reservation'] as $perm) { | ||
$user = factory(User::class, $perm)->create(); | ||
|
||
$this->actingAs($user)->get('/onsite/general/log'); | ||
$this->assertResponseOk(); | ||
} | ||
|
||
foreach (['blogAdmin', 'admin', 'blogWriter', 'teacher'] as $perm) { | ||
$user = factory(User::class, $perm)->create(); | ||
$this->actingAs($user)->get('/onsite/general/log'); | ||
$this->assertResponseStatus(403); | ||
} | ||
|
||
// $user = factory(User::class, 'general')->create(); | ||
// | ||
// for ($i = 0; $i < $term_count; $i++) { | ||
// $term[] = factory(Term::class)->create(); | ||
// for ($j = 0; $j < $guest_count; $j++) { | ||
// $guest[] = factory(Guest::class)->create([ | ||
// 'term_id' => $term[$i]->id | ||
// ]); | ||
// } | ||
// } | ||
// | ||
// $this->actingAs($user)->get('/onsite/general/guest'); | ||
// $this->assertResponseOk(); | ||
// $this->receiveJson(); | ||
// $res = json_decode($this->response->getContent()); | ||
// $this->assertCount($term_count * $guest_count, $res); | ||
} | ||
} |