Adding tests for Validation::notEmpty using ISO-8859-1 for App.encoding value, along with additional non-ascii utf-8 assertions. Disproves & closes #6101.

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@8063 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
jperras 2009-02-26 16:48:00 +00:00
parent 0be4f64801
commit b8feef23a8

View file

@ -77,7 +77,28 @@ class ValidationTestCase extends CakeTestCase {
$this->assertTrue(Validation::notEmpty('abcdefg'));
$this->assertTrue(Validation::notEmpty('fasdf '));
$this->assertTrue(Validation::notEmpty('fooo'.chr(243).'blabla'));
$this->assertTrue(Validation::notEmpty('abçďĕʑʘπй'));
$this->assertTrue(Validation::notEmpty('José'));
$this->assertTrue(Validation::notEmpty('é'));
$this->assertTrue(Validation::notEmpty('π'));
$this->assertFalse(Validation::notEmpty("\t "));
$this->assertFalse(Validation::notEmpty(""));
}
/**
* testNotEmptyISO88591Encoding method
*
* @return void
* @access public
*/
function testNotEmptyISO88591AppEncoding() {
Configure::write('App.encoding', 'ISO-8859-1');
$this->assertTrue(Validation::notEmpty('abcdefg'));
$this->assertTrue(Validation::notEmpty('fasdf '));
$this->assertTrue(Validation::notEmpty('fooo'.chr(243).'blabla'));
$this->assertTrue(Validation::notEmpty('abçďĕʑʘπй'));
$this->assertTrue(Validation::notEmpty('José'));
$this->assertTrue(Validation::notEmpty(utf8_decode('José')));
$this->assertFalse(Validation::notEmpty("\t "));
$this->assertFalse(Validation::notEmpty(""));
}