1
0
mirror of https://github.com/flarum/core.git synced 2025-07-31 21:50:50 +02:00

Tests: Rely on admin user, groups, permissions from test setup script

This commit is contained in:
Franz Liedke
2020-05-20 00:18:00 +02:00
committed by Alexander Skvortsov
parent a47187462d
commit a08fd3e475
27 changed files with 8 additions and 269 deletions

View File

@@ -23,16 +23,6 @@ class CreateTest extends TestCase
parent::setUp();
$this->prepareDatabase([
'users' => [
$this->adminUser(),
$this->normalUser(),
],
'groups' => [
$this->adminGroup()
],
'group_user' => [
['user_id' => 1, 'group_id' => 1],
],
'settings' => [
['key' => 'mail_driver', 'value' => 'log'],
],

View File

@@ -9,7 +9,6 @@
namespace Flarum\Tests\integration\api\users;
use Flarum\Group\Permission;
use Flarum\Tests\integration\RetrievesAuthorizedUsers;
use Flarum\Tests\integration\TestCase;
@@ -17,24 +16,6 @@ class ListTest extends TestCase
{
use RetrievesAuthorizedUsers;
protected function setUp(): void
{
parent::setUp();
$this->prepareDatabase([
'users' => [
$this->adminUser(),
],
'groups' => [
$this->adminGroup(),
$this->guestGroup(),
],
'group_user' => [
['user_id' => 1, 'group_id' => 1],
],
]);
}
/**
* @test
*/

View File

@@ -22,18 +22,8 @@ class ShowTest extends TestCase
$this->prepareDatabase([
'users' => [
$this->adminUser(),
$this->normalUser(),
],
'groups' => [
$this->adminGroup()
],
'group_user' => [
['user_id' => 1, 'group_id' => 1],
],
'settings' => [
['key' => 'mail_driver', 'value' => 'log'],
],
]);
}

View File

@@ -22,20 +22,7 @@ class UpdateTest extends TestCase
$this->prepareDatabase([
'users' => [
$this->adminUser(),
$this->normalUser(),
],
'groups' => [
$this->adminGroup(),
$this->memberGroup(),
],
'group_user' => [
['user_id' => 1, 'group_id' => 1],
['user_id' => 2, 'group_id' => 3],
],
'group_permission' => [
['permission' => 'viewUserList', 'group_id' => 3],
['permission' => 'viewDiscussions', 'group_id' => 3]
]
]);
}