MystemTest::testStemm()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
3
use \Mystem\Mystem;
4
5
class MystemTest extends \PHPUnit_Framework_TestCase {
6
7
    public function testStemm()
8
    {
9
        $this->assertTrue(is_array(Mystem::stemm('тест')));
10
    }
11
12
    /**
13
     * @expectedException \Exception
14
     */
15
    public function testStemmNotFound()
16
    {
17
        Mystem::$mystemPath = '/WrongPath/';
18
        Mystem::stemm('тест');
19
    }
20
21
    public function testStemmNotRecreated()
22
    {
23
        Mystem::stemm('самолетами');
24
        $tStart = microtime( true );
25
        Mystem::stemm('пароходами');
26
        $tDiff = microtime( true ) - $tStart;
27
        $this->assertLessThan( 0.006, $tDiff, 'Took too long' );
28
    }
29
30
}