コード例 #1
0
ファイル: CipherTest.php プロジェクト: alab1001101/zf2
 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");
 }
コード例 #2
0
ファイル: CipherTest.php プロジェクト: heiglandreas/zf2
 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 */
     }
 }