コード例 #1
0
ファイル: McryptTest.php プロジェクト: heiglandreas/zf2
 /**
  * @return void
  */
 public function testSettingEmptyVector()
 {
     $filter = new McryptEncryption('newkey');
     $filter->setVector();
 }
コード例 #2
0
ファイル: McryptTest.php プロジェクト: rexmac/zf2
 /**
  * Ensures that the filter allows de/encryption with compression
  *
  * @return void
  */
 public function testEncryptionWithDecryptionAndCompressionMcrypt()
 {
     if (!extension_loaded('bz2')) {
         $this->markTestSkipped('This adapter needs the bz2 extension');
     }
     $filter = new McryptEncryption(array('key' => 'testkey'));
     $filter->setVector('testvect');
     $filter->setCompression('bz2');
     $output = $filter->encrypt('teststring');
     $this->assertNotEquals('teststring', $output);
     $input = $filter->decrypt($output);
     $this->assertEquals('teststring', trim($input));
 }
コード例 #3
0
ファイル: McryptTest.php プロジェクト: robertodormepoco/zf2
 /**
  * Ensures that the filter allows de/encryption with compression
  *
  * @return void
  */
 public function testEncryptionWithDecryptionAndCompressionMcrypt()
 {
     if (version_compare(phpversion(), '5.4', '>=')) {
         $this->markTestIncomplete('Code to test is not compatible with PHP 5.4 ');
     }
     if (!extension_loaded('bz2')) {
         $this->markTestSkipped('This adapter needs the bz2 extension');
     }
     $filter = new McryptEncryption(array('key' => 'testkey'));
     $filter->setVector('testvect');
     $filter->setCompression('bz2');
     $output = $filter->encrypt('teststring');
     $this->assertNotEquals('teststring', $output);
     $input = $filter->decrypt($output);
     $this->assertEquals('teststring', trim($input));
 }