Esempio n. 1
0
 public function testConstructByConfig()
 {
     $options = array('algorithm' => 'blowfish', 'mode' => 'cfb', 'key' => $this->key, 'salt' => $this->salt, 'padding' => 'pkcs7');
     $config = new Config($options);
     $mcrypt = new Mcrypt($config);
     $this->assertTrue($mcrypt instanceof Mcrypt);
     $this->assertEquals($mcrypt->getAlgorithm(), MCRYPT_BLOWFISH);
     $this->assertEquals($mcrypt->getMode(), MCRYPT_MODE_CFB);
     $this->assertEquals($mcrypt->getKey(), substr($this->key, 0, $mcrypt->getKeySize()));
     $this->assertEquals($mcrypt->getSalt(), substr($this->salt, 0, $mcrypt->getSaltSize()));
     $this->assertTrue($mcrypt->getPadding() instanceof PKCS7);
 }