Skip to content
Projects
Groups
Snippets
Help
Sign in / Register
Toggle navigation
Minds Backend - Engine
Project overview
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Locked Files
Issues
281
Merge Requests
38
CI / CD
Security & Compliance
Packages
Wiki
Snippets
Members
Collapse sidebar
Close sidebar
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Minds
Minds Backend - Engine
Commits
b82f1fd9
Commit
b82f1fd9
authored
12 minutes ago
by
Mark Harding
Browse files
Options
Download
(fix): failing tests
parent
cf1ddd5e
fix/spam-detection-return-1104
1 merge request
!391
[Sprint/RollingRabbit](fix): Updated returned exception of offending spam link. #1104
Pipeline
#98607706
passed with stages
in 6 minutes and 53 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
1 addition
and
49 deletions
+1
-49
Core/Security/Spam.php
View file @
b82f1fd9
...
...
@@ -13,7 +13,7 @@ class Spam
* @param mixed $entity
* @return bool
*/
public
function
check
(
$entity
)
:
bool
public
function
check
(
$entity
)
:
?
bool
{
$foundSpam
=
false
;
...
...
This diff is collapsed.
Spec/Core/Security/SpamSpec.php
View file @
b82f1fd9
...
...
@@ -23,12 +23,6 @@ class SpamSpec extends ObjectBehavior
Blog
$blog
,
ProhibitedDomains
$prohibitedDomains
)
{
$prohibitedDomains
->
get
()
->
shouldBeCalled
()
->
willReturn
([
'bit.ly'
]);
$this
->
beConstructedWith
(
$prohibitedDomains
);
$blog
->
getBody
()
->
shouldBeCalled
()
->
willReturn
(
'test bit.ly test'
);
$blog
->
getType
()
->
shouldBeCalled
()
->
willReturn
(
'object'
);
$blog
->
getSubtype
()
->
shouldBeCalled
()
->
willReturn
(
'blog'
);
...
...
@@ -41,12 +35,6 @@ class SpamSpec extends ObjectBehavior
Comment
$comment
,
ProhibitedDomains
$prohibitedDomains
)
{
$prohibitedDomains
->
get
()
->
shouldBeCalled
()
->
willReturn
([
'bit.ly'
]);
$this
->
beConstructedWith
(
$prohibitedDomains
);
$comment
=
new
Comment
();
$comment
->
setBody
(
'test bit.ly test'
);
$comment
->
setType
(
'comment'
);
...
...
@@ -59,12 +47,6 @@ class SpamSpec extends ObjectBehavior
User
$user
,
ProhibitedDomains
$prohibitedDomains
)
{
$prohibitedDomains
->
get
()
->
shouldBeCalled
()
->
willReturn
([
'bit.ly'
]);
$this
->
beConstructedWith
(
$prohibitedDomains
);
$user
=
new
User
(
'123'
);
$user
[
'briefdescription'
]
=
'test bit.ly test'
;
$user
[
'type'
]
=
'user'
;
...
...
@@ -77,12 +59,6 @@ class SpamSpec extends ObjectBehavior
Group
$group
,
ProhibitedDomains
$prohibitedDomains
)
{
$prohibitedDomains
->
get
()
->
shouldBeCalled
()
->
willReturn
([
'bit.ly'
]);
$this
->
beConstructedWith
(
$prohibitedDomains
);
$group
=
new
Group
();
$group
->
setBriefdescription
(
'test bit.ly test'
);
$group
->
setType
(
'group'
);
...
...
@@ -95,12 +71,6 @@ class SpamSpec extends ObjectBehavior
Blog
$blog
,
ProhibitedDomains
$prohibitedDomains
)
{
$prohibitedDomains
->
get
()
->
shouldBeCalled
()
->
willReturn
([
'bit.ly'
]);
$this
->
beConstructedWith
(
$prohibitedDomains
);
$blog
->
getBody
()
->
shouldBeCalled
()
->
willReturn
(
'test bit.nospam test'
);
$blog
->
getType
()
->
shouldBeCalled
()
->
willReturn
(
'object'
);
$blog
->
getSubtype
()
->
shouldBeCalled
()
->
willReturn
(
'blog'
);
...
...
@@ -112,12 +82,6 @@ class SpamSpec extends ObjectBehavior
Comment
$comment
,
ProhibitedDomains
$prohibitedDomains
)
{
$prohibitedDomains
->
get
()
->
shouldBeCalled
()
->
willReturn
([
'bit.ly'
]);
$this
->
beConstructedWith
(
$prohibitedDomains
);
$comment
=
new
Comment
();
$comment
->
setBody
(
'test bit.nospam test'
);
$comment
->
setType
(
'comment'
);
...
...
@@ -129,12 +93,6 @@ class SpamSpec extends ObjectBehavior
User
$user
,
ProhibitedDomains
$prohibitedDomains
)
{
$prohibitedDomains
->
get
()
->
shouldBeCalled
()
->
willReturn
([
'bit.ly'
]);
$this
->
beConstructedWith
(
$prohibitedDomains
);
$user
=
new
User
(
'123'
);
$user
[
'briefdescription'
]
=
'test bit.nospam test'
;
$user
[
'type'
]
=
'user'
;
...
...
@@ -146,12 +104,6 @@ class SpamSpec extends ObjectBehavior
Group
$group
,
ProhibitedDomains
$prohibitedDomains
)
{
$prohibitedDomains
->
get
()
->
shouldBeCalled
()
->
willReturn
([
'bit.ly'
]);
$this
->
beConstructedWith
(
$prohibitedDomains
);
$group
=
new
Group
();
$group
->
setBriefdescription
(
'test bit.nospam test'
);
$group
->
setType
(
'group'
);
...
...
This diff is collapsed.
Please
register
or
sign in
to comment