goldrat/vendor/simplito/elliptic-php/tests/ApiTest.php
2025-10-09 17:41:57 +00:00

18 lines
510 B
PHP

<?php
require_once __DIR__ . "/../vendor/autoload.php";
class ApiTest extends \PHPUnit\Framework\TestCase {
public function test_should_instatiate_with_valid_curve_secp256k1() {
$ec = new \Elliptic\EC('secp256k1');
$this->assertNotNull($ec);
$this->assertInstanceOf(\Elliptic\EC::class, $ec);
}
public function test_should_throw_error_with_invalid_curve() {
$this->expectException(\Exception::class);
$ec = new \Elliptic\EC('nonexistent-curve');
}
}