Conditions | 2 |
Paths | 2 |
Total Lines | 17 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
23 | public static function testGenerateKeys() |
||
24 | { |
||
25 | CryptHelper::generateKeys(); |
||
26 | |||
27 | $files = ['oauth-private.key', 'oauth-public.key']; |
||
28 | foreach ($files as $file) { |
||
29 | $path = storage_path($file); |
||
30 | self::assertFileExists($path); |
||
31 | |||
32 | $content = file_get_contents($path); |
||
33 | self::assertStringStartsWith('-----BEGIN', $content); |
||
34 | self::assertStringEndsWith('KEY-----', $content); |
||
35 | |||
36 | self::assertGreaterThan(100, filesize($path), "output file [{$file}] should be at least 100bytes"); |
||
37 | unlink($path); |
||
38 | } |
||
39 | } |
||
40 | } |
||
54 |