ApiTest.php 510 B

1234567891011121314151617
  1. <?php
  2. require_once __DIR__ . "/../vendor/autoload.php";
  3. class ApiTest extends \PHPUnit\Framework\TestCase {
  4. public function test_should_instatiate_with_valid_curve_secp256k1() {
  5. $ec = new \Elliptic\EC('secp256k1');
  6. $this->assertNotNull($ec);
  7. $this->assertInstanceOf(\Elliptic\EC::class, $ec);
  8. }
  9. public function test_should_throw_error_with_invalid_curve() {
  10. $this->expectException(\Exception::class);
  11. $ec = new \Elliptic\EC('nonexistent-curve');
  12. }
  13. }