mirror of
https://github.com/flarum/core.git
synced 2025-07-20 16:21:18 +02:00
Tests: DB tables no longer need to be truncated
This commit is contained in:
committed by
Alexander Skvortsov
parent
b14da91a98
commit
a42ce7045d
@@ -28,10 +28,6 @@ class WithApiKeyTest extends TestCase
|
|||||||
$this->adminUser(),
|
$this->adminUser(),
|
||||||
$this->normalUser(),
|
$this->normalUser(),
|
||||||
],
|
],
|
||||||
'group_permission' => [
|
|
||||||
['permission' => 'viewUserList', 'group_id' => 3]
|
|
||||||
],
|
|
||||||
'api_keys' => [],
|
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -23,8 +23,6 @@ class CreateTest extends TestCase
|
|||||||
parent::setUp();
|
parent::setUp();
|
||||||
|
|
||||||
$this->prepareDatabase([
|
$this->prepareDatabase([
|
||||||
'discussions' => [],
|
|
||||||
'posts' => [],
|
|
||||||
'users' => [
|
'users' => [
|
||||||
$this->adminUser(),
|
$this->adminUser(),
|
||||||
$this->normalUser(),
|
$this->normalUser(),
|
||||||
|
@@ -25,7 +25,6 @@ class CreateTest extends TestCase
|
|||||||
'discussions' => [
|
'discussions' => [
|
||||||
['id' => 1, 'title' => __CLASS__, 'created_at' => Carbon::now()->toDateTimeString(), 'user_id' => 2],
|
['id' => 1, 'title' => __CLASS__, 'created_at' => Carbon::now()->toDateTimeString(), 'user_id' => 2],
|
||||||
],
|
],
|
||||||
'posts' => [],
|
|
||||||
'users' => [
|
'users' => [
|
||||||
$this->normalUser(),
|
$this->normalUser(),
|
||||||
],
|
],
|
||||||
|
@@ -29,7 +29,6 @@ class ListTest extends TestCase
|
|||||||
$this->adminGroup(),
|
$this->adminGroup(),
|
||||||
$this->guestGroup(),
|
$this->guestGroup(),
|
||||||
],
|
],
|
||||||
'group_permission' => [],
|
|
||||||
'group_user' => [
|
'group_user' => [
|
||||||
['user_id' => 1, 'group_id' => 1],
|
['user_id' => 1, 'group_id' => 1],
|
||||||
],
|
],
|
||||||
|
@@ -21,20 +21,11 @@ class CsrfTest extends TestCase
|
|||||||
'email' => 'test@machine.local',
|
'email' => 'test@machine.local',
|
||||||
];
|
];
|
||||||
|
|
||||||
protected function prepDb()
|
|
||||||
{
|
|
||||||
$this->prepareDatabase([
|
|
||||||
'users' => [],
|
|
||||||
]);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @test
|
* @test
|
||||||
*/
|
*/
|
||||||
public function create_user_post_needs_csrf_token_by_default()
|
public function create_user_post_needs_csrf_token_by_default()
|
||||||
{
|
{
|
||||||
$this->prepDb();
|
|
||||||
|
|
||||||
$response = $this->send(
|
$response = $this->send(
|
||||||
$this->request('POST', '/api/users', [
|
$this->request('POST', '/api/users', [
|
||||||
'json' => [
|
'json' => [
|
||||||
@@ -59,8 +50,6 @@ class CsrfTest extends TestCase
|
|||||||
->exemptPath('/api/users')
|
->exemptPath('/api/users')
|
||||||
);
|
);
|
||||||
|
|
||||||
$this->prepDb();
|
|
||||||
|
|
||||||
$response = $this->send(
|
$response = $this->send(
|
||||||
$this->request('POST', '/api/users', [
|
$this->request('POST', '/api/users', [
|
||||||
'json' => [
|
'json' => [
|
||||||
@@ -122,8 +111,6 @@ class CsrfTest extends TestCase
|
|||||||
->exemptPath('/api/fake/*/up')
|
->exemptPath('/api/fake/*/up')
|
||||||
);
|
);
|
||||||
|
|
||||||
$this->prepDb();
|
|
||||||
|
|
||||||
$response = $this->send(
|
$response = $this->send(
|
||||||
$this->request('POST', '/api/fake/route/i/made/up')
|
$this->request('POST', '/api/fake/route/i/made/up')
|
||||||
);
|
);
|
||||||
|
@@ -32,7 +32,6 @@ class ModelTest extends TestCase
|
|||||||
$this->adminUser(),
|
$this->adminUser(),
|
||||||
$this->normalUser(),
|
$this->normalUser(),
|
||||||
],
|
],
|
||||||
'discussions' => []
|
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user