Passed
Push — master ( 1b6475...610123 )
by Petr
10:18
created

RedisTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 8
dl 0
loc 15
rs 10
c 1
b 0
f 0
wmc 1
1
<?php
2
3
namespace KeysTests;
4
5
6
use CommonTestClass;
7
use kalanis\UploadPerPartes\Exceptions\UploadException;
8
use kalanis\UploadPerPartes\Keys;
9
use kalanis\UploadPerPartes\Uploader\TargetSearch;
10
use kalanis\UploadPerPartes\Uploader\Translations;
11
use Support;
12
13
14
class RedisTest extends CommonTestClass
15
{
16
    /**
17
     * @throws UploadException
18
     */
19
    public function testThru(): void
20
    {
21
        $lang = new Translations();
22
        $target = new TargetSearch(new Support\InfoRam($lang), new Support\DataRam($lang), $lang);
23
        $target->setRemoteFileName('poiuztrewq')->setTargetDir($this->getTestDir())->process();
24
        $lib = new Keys\Redis($target, $lang);
25
        $lib->generateKeys();
26
27
        $this->assertEquals(md5('poiuztrewq'), $lib->getSharedKey());
28
        $this->assertEquals(Keys\Redis::PREFIX . 'lkjhg', $lib->fromSharedKey('lkjhg'));
29
    }
30
}
31