1
0
mirror of https://github.com/flarum/core.git synced 2025-08-08 01:16:52 +02:00

Improve discussions API tests

This commit is contained in:
Toby Zerner
2015-01-21 12:23:10 +10:30
parent c91c1518d5
commit 21863759e6
2 changed files with 85 additions and 7 deletions

View File

@@ -1,2 +1,33 @@
<?php
// Here you can initialize variables that will be available to your tests
// Set up the default permissions.
// @todo this should be moved to an installation migration-like object which should be called upon
$permissions = [
// Guests can view the forum
['group.2' , 'forum' , 'view'],
// Members can create and reply to discussions + edit their own stuff
['group.3' , 'forum' , 'startDiscussion'],
['group.3' , 'discussion' , 'editOwn'],
['group.3' , 'discussion' , 'reply'],
['group.3' , 'post' , 'editOwn'],
// Moderators can edit + delete stuff and suspend users
['group.4' , 'discussion' , 'delete'],
['group.4' , 'discussion' , 'edit'],
['group.4' , 'post' , 'delete'],
['group.4' , 'post' , 'edit'],
['group.4' , 'user' , 'suspend'],
];
foreach ($permissions as &$permission) {
$permission = [
'grantee' => $permission[0],
'entity' => $permission[1],
'permission' => $permission[2]
];
}
\DB::table('permissions')->truncate();
\DB::table('permissions')->insert($permissions);