Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
143 additions
and
167 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
framework/Compress_Fast/test/Horde/Compress/Fast/Driver/Lz4Test.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<?php | ||
/** | ||
* @category Horde | ||
* @package Compress_Fast | ||
* @subpackage UnitTests | ||
*/ | ||
|
||
/** | ||
* @category Horde | ||
* @package Compress_Fast | ||
* @subpackage UnitTests | ||
*/ | ||
class Horde_Compress_Fast_Driver_Lz4Test | ||
extends Horde_Compress_Fast_Driver_TestBase | ||
{ | ||
protected $classname = 'Horde_Compress_Fast_Lz4'; | ||
} |
17 changes: 17 additions & 0 deletions
17
framework/Compress_Fast/test/Horde/Compress/Fast/Driver/LzfTest.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<?php | ||
/** | ||
* @category Horde | ||
* @package Compress_Fast | ||
* @subpackage UnitTests | ||
*/ | ||
|
||
/** | ||
* @category Horde | ||
* @package Compress_Fast | ||
* @subpackage UnitTests | ||
*/ | ||
class Horde_Compress_Fast_Driver_LzfTest | ||
extends Horde_Compress_Fast_Driver_TestBase | ||
{ | ||
protected $classname = 'Horde_Compress_Fast_Lzf'; | ||
} |
17 changes: 17 additions & 0 deletions
17
framework/Compress_Fast/test/Horde/Compress/Fast/Driver/NullTest.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<?php | ||
/** | ||
* @category Horde | ||
* @package Compress_Fast | ||
* @subpackage UnitTests | ||
*/ | ||
|
||
/** | ||
* @category Horde | ||
* @package Compress_Fast | ||
* @subpackage UnitTests | ||
*/ | ||
class Horde_Compress_Fast_Driver_NullTest | ||
extends Horde_Compress_Fast_Driver_TestBase | ||
{ | ||
protected $classname = 'Horde_Compress_Fast_Null'; | ||
} |
61 changes: 61 additions & 0 deletions
61
framework/Compress_Fast/test/Horde/Compress/Fast/Driver/TestBase.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
<?php | ||
/** | ||
* @category Horde | ||
* @package Compress_Fast | ||
* @subpackage UnitTests | ||
*/ | ||
|
||
/** | ||
* @category Horde | ||
* @package Compress_Fast | ||
* @subpackage UnitTests | ||
*/ | ||
class Horde_Compress_Fast_Driver_TestBase extends Horde_Test_Case | ||
{ | ||
protected $classname; | ||
|
||
private $compress_text = 'Foo Foo Foo Foo Foo Foo Foo Foo Foo Foo'; | ||
private $ob; | ||
|
||
protected function setUp() | ||
{ | ||
if (!call_user_func(array($this->classname, 'supported'))) { | ||
$this->markTestSkipped( | ||
sprintf('Driver %s is not available.', $this->classname) | ||
); | ||
} | ||
|
||
$this->ob = new Horde_Compress_Fast(array( | ||
'drivers' => array($this->classname) | ||
)); | ||
} | ||
|
||
public function testCompress() | ||
{ | ||
$data = $this->ob->decompress( | ||
$this->ob->compress($this->compress_text) | ||
); | ||
|
||
$this->assertEquals( | ||
$this->compress_text, | ||
$data | ||
); | ||
} | ||
|
||
/** | ||
* @expectedException Horde_Compress_Fast_Exception | ||
*/ | ||
public function testBadCompress() | ||
{ | ||
$this->ob->compress(array()); | ||
} | ||
|
||
/** | ||
* @expectedException Horde_Compress_Fast_Exception | ||
*/ | ||
public function testBadDecompress() | ||
{ | ||
$this->ob->decompress(new stdClass); | ||
} | ||
|
||
} |
17 changes: 17 additions & 0 deletions
17
framework/Compress_Fast/test/Horde/Compress/Fast/Driver/ZlibTest.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<?php | ||
/** | ||
* @category Horde | ||
* @package Compress_Fast | ||
* @subpackage UnitTests | ||
*/ | ||
|
||
/** | ||
* @category Horde | ||
* @package Compress_Fast | ||
* @subpackage UnitTests | ||
*/ | ||
class Horde_Compress_Fast_Driver_ZlibTest | ||
extends Horde_Compress_Fast_Driver_TestBase | ||
{ | ||
protected $classname = 'Horde_Compress_Fast_Zlib'; | ||
} |