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

Boot app explicitly to run seeds in time

This commit is contained in:
Franz Liedke
2020-05-21 22:36:52 +02:00
committed by Alexander Skvortsov
parent cacc8b4945
commit 008ec95505
6 changed files with 17 additions and 1 deletions

View File

@@ -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], ['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); $payload = json_decode($response->getBody(), true);
$this->assertArrayHasKey('customSerializer', $payload['data']['attributes']); $this->assertArrayHasKey('customSerializer', $payload['data']['attributes']);

View File

@@ -42,6 +42,8 @@ class ApiSerializerTest extends TestCase
['id' => 1, 'discussion_id' => 3, 'created_at' => Carbon::now()->toDateTimeString(), 'user_id' => 2, 'type' => 'discussionRenamed', 'content' => '<t><p>can i haz relationz?</p></t>'], ['id' => 1, 'discussion_id' => 3, 'created_at' => Carbon::now()->toDateTimeString(), 'user_id' => 2, 'type' => 'discussionRenamed', 'content' => '<t><p>can i haz relationz?</p></t>'],
], ],
]); ]);
$this->app();
} }
/** /**

View File

@@ -32,6 +32,8 @@ class ModelTest extends TestCase
$this->normalUser(), $this->normalUser(),
], ],
]); ]);
$this->app();
} }
protected function prepPostsHierarchy() 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' => '<t><p>can i haz relationz?</p></t>'], ['id' => 1, 'discussion_id' => 1, 'created_at' => Carbon::now()->toDateTimeString(), 'user_id' => 2, 'type' => 'discussionRenamed', 'content' => '<t><p>can i haz relationz?</p></t>'],
], ],
]); ]);
$this->app();
} }
/** /**
@@ -161,12 +165,12 @@ class ModelTest extends TestCase
}) })
); );
$this->prepDB();
$this->prepareDatabase([ $this->prepareDatabase([
'discussions' => [ 'discussions' => [
['id' => 1, 'title' => __CLASS__, 'created_at' => Carbon::now()->toDateTimeString(), 'user_id' => 1, 'first_post_id' => 1, 'comment_count' => 1] ['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); $user = User::find(1);

View File

@@ -39,6 +39,8 @@ class ModelVisibilityTest extends TestCase
$this->normalUser(), $this->normalUser(),
] ]
]); ]);
$this->app();
} }
/** /**

View File

@@ -41,6 +41,8 @@ class PolicyTest extends TestCase
['id' => 1, 'discussion_id' => 1, 'created_at' => Carbon::now()->toDateTimeString(), 'user_id' => 1, 'type' => 'comment', 'content' => '<t><p>a normal reply - too-obscure</p></t>'], ['id' => 1, 'discussion_id' => 1, 'created_at' => Carbon::now()->toDateTimeString(), 'user_id' => 1, 'type' => 'comment', 'content' => '<t><p>a normal reply - too-obscure</p></t>'],
] ]
]); ]);
$this->app();
} }
/** /**

View File

@@ -30,6 +30,8 @@ class UserTest extends TestCase
['key' => 'display_name_driver', 'value' => 'custom'], ['key' => 'display_name_driver', 'value' => 'custom'],
] ]
]); ]);
$this->app();
} }
protected function registerTestPreference() protected function registerTestPreference()