Skip to content
This repository has been archived by the owner on Jan 30, 2020. It is now read-only.

Commit

Permalink
Merge branch 'hotfix/36'
Browse files Browse the repository at this point in the history
Close #36
Fixes #35
  • Loading branch information
weierophinney committed May 17, 2017
2 parents 993e066 + f22a771 commit e8c1aca
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ All notable changes to this project will be documented in this file, in reverse
ensuring it is injecting the relevant configuration from the `config` service
and thus seeding it with configured translator loader services. This means
that the `filters` configuration will now be honored in non-zend-mvc contexts.
- [#36](https://github.com/zendframework/zend-filter/pull/36) fixes an issue in
the constructor whereby a discovered option was not removed from the options
list after being used to set the compression algorithm.

## 2.7.1 - 2016-04-18

Expand Down
2 changes: 1 addition & 1 deletion src/Encrypt/Openssl.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public function __construct($options = [])

if (array_key_exists('compression', $options)) {
$this->setCompression($options['compression']);
unset($options['compress']);
unset($options['compression']);
}

if (array_key_exists('package', $options)) {
Expand Down
12 changes: 12 additions & 0 deletions test/Encrypt/OpensslTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
namespace ZendTest\Filter\Encrypt;

use PHPUnit\Framework\TestCase;
use ReflectionProperty;
use Zend\Filter\Encrypt\Openssl as OpensslEncryption;
use Zend\Filter\Exception;

Expand Down Expand Up @@ -279,4 +280,15 @@ public function testEncryptionWithDecryptionAndCompressionWithPackagedKeys()
$input = $filter->decrypt($output);
$this->assertEquals('teststring', trim($input));
}

public function testPassCompressionConfigWillBeUnsetCorrectly()
{
$filter = new OpensslEncryption([
'compression' => 'bz2',
]);

$r = new ReflectionProperty($filter, 'keys');
$r->setAccessible(true);
$this->assertArrayNotHasKey('compression', $r->getValue($filter));
}
}

0 comments on commit e8c1aca

Please sign in to comment.