| Conditions | 2 |
| Paths | 2 |
| Total Lines | 15 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 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 = \Nip\storage_path('hello/keys/' . $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 | } |
||
| 54 |