ZF-8222: format class name for class checks
[zend.git] / tests / Zend / Filter / StringTrimTest.php
blobd6140e6d6cd2d379d04f5ffaf2cdf815bbff12ee
1 <?php
2 /**
3 * Zend Framework
5 * LICENSE
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.
15 * @category Zend
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
20 * @version $Id$
23 /**
24 * Test helper
26 require_once dirname(__FILE__) . '/../../TestHelper.php';
28 /**
29 * @see Zend_Filter_StringTrim
31 require_once 'Zend/Filter/StringTrim.php';
33 /**
34 * @category Zend
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
39 * @group Zend_Filter
41 class Zend_Filter_StringTrimTest extends PHPUnit_Framework_TestCase
43 /**
44 * Zend_Filter_StringTrim object
46 * @var Zend_Filter_StringTrim
48 protected $_filter;
50 /**
51 * Creates a new Zend_Filter_StringTrim object for each test method
53 * @return void
55 public function setUp()
57 $this->_filter = new Zend_Filter_StringTrim();
60 /**
61 * Ensures that the filter follows expected behavior
63 * @return void
65 public function testBasic()
67 $valuesExpected = array(
68 'string' => 'string',
69 ' str ' => 'str',
70 "\ns\t" => 's'
72 foreach ($valuesExpected as $input => $output) {
73 $this->assertEquals($output, $this->_filter->filter($input));
77 /**
78 * Ensures that getCharList() returns expected default value
80 * @return void
82 public function testGetCharList()
84 $this->assertEquals(null, $this->_filter->getCharList());
87 /**
88 * Ensures that setCharList() follows expected behavior
90 * @return void
92 public function testSetCharList()
94 $this->_filter->setCharList('&');
95 $this->assertEquals('&', $this->_filter->getCharList());
98 /**
99 * Ensures expected behavior under custom character list
101 * @return void
103 public function testCharList()
105 $this->_filter->setCharList('&');
106 $this->assertEquals('a&b', $this->_filter->filter('&&a&b&&'));
110 * @ZF-7183
112 public function testZF7183()
114 $this->assertEquals('Зенд', $this->_filter->filter('Зенд'));
118 * @ZF-7902
120 public function testZF7902()
122 $this->assertEquals('/', $this->_filter->filter('/'));