public function compress($text)
{
if (!is_scalar($text) && !is_null($text)) {
throw new Horde_Compress_Fast_Exception('Data to compress must be a string.');
}
return $this->_compress->compress(strval($text));
}
/** * @dataProvider providerTestStringInput */ public function testStringInput($data, $success) { $ob = new Horde_Compress_Fast(array('drivers' => array('Horde_Compress_Fast_Null'))); try { $ob->compress($data); if (!$success) { $this->fail('Expected exception.'); } } catch (Horde_Compress_Fast_Exception $e) { if ($success) { $this->fail('Unexpected exception.'); } } }