Skip to content

Commit

Permalink
chore
Browse files Browse the repository at this point in the history
  • Loading branch information
DavideIadeluca committed Oct 7, 2024
1 parent 73e7ab7 commit f74ff4e
Showing 1 changed file with 9 additions and 22 deletions.
31 changes: 9 additions & 22 deletions framework/core/tests/integration/api/discussions/CreateTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,13 @@ protected function setUp(): void
$this->normalUser(),
]
]);

$this->extend(
(new Extend\Event())
->listen(\Flarum\Post\Event\Saving::class, function ($event) {
$event->post->content;
})
);
}

/**
Expand Down Expand Up @@ -74,17 +81,7 @@ public function cannot_create_discussion_without_content()
*/
public function cannot_create_discussion_without_content_property()
{
$this->extend(
(new Extend\Formatter)
->unparse(function ($context, $content) {
return $content;
}),

(new Extend\Event())
->listen(\Flarum\Post\Event\Saving::class, function ($event) {
$event->post->content;
})
);
$this->app();

$response = $this->send(
$this->request('POST', '/api/discussions', [
Expand Down Expand Up @@ -120,17 +117,7 @@ public function cannot_create_discussion_without_content_property()
*/
public function cannot_create_discussion_with_content_set_to_null()
{
$this->extend(
(new Extend\Formatter)
->unparse(function ($context, $content) {
return $content;
}),

(new Extend\Event())
->listen(\Flarum\Post\Event\Saving::class, function ($event) {
$event->post->content;
})
);
$this->app();

$response = $this->send(
$this->request('POST', '/api/discussions', [
Expand Down

0 comments on commit f74ff4e

Please sign in to comment.