public function testGenerate() { if (extension_loaded('gmp')) { \Bitpay\Math\Math::setEngine(new \Bitpay\Math\GmpEngine()); } elseif (extension_loaded('bcmath')) { \Bitpay\Math\Math::setEngine(new \Bitpay\Math\BcEngine()); } else { \Bitpay\Math\Math::setEngine(new \Bitpay\Math\RpEngine()); } $priKey = new PrivateKey(); $this->assertNotNull($priKey); $this->assertNull($priKey->getHex()); $this->assertNull($priKey->getDec()); $priKey->generate(); $this->assertEquals(64, strlen($priKey->getHex())); $this->assertGreaterThanOrEqual(72, strlen($priKey->getDec())); }