From 450ca9932569c97715c9f596a244077eb5f01013 Mon Sep 17 00:00:00 2001 From: Franz Liedke Date: Thu, 21 May 2020 22:36:52 +0200 Subject: [PATCH] Boot app explicitly to run seeds in time --- .../core/tests/integration/extenders/ApiControllerTest.php | 4 ++++ .../core/tests/integration/extenders/ApiSerializerTest.php | 2 ++ framework/core/tests/integration/extenders/ModelTest.php | 6 +++++- .../tests/integration/extenders/ModelVisibilityTest.php | 2 ++ framework/core/tests/integration/extenders/PolicyTest.php | 2 ++ framework/core/tests/integration/extenders/UserTest.php | 2 ++ 6 files changed, 17 insertions(+), 1 deletion(-) diff --git a/framework/core/tests/integration/extenders/ApiControllerTest.php b/framework/core/tests/integration/extenders/ApiControllerTest.php index 7b3e21d8f..349622aff 100644 --- a/framework/core/tests/integration/extenders/ApiControllerTest.php +++ b/framework/core/tests/integration/extenders/ApiControllerTest.php @@ -43,6 +43,8 @@ class ApiControllerTest extends TestCase ['id' => 3, 'title' => 'Custom Discussion Title', 'created_at' => Carbon::now()->toDateTimeString(), 'user_id' => 1, 'first_post_id' => 0, 'comment_count' => 1, 'is_private' => 0], ], ]); + + $this->app(); } /** @@ -327,6 +329,8 @@ class ApiControllerTest extends TestCase ]) ); + echo $response->getBody(); + $payload = json_decode($response->getBody(), true); $this->assertArrayHasKey('customSerializer', $payload['data']['attributes']); diff --git a/framework/core/tests/integration/extenders/ApiSerializerTest.php b/framework/core/tests/integration/extenders/ApiSerializerTest.php index 8e3e32236..ad1e3274f 100644 --- a/framework/core/tests/integration/extenders/ApiSerializerTest.php +++ b/framework/core/tests/integration/extenders/ApiSerializerTest.php @@ -42,6 +42,8 @@ class ApiSerializerTest extends TestCase ['id' => 1, 'discussion_id' => 3, 'created_at' => Carbon::now()->toDateTimeString(), 'user_id' => 2, 'type' => 'discussionRenamed', 'content' => '

can i haz relationz?

'], ], ]); + + $this->app(); } /** diff --git a/framework/core/tests/integration/extenders/ModelTest.php b/framework/core/tests/integration/extenders/ModelTest.php index 9d01dc1fb..f4e219975 100644 --- a/framework/core/tests/integration/extenders/ModelTest.php +++ b/framework/core/tests/integration/extenders/ModelTest.php @@ -32,6 +32,8 @@ class ModelTest extends TestCase $this->normalUser(), ], ]); + + $this->app(); } protected function prepPostsHierarchy() @@ -47,6 +49,8 @@ class ModelTest extends TestCase ['id' => 1, 'discussion_id' => 1, 'created_at' => Carbon::now()->toDateTimeString(), 'user_id' => 2, 'type' => 'discussionRenamed', 'content' => '

can i haz relationz?

'], ], ]); + + $this->app(); } /** @@ -161,12 +165,12 @@ class ModelTest extends TestCase }) ); - $this->prepDB(); $this->prepareDatabase([ 'discussions' => [ ['id' => 1, 'title' => __CLASS__, 'created_at' => Carbon::now()->toDateTimeString(), 'user_id' => 1, 'first_post_id' => 1, 'comment_count' => 1] ] ]); + $this->prepDB(); $user = User::find(1); diff --git a/framework/core/tests/integration/extenders/ModelVisibilityTest.php b/framework/core/tests/integration/extenders/ModelVisibilityTest.php index 69ff0820b..d05c98fb7 100644 --- a/framework/core/tests/integration/extenders/ModelVisibilityTest.php +++ b/framework/core/tests/integration/extenders/ModelVisibilityTest.php @@ -39,6 +39,8 @@ class ModelVisibilityTest extends TestCase $this->normalUser(), ] ]); + + $this->app(); } /** diff --git a/framework/core/tests/integration/extenders/PolicyTest.php b/framework/core/tests/integration/extenders/PolicyTest.php index b2f0420b8..082af73e9 100644 --- a/framework/core/tests/integration/extenders/PolicyTest.php +++ b/framework/core/tests/integration/extenders/PolicyTest.php @@ -41,6 +41,8 @@ class PolicyTest extends TestCase ['id' => 1, 'discussion_id' => 1, 'created_at' => Carbon::now()->toDateTimeString(), 'user_id' => 1, 'type' => 'comment', 'content' => '

a normal reply - too-obscure

'], ] ]); + + $this->app(); } /** diff --git a/framework/core/tests/integration/extenders/UserTest.php b/framework/core/tests/integration/extenders/UserTest.php index 473805185..02ce5f00e 100644 --- a/framework/core/tests/integration/extenders/UserTest.php +++ b/framework/core/tests/integration/extenders/UserTest.php @@ -30,6 +30,8 @@ class UserTest extends TestCase ['key' => 'display_name_driver', 'value' => 'custom'], ] ]); + + $this->app(); } protected function registerTestPreference()