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

VariousTest::testGenerateRandom()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 3
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 5
rs 9.4285
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