mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-31 09:06:17 +00:00
Adding tests for multibyte validation.
This commit is contained in:
parent
2c144a9d0d
commit
fc0e50f64a
1 changed files with 9 additions and 0 deletions
|
@ -177,7 +177,10 @@ class ValidationTest extends CakeTestCase {
|
|||
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 @@ class ValidationTest extends CakeTestCase {
|
|||
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 @@ class ValidationTest extends CakeTestCase {
|
|||
*/
|
||||
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));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Reference in a new issue