public function testPlugins() { $adapter = new _Zend_InfoCard_Test_Adapter(); $infoCard = new Zend_InfoCard(); $infoCard->setAdapter($adapter); $result = $infoCard->getAdapter() instanceof Zend_InfoCard_Adapter_Interface; $this->assertTrue($result); $this->assertTrue($infoCard->getAdapter() instanceof _Zend_InfoCard_Test_Adapter); $infoCard->addCertificatePair($this->sslPrvKey, $this->sslPubKey); $claims = $infoCard->process($this->_xmlDocument); $pki_object = new Zend_InfoCard_Cipher_PKI_Adapter_RSA(Zend_InfoCard_Cipher_PKI_Adapter_Abstract::NO_PADDING); $infoCard->setPKICipherObject($pki_object); $this->assertTrue($pki_object === $infoCard->getPKICipherObject()); $sym_object = new Zend_InfoCard_Cipher_Symmetric_Adapter_AES256CBC(); $infoCard->setSymCipherObject($sym_object); $this->assertTrue($sym_object === $infoCard->getSymCipherObject()); }
/** * Retrieves the InfoCard component adapter being used * * @return Zend_InfoCard_Adapter_Interface */ public function getAdapter() { return $this->_infoCard->getAdapter(); }
public function testPlugins() { if (version_compare(PHP_VERSION, '5.2.0', '<')) { $this->markTestSkipped('DOMDocument::C14N() not available until PHP 5.2.0'); } $adapter = new _Zend_InfoCard_Test_Adapter(); try { $infoCard = new Zend_InfoCard(); } catch (Zend_InfoCard_Exception $e) { $message = $e->getMessage(); if (preg_match('/requires.+mcrypt/', $message)) { $this->markTestSkipped($message); } else { throw $e; } } $infoCard->setAdapter($adapter); $result = $infoCard->getAdapter() instanceof Zend_InfoCard_Adapter_Interface; $this->assertTrue($result); $this->assertTrue($infoCard->getAdapter() instanceof _Zend_InfoCard_Test_Adapter); $infoCard->addCertificatePair($this->sslPrvKey, $this->sslPubKey); $claims = $infoCard->process($this->_xmlDocument); $pki_object = new Zend_InfoCard_Cipher_Pki_Adapter_Rsa(Zend_InfoCard_Cipher_Pki_Adapter_Abstract::NO_PADDING); $infoCard->setPkiCipherObject($pki_object); $this->assertTrue($pki_object === $infoCard->getPkiCipherObject()); $sym_object = new Zend_InfoCard_Cipher_Symmetric_Adapter_Aes256cbc(); $infoCard->setSymCipherObject($sym_object); $this->assertTrue($sym_object === $infoCard->getSymCipherObject()); }