Skip to content

Commit

Permalink
Apply fixes from StyleCI
Browse files Browse the repository at this point in the history
[ci skip] [skip ci]
  • Loading branch information
StyleCIBot committed Jun 12, 2024
1 parent e1fad91 commit 4533ce7
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 11 deletions.
9 changes: 9 additions & 0 deletions src/CensorGenerator.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
<?php

/*
* This file is part of fof/filter.
*
* Copyright (c) FriendsOfFlarum.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace FoF\Filter;

class CensorGenerator
Expand Down
1 change: 1 addition & 0 deletions src/Listener/CheckPost.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ function ($matches) use (&$isExplicit) {
if ($matches) {
$isExplicit = true;
}

return $matches[0];
},
str_replace(' ', '', $postContent)
Expand Down
24 changes: 16 additions & 8 deletions tests/integration/api/CreatePostTest.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
<?php

/*
* This file is part of fof/filter.
*
* Copyright (c) FriendsOfFlarum.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace FoF\Filter\Tests\integration\api;

use Flarum\Discussion\Discussion;
Expand All @@ -20,11 +29,10 @@ protected function setUp(): void
$this->prepareDatabase([
'users' => [
$this->normalUser(),
]
],
]);

parent::setUp();

}

/**
Expand All @@ -35,13 +43,13 @@ public function create_discussion_without_any_bad_words()
$response = $this->send(
$this->request('POST', '/api/discussions', [
'authenticatedAs' => 2,
'json' => [
'json' => [
'data' => [
'attributes' => [
'title' => 'test - too-obscure',
'title' => 'test - too-obscure',
'content' => 'predetermined content for automated testing - too-obscure',
],
]
],
],
])
);
Expand Down Expand Up @@ -72,13 +80,13 @@ public function create_discussion_with_bad_words()
$response = $this->send(
$this->request('POST', '/api/discussions', [
'authenticatedAs' => 2,
'json' => [
'json' => [
'data' => [
'attributes' => [
'title' => 'test - wibble',
'title' => 'test - wibble',
'content' => 'predetermined content for automated testing - wibble',
],
]
],
],
])
);
Expand Down
8 changes: 5 additions & 3 deletions tests/integration/setup.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
<?php

/*
* This file is part of Flarum.
* This file is part of fof/filter.
*
* For detailed copyright and license information, please view the
* LICENSE file that was distributed with this source code.
* Copyright (c) FriendsOfFlarum.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

use Flarum\Testing\integration\Setup\SetupScript;
Expand Down

0 comments on commit 4533ce7

Please sign in to comment.