Skip to content

Commit

Permalink
chore: use single extend
Browse files Browse the repository at this point in the history
  • Loading branch information
DavideIadeluca committed Oct 7, 2024
1 parent 89c5462 commit 9582ed4
Showing 1 changed file with 10 additions and 14 deletions.
24 changes: 10 additions & 14 deletions framework/core/tests/integration/api/discussions/CreateTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,14 +79,12 @@ public function cannot_create_discussion_without_content_property()
->unparse(function ($content) {
return $content;
})
);

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

$response = $this->send(
$this->request('POST', '/api/discussions', [
Expand Down Expand Up @@ -122,14 +120,12 @@ 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 ($content) {
// return $content;
// })
// );

$this->extend(
(new Extend\Formatter)
->unparse(function ($content) {
return $content;
})

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

0 comments on commit 9582ed4

Please sign in to comment.