1<?php
2/**
3 * Copyright 2011-2017 Horde LLC (http://www.horde.org/)
4 *
5 * See the enclosed file LICENSE for license information (LGPL-2.1). If you
6 * did not receive this file, see http://www.horde.org/licenses/lgpl21.
7 *
8 * @author     Michael Slusarz <slusarz@horde.org>
9 * @category   Horde
10 * @license    http://www.horde.org/licenses/lgpl21 LGPL-2.1
11 * @package    Compress
12 * @subpackage UnitTests
13 */
14
15/**
16 * Tests the RAR compressor.
17 *
18 * @author     Michael Slusarz <slusarz@horde.org>
19 * @category   Horde
20 * @copyright  2011-2017 Horde LLC
21 * @license    http://www.horde.org/licenses/lgpl21 LGPL-2.1
22 * @package    Compress
23 * @subpackage UnitTests
24 */
25class Horde_Compress_RarTest extends Horde_Test_Case
26{
27    public function testInvalidRarData()
28    {
29        $compress = Horde_Compress::factory('Rar');
30
31        try {
32            $compress->decompress('1234');
33            $this->fail('Expected exception.');
34        } catch (Horde_Compress_Exception $e) {}
35
36        try {
37            $compress->decompress(Horde_Compress_Rar::BLOCK_START . '1234');
38            $this->fail('Expected exception.');
39        } catch (Horde_Compress_Exception $e) {}
40
41        $compress->decompress(Horde_Compress_Rar::BLOCK_START . '1234567');
42    }
43
44}
45