-
-
Notifications
You must be signed in to change notification settings - Fork 836
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: add support for `PgSQL` * chore: generate dump * feat: query exception errors db driver hint * feat: allow defining supported databases * chore: review comments * feat: setting for pgsql preferred search config
- Loading branch information
Showing
76 changed files
with
2,099 additions
and
263 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,8 +11,12 @@ | |
|
||
use Carbon\Carbon; | ||
use Flarum\Approval\Tests\integration\InteractsWithUnapprovedContent; | ||
use Flarum\Discussion\Discussion; | ||
use Flarum\Group\Group; | ||
use Flarum\Post\Post; | ||
use Flarum\Testing\integration\RetrievesAuthorizedUsers; | ||
use Flarum\Testing\integration\TestCase; | ||
use Flarum\User\User; | ||
|
||
class ApprovePostsTest extends TestCase | ||
{ | ||
|
@@ -26,23 +30,23 @@ protected function setUp(): void | |
$this->extension('flarum-approval'); | ||
|
||
$this->prepareDatabase([ | ||
'users' => [ | ||
User::class => [ | ||
['id' => 1, 'username' => 'Muralf', 'email' => '[email protected]', 'is_email_confirmed' => 1], | ||
$this->normalUser(), | ||
['id' => 3, 'username' => 'acme', 'email' => '[email protected]', 'is_email_confirmed' => 1], | ||
['id' => 4, 'username' => 'luceos', 'email' => '[email protected]', 'is_email_confirmed' => 1], | ||
], | ||
'discussions' => [ | ||
Discussion::class => [ | ||
['id' => 1, 'title' => __CLASS__, 'created_at' => Carbon::now(), 'last_posted_at' => Carbon::now(), 'user_id' => 4, 'first_post_id' => 1, 'comment_count' => 1, 'is_approved' => 1], | ||
], | ||
'posts' => [ | ||
['id' => 1, 'discussion_id' => 1, 'user_id' => 4, 'type' => 'comment', 'content' => '<t><p>Text</p></t>', 'hidden_at' => 0, 'is_approved' => 1, 'number' => 1], | ||
['id' => 2, 'discussion_id' => 1, 'user_id' => 4, 'type' => 'comment', 'content' => '<t><p>Text</p></t>', 'hidden_at' => 0, 'is_approved' => 1, 'number' => 2], | ||
['id' => 3, 'discussion_id' => 1, 'user_id' => 4, 'type' => 'comment', 'content' => '<t><p>Text</p></t>', 'hidden_at' => 0, 'is_approved' => 0, 'number' => 3], | ||
Post::class => [ | ||
['id' => 1, 'discussion_id' => 1, 'user_id' => 4, 'type' => 'comment', 'content' => '<t><p>Text</p></t>', 'hidden_at' => null, 'is_approved' => 1, 'number' => 1], | ||
['id' => 2, 'discussion_id' => 1, 'user_id' => 4, 'type' => 'comment', 'content' => '<t><p>Text</p></t>', 'hidden_at' => null, 'is_approved' => 1, 'number' => 2], | ||
['id' => 3, 'discussion_id' => 1, 'user_id' => 4, 'type' => 'comment', 'content' => '<t><p>Text</p></t>', 'hidden_at' => null, 'is_approved' => 0, 'number' => 3], | ||
['id' => 4, 'discussion_id' => 1, 'user_id' => 4, 'type' => 'comment', 'content' => '<t><p>Text</p></t>', 'hidden_at' => Carbon::now(), 'is_approved' => 1, 'number' => 4], | ||
['id' => 5, 'discussion_id' => 1, 'user_id' => 4, 'type' => 'comment', 'content' => '<t><p>Text</p></t>', 'hidden_at' => 0, 'is_approved' => 0, 'number' => 5], | ||
['id' => 5, 'discussion_id' => 1, 'user_id' => 4, 'type' => 'comment', 'content' => '<t><p>Text</p></t>', 'hidden_at' => null, 'is_approved' => 0, 'number' => 5], | ||
], | ||
'groups' => [ | ||
Group::class => [ | ||
['id' => 4, 'name_singular' => 'Acme', 'name_plural' => 'Acme', 'is_hidden' => 0], | ||
['id' => 5, 'name_singular' => 'Acme', 'name_plural' => 'Acme', 'is_hidden' => 0], | ||
], | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,9 +11,12 @@ | |
|
||
use Carbon\Carbon; | ||
use Flarum\Approval\Tests\integration\InteractsWithUnapprovedContent; | ||
use Flarum\Discussion\Discussion; | ||
use Flarum\Group\Group; | ||
use Flarum\Post\Post; | ||
use Flarum\Testing\integration\RetrievesAuthorizedUsers; | ||
use Flarum\Testing\integration\TestCase; | ||
use Flarum\User\User; | ||
|
||
class CreatePostsTest extends TestCase | ||
{ | ||
|
@@ -27,18 +30,18 @@ protected function setUp(): void | |
$this->extension('flarum-flags', 'flarum-approval'); | ||
|
||
$this->prepareDatabase([ | ||
'users' => [ | ||
User::class => [ | ||
['id' => 1, 'username' => 'Muralf', 'email' => '[email protected]', 'is_email_confirmed' => 1], | ||
$this->normalUser(), | ||
['id' => 3, 'username' => 'acme', 'email' => '[email protected]', 'is_email_confirmed' => 1], | ||
['id' => 4, 'username' => 'luceos', 'email' => '[email protected]', 'is_email_confirmed' => 1], | ||
], | ||
'discussions' => [ | ||
Discussion::class => [ | ||
['id' => 1, 'title' => __CLASS__, 'created_at' => Carbon::now(), 'last_posted_at' => Carbon::now(), 'user_id' => 4, 'first_post_id' => 1, 'comment_count' => 1, 'is_approved' => 1], | ||
['id' => 2, 'title' => __CLASS__, 'created_at' => Carbon::now(), 'last_posted_at' => Carbon::now(), 'user_id' => 4, 'first_post_id' => 2, 'comment_count' => 1, 'is_approved' => 0], | ||
['id' => 3, 'title' => __CLASS__, 'created_at' => Carbon::now(), 'last_posted_at' => Carbon::now(), 'user_id' => 4, 'first_post_id' => 3, 'comment_count' => 1, 'is_approved' => 0], | ||
], | ||
'posts' => [ | ||
Post::class => [ | ||
['id' => 1, 'discussion_id' => 1, 'user_id' => 4, 'type' => 'comment', 'content' => '<t><p>Text</p></t>', 'is_private' => 0, 'is_approved' => 1, 'number' => 1], | ||
['id' => 2, 'discussion_id' => 1, 'user_id' => 4, 'type' => 'comment', 'content' => '<t><p>Text</p></t>', 'is_private' => 0, 'is_approved' => 1, 'number' => 2], | ||
['id' => 3, 'discussion_id' => 1, 'user_id' => 4, 'type' => 'comment', 'content' => '<t><p>Text</p></t>', 'is_private' => 0, 'is_approved' => 1, 'number' => 3], | ||
|
@@ -49,7 +52,7 @@ protected function setUp(): void | |
['id' => 8, 'discussion_id' => 3, 'user_id' => 4, 'type' => 'comment', 'content' => '<t><p>Text</p></t>', 'is_private' => 0, 'is_approved' => 1, 'number' => 2], | ||
['id' => 9, 'discussion_id' => 3, 'user_id' => 4, 'type' => 'comment', 'content' => '<t><p>Text</p></t>', 'is_private' => 0, 'is_approved' => 0, 'number' => 3], | ||
], | ||
'groups' => [ | ||
Group::class => [ | ||
['id' => 4, 'name_singular' => 'Acme', 'name_plural' => 'Acme', 'is_hidden' => 0], | ||
['id' => 5, 'name_singular' => 'Acme', 'name_plural' => 'Acme', 'is_hidden' => 0], | ||
], | ||
|
@@ -60,6 +63,7 @@ protected function setUp(): void | |
'group_permission' => [ | ||
['group_id' => 4, 'permission' => 'discussion.startWithoutApproval'], | ||
['group_id' => 5, 'permission' => 'discussion.replyWithoutApproval'], | ||
['group_id' => Group::MEMBER_ID, 'permission' => 'postWithoutThrottle'], | ||
] | ||
]); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.