diff options
| author | jwijenbergh <jeroenwijenbergh@protonmail.com> | 2022-09-20 15:07:40 +0200 |
|---|---|---|
| committer | jwijenbergh <jeroenwijenbergh@protonmail.com> | 2022-09-20 15:07:40 +0200 |
| commit | 2a619ceba75a4c16b25de12d59a87eac795a4468 (patch) | |
| tree | 1d63a35217011fa761b703633b3f91fd839ec71e /wrappers/php/tests/DiscoveryTest.php | |
| parent | 7e309b67de74fe5bd5a1c70c1880c2a381c4f78b (diff) | |
Remove: unused wrappers
Diffstat (limited to 'wrappers/php/tests/DiscoveryTest.php')
| -rw-r--r-- | wrappers/php/tests/DiscoveryTest.php | 58 |
1 files changed, 0 insertions, 58 deletions
diff --git a/wrappers/php/tests/DiscoveryTest.php b/wrappers/php/tests/DiscoveryTest.php deleted file mode 100644 index 9a3e14c..0000000 --- a/wrappers/php/tests/DiscoveryTest.php +++ /dev/null @@ -1,58 +0,0 @@ -<?php declare(strict_types=1); - -use EduVpn\Common\Discovery; -use EduVpn\Common\InvalidSignatureException; -use EduVpn\Common\InvalidSignatureUnknownKeyException; -use EduVpn\Common\SignatureTooOldException; -use PHPUnit\Framework\TestCase; - -class DiscoveryTest extends TestCase -{ - private const TEST_DATA_DIR = '../../src/test_data'; - - public static function setUpBeforeClass(): void - { - preg_match('/[\r\n](\S+)\s*/', file_get_contents(self::TEST_DATA_DIR . '/public.key'), $matches); - Discovery::insecureTestingSetExtraKey($matches[1]); - } - - public function testValid(): void - { - $this->expectNotToPerformAssertions(); - Discovery::verify(file_get_contents(self::TEST_DATA_DIR . '/server_list.json.minisig'), - file_get_contents(self::TEST_DATA_DIR . '/server_list.json'), - 'server_list.json', 10); - } - - public function testInvalidSignature(): void - { - $this->expectException(InvalidSignatureException::class); - Discovery::verify(file_get_contents(self::TEST_DATA_DIR . '/random.txt'), - file_get_contents(self::TEST_DATA_DIR . '/server_list.json'), - 'server_list.json', 0); - } - - public function testWrongKey(): void - { - $this->expectException(InvalidSignatureUnknownKeyException::class); - Discovery::verify(file_get_contents(self::TEST_DATA_DIR . '/server_list.json.wrong_key.minisig'), - file_get_contents(self::TEST_DATA_DIR . '/server_list.json'), - 'server_list.json', 0); - } - - public function testOldSignature(): void - { - $this->expectException(SignatureTooOldException::class); - Discovery::verify(file_get_contents(self::TEST_DATA_DIR . '/server_list.json.minisig'), - file_get_contents(self::TEST_DATA_DIR . '/server_list.json'), - 'server_list.json', 11); - } - - public function testUnknownExpectedFileName(): void - { - $this->expectException(InvalidArgumentException::class); - Discovery::verify(file_get_contents(self::TEST_DATA_DIR . '/other_list.json.minisig'), - file_get_contents(self::TEST_DATA_DIR . '/other_list.json'), - 'other_list.json', 0); - } -} |
