| Total Complexity | 1 |
| Total Lines | 18 |
| Duplicated Lines | 0 % |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 14 | class VolumeTest 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('/tmp/')->process(); |
||
| 24 | $lib = new Keys\SimpleVolume($target, $lang); |
||
| 25 | $lib->generateKeys(); |
||
| 26 | |||
| 27 | $this->assertEquals(base64_encode('/tmp/poiuztrewq' . TargetSearch::FILE_DRIVER_SUFF), $lib->getSharedKey()); |
||
| 28 | $this->assertEquals('/tmp/lkjhg', $lib->fromSharedKey(base64_encode('/tmp/lkjhg'))); |
||
| 29 | $this->expectException(UploadException::class); |
||
| 30 | $lib->fromSharedKey('**/tmp/lkjhg'); // aaand failed... - chars outside the b64 |
||
| 31 | $this->expectExceptionMessageMatches('SHARED KEY IS INVALID'); |
||
| 32 | } |
||
| 34 |