Пример #1
0
 /**
  * @return void
  */
 public function testSettingEmptyVector()
 {
     $filter = new McryptEncryption('newkey');
     $filter->setVector();
 }
Пример #2
0
 /**
  * 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
 /**
  * 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));
 }