public function testPKIDecryptThrowsExceptionOnBadKey() { if (!extension_loaded('openssl')) { $this->markTestSkipped('The openssl extension is not loaded.'); } $obj = new Adapter\RSA(); $this->setExpectedException('Zend\\InfoCard\\Cipher\\Exception\\RuntimeException', 'Failed to load private key'); $obj->decrypt("Foo", "bar"); }
public function testPKIDecryptBadKey() { if (!extension_loaded('openssl')) { $this->markTestSkipped('The openssl extension is not loaded.'); } $obj = new Adapter\RSA(); try { $obj->decrypt("Foo", "bar"); $this->fail("Exception not thrown as expected"); } catch (\Exception $e) { /* yay */ } }