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

Commit

Permalink
Merge branch 'hotfix/2667' into develop
Browse files Browse the repository at this point in the history
Forward port #2667
  • Loading branch information
weierophinney committed Oct 4, 2012
2 parents 7684f9c + 55ab702 commit 34cbdaf
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions tests/ZendTest/Filter/Compress/RarTest.php
Expand Up @@ -108,7 +108,7 @@ public function testBasicUsage()
. DIRECTORY_SEPARATOR . 'compressed.rar', $content); . DIRECTORY_SEPARATOR . 'compressed.rar', $content);


$content = $filter->decompress($content); $content = $filter->decompress($content);
$this->assertEquals(dirname(__DIR__) . DIRECTORY_SEPARATOR . '_files' . DIRECTORY_SEPARATOR, $content); $this->assertTrue($content);
$content = file_get_contents(dirname(__DIR__) . '/_files/zipextracted.txt'); $content = file_get_contents(dirname(__DIR__) . '/_files/zipextracted.txt');
$this->assertEquals('compress me', $content); $this->assertEquals('compress me', $content);
} }
Expand Down Expand Up @@ -208,15 +208,15 @@ public function testSettingCallbackThrowsExceptionOnMissingCallback()
{ {
$filter = new RarCompression(); $filter = new RarCompression();


$this->setExpectedException('Zend\Filter\Exception\InvalidArgumentException', 'must be between'); $this->setExpectedException('Zend\Filter\Exception\RuntimeException', 'No compression callback available');
$filter->compress('test.txt'); $filter->compress('test.txt');
} }


public function testSettingCallbackThrowsExceptionOnInvalidCallback() public function testSettingCallbackThrowsExceptionOnInvalidCallback()
{ {
$filter = new RarCompression(); $filter = new RarCompression();


$this->setExpectedException('Zend\Filter\Exception\InvalidArgumentException', 'must be between'); $this->setExpectedException('Zend\Filter\Exception\InvalidArgumentException', 'Invalid callback provided');
$filter->setCallback('invalidCallback'); $filter->setCallback('invalidCallback');
} }


Expand All @@ -241,7 +241,7 @@ public function testRarCompressFile()
. DIRECTORY_SEPARATOR . 'compressed.rar', $content); . DIRECTORY_SEPARATOR . 'compressed.rar', $content);


$content = $filter->decompress($content); $content = $filter->decompress($content);
$this->assertEquals(dirname(__DIR__) . DIRECTORY_SEPARATOR . '_files' . DIRECTORY_SEPARATOR, $content); $this->assertTrue($content);
$content = file_get_contents(dirname(__DIR__) . '/_files/zipextracted.txt'); $content = file_get_contents(dirname(__DIR__) . '/_files/zipextracted.txt');
$this->assertEquals('compress me', $content); $this->assertEquals('compress me', $content);
} }
Expand All @@ -266,9 +266,7 @@ public function testRarCompressDirectory()


mkdir(dirname(__DIR__) . DIRECTORY_SEPARATOR . '_files' . DIRECTORY_SEPARATOR . '_compress'); mkdir(dirname(__DIR__) . DIRECTORY_SEPARATOR . '_files' . DIRECTORY_SEPARATOR . '_compress');
$content = $filter->decompress($content); $content = $filter->decompress($content);
$this->assertEquals(dirname(__DIR__) $this->assertTrue($content);
. DIRECTORY_SEPARATOR . '_files' . DIRECTORY_SEPARATOR . '_compress'
. DIRECTORY_SEPARATOR, $content);


$base = dirname(__DIR__) . DIRECTORY_SEPARATOR . '_files' $base = dirname(__DIR__) . DIRECTORY_SEPARATOR . '_files'
. DIRECTORY_SEPARATOR . '_compress' . DIRECTORY_SEPARATOR . 'Compress' . DIRECTORY_SEPARATOR; . DIRECTORY_SEPARATOR . '_compress' . DIRECTORY_SEPARATOR . 'Compress' . DIRECTORY_SEPARATOR;
Expand Down

0 comments on commit 34cbdaf

Please sign in to comment.