Completed
Branch master (cbd358)
by Pierre-Henry
36:07
created

VariousTest   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A testGenerateRandom() 0 5 1
A testPaddingString() 0 4 1
A testGenerateRandomWord() 0 5 1
1
<?php
2
/**
3
 * @author           Pierre-Henry Soria <[email protected]>
4
 * @copyright        (c) 2017, Pierre-Henry Soria. All Rights Reserved.
5
 * @license          GNU General Public License; See PH7.LICENSE.txt and PH7.COPYRIGHT.txt in the root directory.
6
 * @package          PH7 / Test / Unit / Framework / Util
7
 */
8
9
namespace PH7\Test\Unit\Framework\Util;
10
11
use PH7\Framework\Util\Various;
12
use PHPUnit_Framework_TestCase;
13
14
class VariousTest extends PHPUnit_Framework_TestCase
15
{
16
    public function testGenerateRandom()
17
    {
18
        $iStringLength = strlen(Various::genRnd('Pierre-Henry Random :D', 8));
19
        $this->assertSame(8, $iStringLength);
20
    }
21
22
    public function testPaddingString()
23
    {
24
        $this->assertSame('abc def ghiabc def ghiabc def ghiabc def', Various::padStr('abc def ghi', 40));
25
    }
26
27
    public function testGenerateRandomWord()
28
    {
29
        $iStringLength = strlen(Various::genRndWord(10));
30
        $this->assertSame(10, $iStringLength);
31
    }
32
}
33