ProfanityWordPurifierTest   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
c 1
b 0
f 0
lcom 0
cbo 2
dl 0
loc 18
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A contentFilterTest() 0 11 1
1
<?php
2
3
namespace AbuseKeywordPurifier\Tests\src\Services;
4
5
use AbuseKeywordPurifier\src\Services\ProfanityWordPurifier;
6
7
class ProfanityWordPurifierTest extends \PHPUnit_Framework_TestCase
8
{
9
    /**
10
     * @test
11
     */
12
    public function contentFilterTest() 
13
    {
14
        $whiteList = ['bitch', 'crap'];
15
        $replaceWith = '*';
16
        $content = "I hate that bitch. It's a crap";
17
        
18
        $actualResult = ProfanityWordPurifier::contentFilter($content, $whiteList, $replaceWith);
19
        $expectedResult = "I hate that *****. It's a ****";
20
        
21
        $this->assertEquals($expectedResult, $actualResult);
22
    }
23
24
}
25