diff --git a/framework/core/tests/integration/api/discussions/CreateTest.php b/framework/core/tests/integration/api/discussions/CreateTest.php index ab128ebc6d..7585d9160c 100644 --- a/framework/core/tests/integration/api/discussions/CreateTest.php +++ b/framework/core/tests/integration/api/discussions/CreateTest.php @@ -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; + }) + ); } /** @@ -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', [ @@ -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', [