Navigation Menu

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'
Browse files Browse the repository at this point in the history
Close #2667
  • Loading branch information
weierophinney committed Oct 4, 2012
2 parents f4d16ec + 0de06b1 commit 891b89b
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);

$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');
$this->assertEquals('compress me', $content);
}
Expand Down Expand Up @@ -208,15 +208,15 @@ public function testSettingCallbackThrowsExceptionOnMissingCallback()
{
$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');
}

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

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

Expand All @@ -241,7 +241,7 @@ public function testRarCompressFile()
. DIRECTORY_SEPARATOR . 'compressed.rar', $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');
$this->assertEquals('compress me', $content);
}
Expand All @@ -266,9 +266,7 @@ public function testRarCompressDirectory()

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

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

0 comments on commit 891b89b

Please sign in to comment.