From a42ce7045d36327a360be2502a7903af5dc09ca6 Mon Sep 17 00:00:00 2001 From: Franz Liedke Date: Tue, 19 May 2020 23:37:41 +0200 Subject: [PATCH] Tests: DB tables no longer need to be truncated --- .../api/authentication/WithApiKeyTest.php | 4 ---- .../integration/api/discussions/CreateTest.php | 2 -- .../core/tests/integration/api/posts/CreateTest.php | 1 - .../core/tests/integration/api/users/ListTest.php | 1 - .../core/tests/integration/extenders/CsrfTest.php | 13 ------------- .../core/tests/integration/extenders/ModelTest.php | 1 - 6 files changed, 22 deletions(-) diff --git a/framework/core/tests/integration/api/authentication/WithApiKeyTest.php b/framework/core/tests/integration/api/authentication/WithApiKeyTest.php index 37e9bf3ca..2b5f82ba9 100644 --- a/framework/core/tests/integration/api/authentication/WithApiKeyTest.php +++ b/framework/core/tests/integration/api/authentication/WithApiKeyTest.php @@ -28,10 +28,6 @@ class WithApiKeyTest extends TestCase $this->adminUser(), $this->normalUser(), ], - 'group_permission' => [ - ['permission' => 'viewUserList', 'group_id' => 3] - ], - 'api_keys' => [], ]); } diff --git a/framework/core/tests/integration/api/discussions/CreateTest.php b/framework/core/tests/integration/api/discussions/CreateTest.php index 471bf1a2c..816b1590f 100644 --- a/framework/core/tests/integration/api/discussions/CreateTest.php +++ b/framework/core/tests/integration/api/discussions/CreateTest.php @@ -23,8 +23,6 @@ class CreateTest extends TestCase parent::setUp(); $this->prepareDatabase([ - 'discussions' => [], - 'posts' => [], 'users' => [ $this->adminUser(), $this->normalUser(), diff --git a/framework/core/tests/integration/api/posts/CreateTest.php b/framework/core/tests/integration/api/posts/CreateTest.php index 613810078..f9efe2d32 100644 --- a/framework/core/tests/integration/api/posts/CreateTest.php +++ b/framework/core/tests/integration/api/posts/CreateTest.php @@ -25,7 +25,6 @@ class CreateTest extends TestCase 'discussions' => [ ['id' => 1, 'title' => __CLASS__, 'created_at' => Carbon::now()->toDateTimeString(), 'user_id' => 2], ], - 'posts' => [], 'users' => [ $this->normalUser(), ], diff --git a/framework/core/tests/integration/api/users/ListTest.php b/framework/core/tests/integration/api/users/ListTest.php index 3e33786b4..152ea18f6 100644 --- a/framework/core/tests/integration/api/users/ListTest.php +++ b/framework/core/tests/integration/api/users/ListTest.php @@ -29,7 +29,6 @@ class ListTest extends TestCase $this->adminGroup(), $this->guestGroup(), ], - 'group_permission' => [], 'group_user' => [ ['user_id' => 1, 'group_id' => 1], ], diff --git a/framework/core/tests/integration/extenders/CsrfTest.php b/framework/core/tests/integration/extenders/CsrfTest.php index 3219ab48e..db841e0a0 100644 --- a/framework/core/tests/integration/extenders/CsrfTest.php +++ b/framework/core/tests/integration/extenders/CsrfTest.php @@ -21,20 +21,11 @@ class CsrfTest extends TestCase 'email' => 'test@machine.local', ]; - protected function prepDb() - { - $this->prepareDatabase([ - 'users' => [], - ]); - } - /** * @test */ public function create_user_post_needs_csrf_token_by_default() { - $this->prepDb(); - $response = $this->send( $this->request('POST', '/api/users', [ 'json' => [ @@ -59,8 +50,6 @@ class CsrfTest extends TestCase ->exemptPath('/api/users') ); - $this->prepDb(); - $response = $this->send( $this->request('POST', '/api/users', [ 'json' => [ @@ -122,8 +111,6 @@ class CsrfTest extends TestCase ->exemptPath('/api/fake/*/up') ); - $this->prepDb(); - $response = $this->send( $this->request('POST', '/api/fake/route/i/made/up') ); diff --git a/framework/core/tests/integration/extenders/ModelTest.php b/framework/core/tests/integration/extenders/ModelTest.php index 6f7959e13..5034bf9e1 100644 --- a/framework/core/tests/integration/extenders/ModelTest.php +++ b/framework/core/tests/integration/extenders/ModelTest.php @@ -32,7 +32,6 @@ class ModelTest extends TestCase $this->adminUser(), $this->normalUser(), ], - 'discussions' => [] ]); }