ArticleTest::testCheckNoBadWords()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 0
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
<?php
2
3
use \Mystem\Article;
4
5
class ArticleTest extends \PHPUnit_Framework_TestCase {
6
7
    public function testLoad()
8
    {
9
        $article = new Article('На дворе смеркалось');
10
        $this->assertCount(3, $article->words);
11
    }
12
13
    public function testGetArticle()
14
    {
15
        $article = new Article('Ёжик в тумане');
16
        $this->assertTrue(is_string($article->getArticle()));
17
    }
18
19
    public function testCheckBadWords()
20
    {
21
        $article = new Article('Не те бляди, что денег ради…');
22
        $this->assertNotEmpty($article->checkBadWords());
23
        $this->assertNotEmpty($article->checkBadWords(true));
24
    }
25
26
    public function testCheckNoBadWords()
27
    {
28
        $article = new Article('Однажды лебедь, рак и щука…');
29
        $this->assertEmpty($article->checkBadWords());
30
    }
31
32
}