Skip to content
Permalink
Browse files

Adding tests for multibyte validation.

  • Loading branch information...
markstory committed Sep 29, 2009
1 parent 2c144a9 commit fc0e50f64aa09a36357d6928dce0b1b65a968bb9
Showing with 9 additions and 0 deletions.
  1. +9 −0 cake/tests/cases/libs/validation.test.php
@@ -177,7 +177,10 @@ function testAlphaNumericPassedAsArray() {
function testBetween() {
$this->assertTrue(Validation::between('abcdefg', 1, 7));
$this->assertTrue(Validation::between('', 0, 7));
$this->assertTrue(Validation::between('אกあアꀀ豈', 1, 7));
$this->assertFalse(Validation::between('abcdefg', 1, 6));
$this->assertFalse(Validation::between('ÆΔΩЖÇ', 1, 3));
}
/**
@@ -1698,7 +1701,10 @@ function testIp() {
function testMaxLength() {
$this->assertTrue(Validation::maxLength('ab', 3));
$this->assertTrue(Validation::maxLength('abc', 3));
$this->assertTrue(Validation::maxLength('ÆΔΩЖÇ', 10));
$this->assertFalse(Validation::maxLength('abcd', 3));
$this->assertFalse(Validation::maxLength('ÆΔΩЖÇ', 3));
}
/**
@@ -1709,8 +1715,11 @@ function testMaxLength() {
*/
function testMinLength() {
$this->assertFalse(Validation::minLength('ab', 3));
$this->assertFalse(Validation::minLength('ÆΔΩЖÇ', 10));
$this->assertTrue(Validation::minLength('abc', 3));
$this->assertTrue(Validation::minLength('abcd', 3));
$this->assertTrue(Validation::minLength('ÆΔΩЖÇ', 2));
}
/**

0 comments on commit fc0e50f

Please sign in to comment.
You can’t perform that action at this time.