7 * This source file is subject to the new BSD license that is bundled
8 * with this package in the file LICENSE.txt.
9 * It is also available through the world-wide-web at this URL:
10 * http://framework.zend.com/license/new-bsd
11 * If you did not receive a copy of the license and are unable to
12 * obtain it through the world-wide-web, please send an email
13 * to license@zend.com so we can send you a copy immediately.
16 * @package Zend_Filter
17 * @subpackage UnitTests
18 * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
19 * @license http://framework.zend.com/license/new-bsd New BSD License
26 require_once dirname(__FILE__
) . '/../../TestHelper.php';
29 * @see Zend_Filter_StringTrim
31 require_once 'Zend/Filter/StringTrim.php';
35 * @package Zend_Filter
36 * @subpackage UnitTests
37 * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
38 * @license http://framework.zend.com/license/new-bsd New BSD License
41 class Zend_Filter_StringTrimTest
extends PHPUnit_Framework_TestCase
44 * Zend_Filter_StringTrim object
46 * @var Zend_Filter_StringTrim
51 * Creates a new Zend_Filter_StringTrim object for each test method
55 public function setUp()
57 $this->_filter
= new Zend_Filter_StringTrim();
61 * Ensures that the filter follows expected behavior
65 public function testBasic()
67 $valuesExpected = array(
72 foreach ($valuesExpected as $input => $output) {
73 $this->assertEquals($output, $this->_filter
->filter($input));
78 * Ensures that getCharList() returns expected default value
82 public function testGetCharList()
84 $this->assertEquals(null, $this->_filter
->getCharList());
88 * Ensures that setCharList() follows expected behavior
92 public function testSetCharList()
94 $this->_filter
->setCharList('&');
95 $this->assertEquals('&', $this->_filter
->getCharList());
99 * Ensures expected behavior under custom character list
103 public function testCharList()
105 $this->_filter
->setCharList('&');
106 $this->assertEquals('a&b', $this->_filter
->filter('&&a&b&&'));
112 public function testZF7183()
114 $this->assertEquals('Зенд', $this->_filter
->filter('Зенд'));
120 public function testZF7902()
122 $this->assertEquals('/', $this->_filter
->filter('/'));